test: add test that validates that pages open with userDataDir arg (#2564)
References #2538.
This commit is contained in:
parent
51645932b7
commit
2d9e5a0d25
@ -129,6 +129,8 @@ module.exports.addTests = function({testRunner, expect, PROJECT_ROOT, defaultBro
|
|||||||
const userDataDir = await mkdtempAsync(TMP_FOLDER);
|
const userDataDir = await mkdtempAsync(TMP_FOLDER);
|
||||||
const options = Object.assign({userDataDir}, defaultBrowserOptions);
|
const options = Object.assign({userDataDir}, defaultBrowserOptions);
|
||||||
const browser = await puppeteer.launch(options);
|
const browser = await puppeteer.launch(options);
|
||||||
|
// Open a page to make sure its functional.
|
||||||
|
await browser.newPage();
|
||||||
expect(fs.readdirSync(userDataDir).length).toBeGreaterThan(0);
|
expect(fs.readdirSync(userDataDir).length).toBeGreaterThan(0);
|
||||||
await browser.close();
|
await browser.close();
|
||||||
expect(fs.readdirSync(userDataDir).length).toBeGreaterThan(0);
|
expect(fs.readdirSync(userDataDir).length).toBeGreaterThan(0);
|
||||||
|
Loading…
Reference in New Issue
Block a user