From 118dc78b25e7d34a9967010022f0c10254157e3c Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Thu, 26 Feb 2026 11:21:37 -0800 Subject: [PATCH] test: gardening some tests failing on WebKit --- tests/library/browsercontext-timezone-id.spec.ts | 8 ++++---- tests/library/browsertype-connect.spec.ts | 4 +++- tests/library/popup.spec.ts | 4 +++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/tests/library/browsercontext-timezone-id.spec.ts b/tests/library/browsercontext-timezone-id.spec.ts index 9a2e596a2c051..5c4229d281c0c 100644 --- a/tests/library/browsercontext-timezone-id.spec.ts +++ b/tests/library/browsercontext-timezone-id.spec.ts @@ -24,25 +24,25 @@ it('should work @smoke', async ({ browser, browserName }) => { { const context = await browser.newContext({ locale: 'en-US', timezoneId: 'America/Jamaica' }); const page = await context.newPage(); - expect(await page.evaluate(func)).toContain('Sat Nov 19 2016 13:12:34 GMT-0500'); + expect.soft(await page.evaluate(func)).toContain('Sat Nov 19 2016 13:12:34 GMT-0500'); await context.close(); } { const context = await browser.newContext({ locale: 'en-US', timezoneId: 'Pacific/Honolulu' }); const page = await context.newPage(); - expect(await page.evaluate(func)).toContain('Sat Nov 19 2016 08:12:34 GMT-1000'); + expect.soft(await page.evaluate(func)).toContain('Sat Nov 19 2016 08:12:34 GMT-1000'); await context.close(); } { const context = await browser.newContext({ locale: 'en-US', timezoneId: browserName === 'firefox' ? 'America/Argentina/Buenos_Aires' : 'America/Buenos_Aires' }); const page = await context.newPage(); - expect(await page.evaluate(func)).toContain('Sat Nov 19 2016 15:12:34 GMT-0300'); + expect.soft(await page.evaluate(func)).toContain('Sat Nov 19 2016 15:12:34 GMT-0300'); await context.close(); } { const context = await browser.newContext({ locale: 'en-US', timezoneId: 'Europe/Berlin' }); const page = await context.newPage(); - expect(await page.evaluate(func)).toContain('Sat Nov 19 2016 19:12:34 GMT+0100'); + expect.soft(await page.evaluate(func)).toContain('Sat Nov 19 2016 19:12:34 GMT+0100'); await context.close(); } }); diff --git a/tests/library/browsertype-connect.spec.ts b/tests/library/browsertype-connect.spec.ts index 42c34120de995..a295198bd3d0c 100644 --- a/tests/library/browsertype-connect.spec.ts +++ b/tests/library/browsertype-connect.spec.ts @@ -247,7 +247,9 @@ for (const kind of ['launchServer', 'run-server'] as const) { expect(request.headers['foo']).toBe('bar'); }); - test('should send default User-Agent and X-Playwright-Browser headers with connect request', async ({ connect, browserName, server }) => { + test('should send default User-Agent and X-Playwright-Browser headers with connect request', async ({ connect, browserName, server, isMac, macVersion }) => { + test.skip(browserName === 'webkit' && isMac && macVersion <= 14, 'WebKit on macOS-14 is frozen'); + const [request] = await Promise.all([ server.waitForWebSocketConnectionRequest(), connect(`ws://localhost:${server.PORT}/ws`, { diff --git a/tests/library/popup.spec.ts b/tests/library/popup.spec.ts index f4774a7567f53..584f4505abe54 100644 --- a/tests/library/popup.spec.ts +++ b/tests/library/popup.spec.ts @@ -17,7 +17,9 @@ import { browserTest as it, expect } from '../config/browserTest'; import type { Page } from 'playwright-core'; -it('should inherit user agent from browser context @smoke', async function({ browser, server }) { +it('should inherit user agent from browser context @smoke', async function({ browser, server, browserName, isMac, macVersion }) { + it.skip(browserName === 'webkit' && isMac && macVersion <= 14, 'WebKit on macOS-14 is frozen'); + const context = await browser.newContext({ userAgent: 'hey' });