From 4affbb2df10b3aaacf46b834d25bbd3108fe58e0 Mon Sep 17 00:00:00 2001 From: Andrey Belym Date: Tue, 20 Jun 2017 01:35:14 +0300 Subject: [PATCH] Fix typo in TS defs (closes #1541) (#1542) * Fix typo in TS defs (closes #1541) * Update comment about a BrowserStack issue --- test/functional/setup.js | 20 +++++++++++++++++-- .../data/test-suites/typescript-defs/roles.ts | 2 +- ts-defs/index.d.ts | 2 +- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/test/functional/setup.js b/test/functional/setup.js index ca8ff328244..e359f244383 100644 --- a/test/functional/setup.js +++ b/test/functional/setup.js @@ -71,8 +71,24 @@ function openRemoteBrowsers () { }; var openBrowserPromises = browsersInfo.map(function (browserInfo) { - return connector.startBrowser(browserInfo.settings, browserInfo.connection.url, buildInfo, - isBrowserStack ? { openingTimeout: BROWSER_OPENING_TIMEOUT } : null); + if (!isBrowserStack || browserInfo.settings.alias !== 'chrome-osx') { + return connector.startBrowser(browserInfo.settings, browserInfo.connection.url, buildInfo, + isBrowserStack ? { openingTimeout: BROWSER_OPENING_TIMEOUT } : null); + } + + // HACK: BrowserStack issue: an extension opens a new tab in Chrome during testing. The tab + // where the tests are run becames unfocused and the tests hang there. To aviod this we wait + // for 5 minutes to be sure that a new tab is opened by the extension and run tests after that. + // TODO: Remove the hack once the issue is fixed on BrowserStack. + return connector + .startBrowser(browserInfo.settings, 'about:blank', buildInfo, { openingTimeout: BROWSER_OPENING_TIMEOUT }) + .then(browser => (new Promise(r => setTimeout(r, 5 * 60 * 1000))).then(() => browser)) + .then(browser => { + return new Promise(resolve => { + connector.client.changeUrl(browser.id, { url: browserInfo.connection.url }, resolve); + }) + .then(() => browser); + }); }); return Promise.all(openBrowserPromises); diff --git a/test/server/data/test-suites/typescript-defs/roles.ts b/test/server/data/test-suites/typescript-defs/roles.ts index 6bf51fdcce5..bc87882b1fd 100644 --- a/test/server/data/test-suites/typescript-defs/roles.ts +++ b/test/server/data/test-suites/typescript-defs/roles.ts @@ -7,7 +7,7 @@ const someUser = Role('http://localhost:3000/fixtures/api/es-next/roles/pages/lo await t .typeText('input[name="name"]', 'SomeUser') .click('input[value="LogIn"]'); -}); +}, { preserveUrl: false }); fixture `AnonymousRole` .page `http://localhost:3000/fixtures/api/es-next/roles/pages/index.html`; diff --git a/ts-defs/index.d.ts b/ts-defs/index.d.ts index ef8043b77ca..363d7d1c2c4 100644 --- a/ts-defs/index.d.ts +++ b/ts-defs/index.d.ts @@ -693,7 +693,7 @@ interface RoleOptions { * * This option is useful if you store session-related data (like session ID) in the URL. */ - preseveUrl?: boolean; + preserveUrl?: boolean; }