Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

test: update cookie expectations for macOS 15 (#32674)

Max Schmitt9fc195bff5cd
diff --git a/tests/config/browserTest.ts b/tests/config/browserTest.ts
index 44aaca9d26..c301233e07 100644
--- a/tests/config/browserTest.ts
+++ b/tests/config/browserTest.ts
@@ -69,12 +69,16 @@ const test = baseTest.extend<BrowserTestTestFixtures, BrowserTestWorkerFixtures>
await run(false);
}, { scope: 'worker' }],
- defaultSameSiteCookieValue: [async ({ browserName, isLinux }, run) => {
+ defaultSameSiteCookieValue: [async ({ browserName, platform }, run) => {
if (browserName === 'chromium' || browserName as any === '_bidiChromium')
await run('Lax');
- else if (browserName === 'webkit' && isLinux)
+ else if (browserName === 'webkit' && platform === 'linux')
await run('Lax');
- else if (browserName === 'webkit' && !isLinux)
+ else if (browserName === 'webkit' && platform === 'darwin' && parseInt(os.release(), 10) >= 24)
+ // macOS 15 Sequoia onwards
+ await run('Lax');
+ else if (browserName === 'webkit')
+ // Windows + older macOS
await run('None');
else if (browserName === 'firefox' || browserName as any === '_bidiFirefox')
await run('None');
diff --git a/tests/library/browsercontext-cookies.spec.ts b/tests/library/browsercontext-cookies.spec.ts
index df923ef3ff..f0aabb7139 100644
--- a/tests/library/browsercontext-cookies.spec.ts
+++ b/tests/library/browsercontext-cookies.spec.ts
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+import os from 'os';
import { contextTest as it, expect } from '../config/browserTest';
it('should return no cookies in pristine browser context', async ({ context, page, server }) => {
@@ -396,7 +397,7 @@ it('should support requestStorageAccess', async ({ page, server, channel, browse
server.waitForRequest('/title.html'),
frame.evaluate(() => fetch('/title.html'))
]);
- if (isLinux && browserName === 'webkit')
+ if ((isLinux || (isMac && parseInt(os.release(), 10) >= 24)) && browserName === 'webkit')
expect(serverRequest.headers.cookie).toBe(undefined);
else
expect(serverRequest.headers.cookie).toBe('name=value');