From d532cd5d9ff787c1c5e48ed42e52a8832cf7eee0 Mon Sep 17 00:00:00 2001 From: Dmitry Gozman Date: Tue, 26 May 2020 10:22:53 -0700 Subject: [PATCH] test: fix cookie tests on WebKit (#2359) WebKit does not allow third party cookies. --- test/defaultbrowsercontext.spec.js | 2 +- test/headful.spec.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/defaultbrowsercontext.spec.js b/test/defaultbrowsercontext.spec.js index 5b187dc540..ccd65b5e98 100644 --- a/test/defaultbrowsercontext.spec.js +++ b/test/defaultbrowsercontext.spec.js @@ -111,9 +111,9 @@ describe('launchPersistentContext()', function() { document.cookie = 'username=John Doe'; return document.cookie; }); - expect(documentCookie).toBe('username=John Doe'); await page.waitForTimeout(2000); const allowsThirdParty = CHROMIUM || FFOX; + expect(documentCookie).toBe(allowsThirdParty ? 'username=John Doe' : ''); const cookies = await context.cookies(server.CROSS_PROCESS_PREFIX + '/grid.html'); if (allowsThirdParty) { expect(cookies).toEqual([ diff --git a/test/headful.spec.js b/test/headful.spec.js index 061aaf7df9..b3b07d4b3b 100644 --- a/test/headful.spec.js +++ b/test/headful.spec.js @@ -96,9 +96,9 @@ describe('Headful', function() { document.cookie = 'username=John Doe'; return document.cookie; }); - expect(documentCookie).toBe('username=John Doe'); await page.waitForTimeout(2000); const allowsThirdParty = CHROMIUM || FFOX; + expect(documentCookie).toBe(allowsThirdParty ? 'username=John Doe' : ''); const cookies = await page.context().cookies(server.CROSS_PROCESS_PREFIX + '/grid.html'); if (allowsThirdParty) { expect(cookies).toEqual([