test: fix cookie tests on WebKit (#2359)
WebKit does not allow third party cookies.
This commit is contained in:
parent
43eed027bd
commit
d532cd5d9f
|
|
@ -111,9 +111,9 @@ describe('launchPersistentContext()', function() {
|
||||||
document.cookie = 'username=John Doe';
|
document.cookie = 'username=John Doe';
|
||||||
return document.cookie;
|
return document.cookie;
|
||||||
});
|
});
|
||||||
expect(documentCookie).toBe('username=John Doe');
|
|
||||||
await page.waitForTimeout(2000);
|
await page.waitForTimeout(2000);
|
||||||
const allowsThirdParty = CHROMIUM || FFOX;
|
const allowsThirdParty = CHROMIUM || FFOX;
|
||||||
|
expect(documentCookie).toBe(allowsThirdParty ? 'username=John Doe' : '');
|
||||||
const cookies = await context.cookies(server.CROSS_PROCESS_PREFIX + '/grid.html');
|
const cookies = await context.cookies(server.CROSS_PROCESS_PREFIX + '/grid.html');
|
||||||
if (allowsThirdParty) {
|
if (allowsThirdParty) {
|
||||||
expect(cookies).toEqual([
|
expect(cookies).toEqual([
|
||||||
|
|
|
||||||
|
|
@ -96,9 +96,9 @@ describe('Headful', function() {
|
||||||
document.cookie = 'username=John Doe';
|
document.cookie = 'username=John Doe';
|
||||||
return document.cookie;
|
return document.cookie;
|
||||||
});
|
});
|
||||||
expect(documentCookie).toBe('username=John Doe');
|
|
||||||
await page.waitForTimeout(2000);
|
await page.waitForTimeout(2000);
|
||||||
const allowsThirdParty = CHROMIUM || FFOX;
|
const allowsThirdParty = CHROMIUM || FFOX;
|
||||||
|
expect(documentCookie).toBe(allowsThirdParty ? 'username=John Doe' : '');
|
||||||
const cookies = await page.context().cookies(server.CROSS_PROCESS_PREFIX + '/grid.html');
|
const cookies = await page.context().cookies(server.CROSS_PROCESS_PREFIX + '/grid.html');
|
||||||
if (allowsThirdParty) {
|
if (allowsThirdParty) {
|
||||||
expect(cookies).toEqual([
|
expect(cookies).toEqual([
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue