From 4d6092fc8fffe9ef5d29094d073ff42b5f3a9043 Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Wed, 26 Apr 2023 12:59:21 -0700 Subject: [PATCH] test: check os version only on mac (#22658) --- tests/library/browsercontext-pages.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/library/browsercontext-pages.spec.ts b/tests/library/browsercontext-pages.spec.ts index b7011885f1..9f0081f29a 100644 --- a/tests/library/browsercontext-pages.spec.ts +++ b/tests/library/browsercontext-pages.spec.ts @@ -80,7 +80,7 @@ it('should click the button with deviceScaleFactor set', async ({ browser, serve await context.close(); }); -it('should click the button with offset with page scale', async ({ browser, server, headless, browserName, browserVersion }) => { +it('should click the button with offset with page scale', async ({ browser, server, headless, browserName, browserVersion, isMac }) => { it.skip(browserName === 'firefox'); const context = await browser.newContext({ viewport: { width: 400, height: 400 }, isMobile: true }); @@ -96,7 +96,7 @@ it('should click the button with offset with page scale', async ({ browser, serv let expected = { x: 28, y: 18 }; // 20;10 + 8px of border in each direction if (browserName === 'webkit') { // WebKit for macOS 12 has different expectations starting r1829. - if (parseInt(os.release(), 10) < 21) { + if (isMac && parseInt(os.release(), 10) < 21) { // WebKit rounds down during css -> dip -> css conversion. expected = { x: 26, y: 17 }; } else {