mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
test: improve handling of browser context on error (#12020)
This commit is contained in:
parent
bec77d61e6
commit
11a6d7e58d
@ -225,6 +225,7 @@ describe('Cookie specs', () => {
|
|||||||
const {page, server, browser} = await getTestState();
|
const {page, server, browser} = await getTestState();
|
||||||
|
|
||||||
const anotherContext = await browser.createBrowserContext();
|
const anotherContext = await browser.createBrowserContext();
|
||||||
|
try {
|
||||||
const anotherPage = await anotherContext.newPage();
|
const anotherPage = await anotherContext.newPage();
|
||||||
|
|
||||||
await page.goto(server.EMPTY_PAGE);
|
await page.goto(server.EMPTY_PAGE);
|
||||||
@ -241,7 +242,9 @@ describe('Cookie specs', () => {
|
|||||||
expect(cookies1[0]!.value).toBe('page1value');
|
expect(cookies1[0]!.value).toBe('page1value');
|
||||||
expect(cookies2[0]!.name).toBe('page2cookie');
|
expect(cookies2[0]!.name).toBe('page2cookie');
|
||||||
expect(cookies2[0]!.value).toBe('page2value');
|
expect(cookies2[0]!.value).toBe('page2value');
|
||||||
|
} finally {
|
||||||
await anotherContext.close();
|
await anotherContext.close();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
it('should set multiple cookies', async () => {
|
it('should set multiple cookies', async () => {
|
||||||
const {page, server} = await getTestState();
|
const {page, server} = await getTestState();
|
||||||
|
Loading…
Reference in New Issue
Block a user