From 137f192d5537322ff2e97bec050abb032437c73b Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Tue, 24 Sep 2024 12:27:36 +0200 Subject: [PATCH] test: add different expectation for macOS/headed 'should work for canvas' (#32774) --- tests/page/page-screenshot.spec.ts | 7 +++++-- ...hot-canvas-with-accurate-corners-chromium.png | Bin 0 -> 1939 bytes 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 tests/page/page-screenshot.spec.ts-snapshots/screenshot-canvas-with-accurate-corners-chromium.png diff --git a/tests/page/page-screenshot.spec.ts b/tests/page/page-screenshot.spec.ts index 15c8e4db39..27cc28c141 100644 --- a/tests/page/page-screenshot.spec.ts +++ b/tests/page/page-screenshot.spec.ts @@ -280,12 +280,15 @@ it.describe('page screenshot', () => { expect(screenshot).toMatchSnapshot('screenshot-clip-odd-size.png'); }); - it('should work for canvas', async ({ page, server, isElectron, isMac }) => { + it('should work for canvas', async ({ page, server, isElectron, isMac, browserName, headless }) => { it.fixme(isElectron && isMac, 'Fails on the bots'); await page.setViewportSize({ width: 500, height: 500 }); await page.goto(server.PREFIX + '/screenshots/canvas.html'); const screenshot = await page.screenshot(); - expect(screenshot).toMatchSnapshot('screenshot-canvas.png'); + if (!headless && browserName === 'chromium' && isMac && os.arch() === 'arm64' && /* macOS 14+ */ parseInt(os.release(), 10) >= 23) + expect(screenshot).toMatchSnapshot('screenshot-canvas-with-accurate-corners.png'); + else + expect(screenshot).toMatchSnapshot('screenshot-canvas.png'); }); it('should capture canvas changes', async ({ page, isElectron, browserName, isMac, isWebView2 }) => { diff --git a/tests/page/page-screenshot.spec.ts-snapshots/screenshot-canvas-with-accurate-corners-chromium.png b/tests/page/page-screenshot.spec.ts-snapshots/screenshot-canvas-with-accurate-corners-chromium.png new file mode 100644 index 0000000000000000000000000000000000000000..830872e8d2e6ac8f68cc70a8d99bb838b2270fbc GIT binary patch literal 1939 zcmeAS@N?(olHy`uVBq!ia0y~yVEh8Y985qFmn|N5ffQqLkh>GZx^prw85r1oJzX3_ zD(1YsYnXS~K!D+(!H2_Nis>UG%Ppb=u~gaDTl0 zclPh@#};Az9~RF|XU;qEj8EW;-|XL)^Q=GReP+0EhjG>sSp|&OxTRU8sQT*?>Wb&V%H@S~l-@SWJ{KkZ{a4%$h-=7-yvyQhQ+KjUB1V+aKLtx}E zGpHklCS4K--BRJGMfA(@qhUQ7)^x03sG8g^h+imH$hkdliaxNGW$<+Mb6Mw<&;$TH CDVNRw literal 0 HcmV?d00001