Co-authored-by: Bob Jamison <bob.jamison@pearson.com>
This commit is contained in:
parent
f2e19276ac
commit
113489d3b5
@ -164,7 +164,7 @@ class ChromeLauncher implements ProductLauncher {
|
|||||||
runner.close.bind(runner)
|
runner.close.bind(runner)
|
||||||
);
|
);
|
||||||
if (waitForInitialPage)
|
if (waitForInitialPage)
|
||||||
await browser.waitForTarget((t) => t.type() === 'page');
|
await browser.waitForTarget((t) => t.type() === 'page', { timeout });
|
||||||
return browser;
|
return browser;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
runner.kill();
|
runner.kill();
|
||||||
@ -336,7 +336,7 @@ class FirefoxLauncher implements ProductLauncher {
|
|||||||
runner.close.bind(runner)
|
runner.close.bind(runner)
|
||||||
);
|
);
|
||||||
if (waitForInitialPage)
|
if (waitForInitialPage)
|
||||||
await browser.waitForTarget((t) => t.type() === 'page');
|
await browser.waitForTarget((t) => t.type() === 'page', { timeout });
|
||||||
return browser;
|
return browser;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
runner.kill();
|
runner.kill();
|
||||||
|
@ -392,6 +392,15 @@ describe('Launcher specs', function () {
|
|||||||
await browser.close();
|
await browser.close();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
it('should pass the timeout parameter to browser.waitForTarget', async () => {
|
||||||
|
const { puppeteer, defaultBrowserOptions } = getTestState();
|
||||||
|
const options = Object.assign({}, defaultBrowserOptions, {
|
||||||
|
timeout: 1,
|
||||||
|
});
|
||||||
|
let error = null;
|
||||||
|
await puppeteer.launch(options).catch((error_) => (error = error_));
|
||||||
|
expect(error).toBeInstanceOf(puppeteer.errors.TimeoutError);
|
||||||
|
});
|
||||||
it('should set the default viewport', async () => {
|
it('should set the default viewport', async () => {
|
||||||
const { puppeteer, defaultBrowserOptions } = getTestState();
|
const { puppeteer, defaultBrowserOptions } = getTestState();
|
||||||
const options = Object.assign({}, defaultBrowserOptions, {
|
const options = Object.assign({}, defaultBrowserOptions, {
|
||||||
|
Loading…
Reference in New Issue
Block a user