test: add test that validates that pages open with userDataDir arg (#2564)

References #2538.
This commit is contained in:
Andrey Lushnikov 2018-05-17 14:49:03 -07:00 committed by GitHub
parent 51645932b7
commit 2d9e5a0d25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -129,6 +129,8 @@ module.exports.addTests = function({testRunner, expect, PROJECT_ROOT, defaultBro
const userDataDir = await mkdtempAsync(TMP_FOLDER);
const options = Object.assign({userDataDir}, defaultBrowserOptions);
const browser = await puppeteer.launch(options);
// Open a page to make sure its functional.
await browser.newPage();
expect(fs.readdirSync(userDataDir).length).toBeGreaterThan(0);
await browser.close();
expect(fs.readdirSync(userDataDir).length).toBeGreaterThan(0);