mirror of
https://github.com/microsoft/playwright.git
synced 2025-01-05 10:15:12 +03:00
fix(tests): fix test that was leaking a context (#933)
This commit is contained in:
parent
aae5fca237
commit
6105d8a26a
@ -42,6 +42,7 @@ module.exports.describe = function({testRunner, expect, playwright, CHROMIUM, WE
|
||||
const page = await browser.newPage();
|
||||
let error;
|
||||
await page.context().newPage().catch(e => error = e);
|
||||
await page.close();
|
||||
expect(error.message).toContain('Please use browser.newContext()');
|
||||
});
|
||||
});
|
||||
|
@ -118,6 +118,7 @@ module.exports.describe = ({testRunner, product, playwrightPath}) => {
|
||||
|
||||
state.tearDown = async () => {
|
||||
await Promise.all(contexts.map(c => c.close()));
|
||||
expect((await state.browser.contexts()).length).toBe(0, `"${test.fullName}" leaked a context`);
|
||||
if (rl) {
|
||||
rl.removeListener('line', onLine);
|
||||
rl.close();
|
||||
|
Loading…
Reference in New Issue
Block a user