From 8ab0660d1b3380e9963e2cd85a8a7cfa6fc48f29 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Wed, 6 Dec 2023 13:52:49 -0800 Subject: [PATCH] test: skip webgl tests on macOS-arm64 (#28522) Fixes https://github.com/microsoft/playwright/issues/28216. Drive-by: adjust signals expectation. --------- Signed-off-by: Max Schmitt --- tests/library/capabilities.spec.ts | 6 ++++-- tests/library/signals.spec.ts | 4 ++-- tests/page/page-screenshot.spec.ts | 4 +++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/library/capabilities.spec.ts b/tests/library/capabilities.spec.ts index bc7415fa48..c5112f3246 100644 --- a/tests/library/capabilities.spec.ts +++ b/tests/library/capabilities.spec.ts @@ -108,7 +108,8 @@ it('should play audio @smoke', async ({ page, server, browserName, platform }) = expect(await page.$eval('audio', e => e.currentTime)).toBeGreaterThan(0.2); }); -it('should support webgl @smoke', async ({ page, browserName, headless, browserMajorVersion, channel }) => { +it('should support webgl @smoke', async ({ page, browserName, platform }) => { + it.fixme(browserName === 'chromium' && platform === 'darwin' && os.arch() === 'arm64', 'SwiftShader is not available on macOS-arm64 - https://github.com/microsoft/playwright/issues/28216'); const hasWebGL = await page.evaluate(() => { const canvas = document.createElement('canvas'); return !!canvas.getContext('webgl'); @@ -116,10 +117,11 @@ it('should support webgl @smoke', async ({ page, browserName, headless, browserM expect(hasWebGL).toBe(true); }); -it('should support webgl 2 @smoke', async ({ page, browserName, headless, isWindows, channel, browserMajorVersion }) => { +it('should support webgl 2 @smoke', async ({ page, browserName, headless, isWindows, platform }) => { it.skip(browserName === 'webkit', 'WebKit doesn\'t have webgl2 enabled yet upstream.'); it.fixme(browserName === 'firefox' && isWindows); it.fixme(browserName === 'chromium' && !headless, 'chromium doesn\'t like webgl2 when running under xvfb'); + it.fixme(browserName === 'chromium' && platform === 'darwin' && os.arch() === 'arm64', 'SwiftShader is not available on macOS-arm64 - https://github.com/microsoft/playwright/issues/28216'); const hasWebGL2 = await page.evaluate(() => { const canvas = document.createElement('canvas'); diff --git a/tests/library/signals.spec.ts b/tests/library/signals.spec.ts index 5f0777e229..c41df7b1e7 100644 --- a/tests/library/signals.spec.ts +++ b/tests/library/signals.spec.ts @@ -63,8 +63,8 @@ test.describe('signals', () => { const remoteServer = await startRemoteServer('launchServer', { url: server.EMPTY_PAGE }); const pid = await remoteServer.out('pid'); process.kill(-pid, 'SIGKILL'); - if (isMac && browserName === 'webkit' && parseInt(os.release(), 10) === 22 && os.arch() === 'arm64') { - // WebKit on mac13 exits differently. + if (isMac && browserName === 'webkit' && parseInt(os.release(), 10) >= 22 && os.arch() === 'arm64') { + // WebKit on newer macOS exits differently. expect(await remoteServer.out('exitCode')).toBe('137'); expect(await remoteServer.out('signal')).toBe('null'); } else { diff --git a/tests/page/page-screenshot.spec.ts b/tests/page/page-screenshot.spec.ts index 8b105403c2..aaf051332e 100644 --- a/tests/page/page-screenshot.spec.ts +++ b/tests/page/page-screenshot.spec.ts @@ -15,6 +15,7 @@ * limitations under the License. */ +import os from 'os'; import { test as it, expect } from './pageTest'; import { verifyViewport, attachFrame } from '../config/utils'; import type { Route } from 'playwright-core'; @@ -308,8 +309,9 @@ it.describe('page screenshot', () => { } }); - it('should work for webgl', async ({ page, server, browserName, channel, browserMajorVersion }) => { + it('should work for webgl', async ({ page, server, browserName, platform }) => { it.fixme(browserName === 'firefox'); + it.fixme(browserName === 'chromium' && platform === 'darwin' && os.arch() === 'arm64', 'SwiftShader is not available on macOS-arm64 - https://github.com/microsoft/playwright/issues/28216'); await page.setViewportSize({ width: 640, height: 480 }); await page.goto(server.PREFIX + '/screenshots/webgl.html');