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
This commit is contained in:
Yury Semikhatsky 2023-09-08 12:57:32 -07:00 committed by GitHub
parent 8ba8c9385d
commit 0213fef484
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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();
});
});