Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
chore: remove macOS <=12 checks (#33591)
Yury Semikhatskya8af7cc43549
diff --git a/packages/playwright-core/src/server/webkit/wkPage.ts b/packages/playwright-core/src/server/webkit/wkPage.tsindex 0bd82ed338..13096075f7 100644--- a/packages/playwright-core/src/server/webkit/wkPage.ts+++ b/packages/playwright-core/src/server/webkit/wkPage.ts@@ -16,7 +16,6 @@*/import path from 'path';-import os from 'os';import { PNG, jpegjs } from '../../utilsBundle';import { splitErrorMessage } from '../../utils/stackTrace';import { assert, createGuid, debugAssert, headersArrayToObject } from '../../utils';@@ -715,12 +714,7 @@ export class WKPage implements PageDelegate {];if (options.isMobile) {const angle = viewportSize.width > viewportSize.height ? 90 : 0;- // Special handling for macOS 12.- const useLegacySetOrientationOverrideMethod = os.platform() === 'darwin' && parseInt(os.release().split('.')[0], 10) <= 21;- if (useLegacySetOrientationOverrideMethod)- promises.push(this._session.send('Page.setOrientationOverride' as any, { angle }));- else- promises.push(this._pageProxySession.send('Emulation.setOrientationOverride', { angle }));+ promises.push(this._pageProxySession.send('Emulation.setOrientationOverride', { angle }));}await Promise.all(promises);}diff --git a/tests/library/browsercontext-viewport.spec.ts b/tests/library/browsercontext-viewport.spec.tsindex 356e330079..09fade8d91 100644--- a/tests/library/browsercontext-viewport.spec.ts+++ b/tests/library/browsercontext-viewport.spec.ts@@ -177,10 +177,9 @@ browserTest('should be able to get correct orientation angle on non-mobile devicawait context.close();});-it('should set window.screen.orientation.type for mobile devices', async ({ contextFactory, browserName, server, isMac, macVersion }) => {+it('should set window.screen.orientation.type for mobile devices', async ({ contextFactory, browserName, server }) => {it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/31151' });it.skip(browserName === 'firefox', 'Firefox does not support mobile emulation');- it.skip(browserName === 'webkit' && isMac && macVersion <= 12, 'WebKit on macOS 12 is frozen and does not support orientation.type override');const context = await contextFactory(devices['iPhone 14']);const page = await context.newPage();await page.goto(server.PREFIX + '/index.html');diff --git a/tests/library/browsertype-connect.spec.ts b/tests/library/browsertype-connect.spec.tsindex 77efb65e9b..367c0eabfc 100644--- a/tests/library/browsertype-connect.spec.ts+++ b/tests/library/browsertype-connect.spec.ts@@ -680,9 +680,8 @@ for (const kind of ['launchServer', 'run-server'] as const) {expect(await response.json()).toEqual({ 'foo': 'bar' });});- test('should upload large file', async ({ connect, startRemoteServer, server, browserName, isMac, macVersion, mode }, testInfo) => {+ test('should upload large file', async ({ connect, startRemoteServer, server, mode }, testInfo) => {test.skip(mode.startsWith('service'), 'Take it easy on service');- test.skip(browserName === 'webkit' && isMac && macVersion < 11, 'WebKit for macOS 10.15 is frozen and does not have corresponding protocol features.');test.slow();const remoteServer = await startRemoteServer(kind);const browser = await connect(remoteServer.wsEndpoint());diff --git a/tests/library/capabilities.spec.ts b/tests/library/capabilities.spec.tsindex 72eb73724c..76b25f0518 100644--- a/tests/library/capabilities.spec.ts+++ b/tests/library/capabilities.spec.ts@@ -19,8 +19,7 @@ import url from 'url';import { contextTest as it, expect } from '../config/browserTest';import { hostPlatform } from '../../packages/playwright-core/src/utils/hostPlatform';-it('SharedArrayBuffer should work @smoke', async function({ contextFactory, httpsServer, isMac, macVersion, browserName }) {- it.skip(browserName === 'webkit' && isMac && macVersion <= 12, 'WebKit on macOS 12 is frozen and does not support SharedArrayBuffer');+it('SharedArrayBuffer should work @smoke', async function({ contextFactory, httpsServer }) {const context = await contextFactory({ ignoreHTTPSErrors: true });const page = await context.newPage();httpsServer.setRoute('/sharedarraybuffer', (req, res) => {@@ -234,9 +233,8 @@ it('make sure that XMLHttpRequest upload events are emitted correctly', async ({expect(events).toEqual(['loadstart', 'progress', 'load', 'loadend']);});-it('loading in HTMLImageElement.prototype', async ({ page, server, browserName, isMac, macVersion }) => {+it('loading in HTMLImageElement.prototype', async ({ page, server }) => {it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/22738' });- it.skip(browserName === 'webkit' && isMac && macVersion < 12, 'macOS 11 is frozen');await page.goto(server.EMPTY_PAGE);const defined = await page.evaluate(() => 'loading' in HTMLImageElement.prototype);expect(defined).toBeTruthy();@@ -251,7 +249,7 @@ it('window.GestureEvent in WebKit', async ({ page, server, browserName }) => {expect(type).toBe(browserName === 'webkit' ? 'function' : 'undefined');});-it('requestFullscreen', async ({ page, server, browserName, headless, isLinux }) => {+it('requestFullscreen', async ({ page, server }) => {it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/22832' });await page.goto(server.EMPTY_PAGE);await page.evaluate(() => {@@ -268,7 +266,7 @@ it('requestFullscreen', async ({ page, server, browserName, headless, isLinux })expect(await page.evaluate(() => !!document.fullscreenElement)).toBeFalsy();});-it('should send no Content-Length header for GET requests with a Content-Type', async ({ page, server, browserName }) => {+it('should send no Content-Length header for GET requests with a Content-Type', async ({ page, server }) => {it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/22569' });await page.goto(server.EMPTY_PAGE);const [request] = await Promise.all([diff --git a/tests/page/locator-misc-2.spec.ts b/tests/page/locator-misc-2.spec.tsindex 4eaf5972a0..b32913faba 100644--- a/tests/page/locator-misc-2.spec.ts+++ b/tests/page/locator-misc-2.spec.ts@@ -42,9 +42,8 @@ it('should scroll into view', async ({ page, server, isAndroid }) => {}});-it('should scroll zero-sized element into view', async ({ page, isAndroid, isElectron, browserName, isMac, macVersion }) => {+it('should scroll zero-sized element into view', async ({ page, isAndroid, isElectron }) => {it.fixme(isAndroid || isElectron);- it.skip(browserName === 'webkit' && isMac && macVersion < 11, 'WebKit for macOS 10.15 is frozen.');await page.setContent(`<style>diff --git a/tests/page/page-accessibility.spec.ts b/tests/page/page-accessibility.spec.tsindex c6619b7f9c..701fecfeaf 100644--- a/tests/page/page-accessibility.spec.ts+++ b/tests/page/page-accessibility.spec.ts@@ -18,7 +18,7 @@import { test as it, expect } from './pageTest';import { chromiumVersionLessThan } from '../config/utils';-it('should work @smoke', async ({ page, browserName, macVersion }) => {+it('should work @smoke', async ({ page, browserName, isMac }) => {await page.setContent(`<head><title>Accessibility Test</title>@@ -74,9 +74,7 @@ it('should work @smoke', async ({ page, browserName, macVersion }) => {{ role: 'textbox', name: 'Input with whitespace', value: ' ' },{ role: 'textbox', name: '', value: 'value only' },{ role: 'textbox', name: 'placeholder', value: 'and a value' },- // due to frozen WebKit on macOS 11 we have the if/else here- // old webkit uses the description over placeholder for the name- { role: 'textbox', name: macVersion >= 12 ? 'placeholder' : 'This is a description!', value: 'and a value' },+ { role: 'textbox', name: isMac ? 'placeholder' : 'This is a description!', value: 'and a value' },]};expect(await page.accessibility.snapshot()).toEqual(golden);diff --git a/tests/page/page-set-input-files.spec.ts b/tests/page/page-set-input-files.spec.tsindex 59378dcaa3..eaf1316f5c 100644--- a/tests/page/page-set-input-files.spec.ts+++ b/tests/page/page-set-input-files.spec.ts@@ -144,8 +144,7 @@ it('should upload a file after popup', async ({ page, server, asset }) => {expect(await page.evaluate(e => e.files[0].name, input)).toBe('file-to-upload.txt');});-it('should upload large file', async ({ page, server, browserName, isMac, isAndroid, isWebView2, mode, macVersion }, testInfo) => {- it.skip(browserName === 'webkit' && isMac && macVersion < 11, 'WebKit for macOS 10.15 is frozen and does not have corresponding protocol features.');+it('should upload large file', async ({ page, server, isAndroid, isWebView2, mode }, testInfo) => {it.skip(isAndroid);it.skip(isWebView2);it.skip(mode.startsWith('service'));@@ -203,8 +202,7 @@ it('should throw an error if the file does not exist', async ({ page, server, asexpect(error.message).toContain('i actually do not exist.txt');});-it('should upload multiple large files', async ({ page, server, browserName, isMac, isAndroid, isWebView2, mode, macVersion }, testInfo) => {- it.skip(browserName === 'webkit' && isMac && macVersion < 11, 'WebKit for macOS 10.15 is frozen and does not have corresponding protocol features.');+it('should upload multiple large files', async ({ page, server, isAndroid, isWebView2, mode }, testInfo) => {it.skip(isAndroid);it.skip(isWebView2);it.skip(mode.startsWith('service'));@@ -244,8 +242,7 @@ it('should upload multiple large files', async ({ page, server, browserName, isMawait Promise.all(uploadFiles.map(path => fs.promises.unlink(path)));});-it('should upload large file with relative path', async ({ page, server, browserName, isMac, isAndroid, isWebView2, mode, macVersion }, testInfo) => {- it.skip(browserName === 'webkit' && isMac && macVersion < 11, 'WebKit for macOS 10.15 is frozen and does not have corresponding protocol features.');+it('should upload large file with relative path', async ({ page, server, isAndroid, isWebView2, mode }, testInfo) => {it.skip(isAndroid);it.skip(isWebView2);it.skip(mode.startsWith('service'));