From 0213fef48490e1b8519ee36f75aafd6139547ab9 Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Fri, 8 Sep 2023 12:57:32 -0700 Subject: [PATCH] test: unskip passing test (#26960) The functionality was fixed in [webkit](https://github.com/microsoft/playwright-browsers/pull/625) and should be available with [recent roll](https://github.com/microsoft/playwright/pull/26953). Fixes #26876 --- .../browsercontext-viewport-mobile.spec.ts | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/tests/library/browsercontext-viewport-mobile.spec.ts b/tests/library/browsercontext-viewport-mobile.spec.ts index 642eeaebdf..96725bbfbb 100644 --- a/tests/library/browsercontext-viewport-mobile.spec.ts +++ b/tests/library/browsercontext-viewport-mobile.spec.ts @@ -16,6 +16,7 @@ */ import { browserTest as it, expect } from '../config/browserTest'; +import os from 'os'; it.describe('mobile viewport', () => { it.skip(({ browserName }) => browserName === 'firefox'); @@ -190,9 +191,8 @@ it.describe('mobile viewport', () => { await context.close(); }); - it('view scale should reset after navigation', async ({ browser, browserName }) => { + it('view scale should reset after navigation', async ({ browser, browserName, isLinux, isWindows, isMac, headless }) => { it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/26876' }); - it.fixme(browserName === 'webkit'); const context = await browser.newContext({ viewport: { width: 390, height: 664 }, isMobile: true, @@ -225,8 +225,23 @@ it.describe('mobile viewport', () => { }); await page.goto('http://localhost/button.html'); await page.getByText('Click me').click({ force: true }); - expect(await page.evaluate(() => (window as any).clicks)).toEqual( - browserName === 'chromium' ? [{ x: 41, y: 18 }] : [{ x: 37, y: 15 }]); + let expected = [{ x: 41, y: 18 }]; + if (browserName === 'webkit') { + if (isLinux) { + if (headless) + expected = [{ x: 50, y: 20 }]; + else + expected = [{ x: 45, y: 20 }]; + } else if (isWindows) { + expected = [{ x: 40, y: 20 }]; + } else if (isMac) { + if (parseInt(os.release(), 10) === 21) + expected = [{ x: 40, y: 17 }]; + else + expected = [{ x: 37, y: 15 }]; + } + } + expect(await page.evaluate(() => (window as any).clicks)).toEqual(expected); await context.close(); }); });