test: try to unflake cookie test (#2310)
Happens on WebKit sometimes. There is probably a race between setting a cookie and saving it in the cookie jar in another process.
This commit is contained in:
parent
8e396fdac0
commit
b17a73c184
|
|
@ -88,12 +88,14 @@ describe('BrowserContext.cookies', function() {
|
|||
});
|
||||
it('should get multiple cookies', async({context, page, server}) => {
|
||||
await page.goto(server.EMPTY_PAGE);
|
||||
await page.evaluate(() => {
|
||||
const documentCookie = await page.evaluate(() => {
|
||||
document.cookie = 'username=John Doe';
|
||||
document.cookie = 'password=1234';
|
||||
return document.cookie.split('; ').sort().join('; ');
|
||||
});
|
||||
const cookies = await context.cookies();
|
||||
cookies.sort((a, b) => a.name.localeCompare(b.name));
|
||||
expect(documentCookie).toBe('password=1234; username=John Doe');
|
||||
expect(cookies).toEqual([
|
||||
{
|
||||
name: 'password',
|
||||
|
|
|
|||
Loading…
Reference in a new issue