test(firefox): run puppeteer-firefox tests in browser contexts (#3887)

This patch starts running all Puppeteer-Firefox tests in separate
browser contexts.
This commit is contained in:
Andrey Lushnikov 2019-02-01 14:52:25 -08:00 committed by GitHub
parent bd347558bc
commit fd67fa7a36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -8,7 +8,7 @@
"node": ">=8.9.4" "node": ">=8.9.4"
}, },
"puppeteer": { "puppeteer": {
"firefox_revision": "2a2b2cd2c5e5b7062e7ede93b235a5a062d4dc9a" "firefox_revision": "ca4758c475a9c05dc88b7b8811fbbb7e5acf95b4"
}, },
"scripts": { "scripts": {
"install": "node install.js", "install": "node install.js",

View File

@ -63,11 +63,13 @@ module.exports.addTests = ({testRunner, product, puppeteer}) => testRunner.descr
describe('Page', () => { describe('Page', () => {
beforeEach(async state => { beforeEach(async state => {
state.page = await state.browser.newPage(); state.context = await state.browser.createIncognitoBrowserContext();
state.page = await state.context.newPage();
}); });
afterEach(async state => { afterEach(async state => {
await state.page.close(); await state.context.close();
state.context = null;
state.page = null; state.page = null;
}); });