Skip to content

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

test: fix webkit win expectation for sameSite attribute (#8559)

Yury Semikhatsky4c1b47a00c22
diff --git a/tests/browsercontext-fetch.spec.ts b/tests/browsercontext-fetch.spec.ts
index 55fe552a51..d0d67a6ace 100644
--- a/tests/browsercontext-fetch.spec.ts
+++ b/tests/browsercontext-fetch.spec.ts
@@ -136,7 +136,7 @@ it('should add cookies from Set-Cookie header', async ({context, page, server})
expect((await page.evaluate(() => document.cookie)).split(';').map(s => s.trim()).sort()).toEqual(['foo=bar', 'session=value']);
});
-it('should handle cookies on redirects', async ({context, server}) => {
+it('should handle cookies on redirects', async ({context, server, browserName, isWindows}) => {
server.setRoute('/redirect1', (req, res) => {
res.setHeader('Set-Cookie', 'r1=v1;SameSite=Lax');
res.writeHead(301, { location: '/a/b/redirect2' });
@@ -174,7 +174,7 @@ it('should handle cookies on redirects', async ({context, server}) => {
const cookies = await context.cookies();
expect(new Set(cookies)).toEqual(new Set([
{
- 'sameSite': 'Lax',
+ 'sameSite': (browserName === 'webkit' && isWindows) ? 'None' : 'Lax',
'name': 'r2',
'value': 'v2',
'domain': 'localhost',
@@ -184,7 +184,7 @@ it('should handle cookies on redirects', async ({context, server}) => {
'secure': false
},
{
- 'sameSite': 'Lax',
+ 'sameSite': (browserName === 'webkit' && isWindows) ? 'None' : 'Lax',
'name': 'r1',
'value': 'v1',
'domain': 'localhost',