test: fix tests to work on node6 (#4851)
Our magical node6 transpiler can't handle object spreads :( Drive-by: use "includes" instead of "startsWith" for devtools URL since I remember that it used to be "chrome-devtools://", and somehow I saw it as "devtools://" somewhere.
This commit is contained in:
parent
f47ed1649c
commit
f595bc0b67
@ -118,11 +118,11 @@ module.exports.addTests = function({testRunner, expect, puppeteer, defaultBrowse
|
|||||||
await browser.close();
|
await browser.close();
|
||||||
});
|
});
|
||||||
it('should open devtools when "devtools: true" option is given', async({server}) => {
|
it('should open devtools when "devtools: true" option is given', async({server}) => {
|
||||||
const browser = await puppeteer.launch({...headfulOptions, devtools: true});
|
const browser = await puppeteer.launch(Object.assign({devtools: true}, headfulOptions));
|
||||||
const context = await browser.createIncognitoBrowserContext();
|
const context = await browser.createIncognitoBrowserContext();
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
context.newPage(),
|
context.newPage(),
|
||||||
context.waitForTarget(target => target.url().startsWith('devtools://')),
|
context.waitForTarget(target => target.url().includes('devtools://')),
|
||||||
]);
|
]);
|
||||||
await browser.close();
|
await browser.close();
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user