From 2db13efa8ea3703059c051511d981b199963aed1 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Tue, 24 Sep 2024 00:53:59 +0200 Subject: [PATCH] test: relax 'should work for canvas' expecation --- tests/page/page-screenshot.spec.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/page/page-screenshot.spec.ts b/tests/page/page-screenshot.spec.ts index 8d0e68e12d..5e8080d8e7 100644 --- a/tests/page/page-screenshot.spec.ts +++ b/tests/page/page-screenshot.spec.ts @@ -280,12 +280,16 @@ 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 }) => { 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'); + // rendering on macOS-14-arm14+ is different compared to Intel macs. + let maxDiffPixels = 0; + if (browserName === 'chromium' && isMac && os.arch() === 'arm64' && parseInt(os.release(), 10) >= 23) + maxDiffPixels = 4; + expect(screenshot).toMatchSnapshot('screenshot-canvas.png', { maxDiffPixels }); }); it('should capture canvas changes', async ({ page, isElectron, browserName, isMac, isWebView2 }) => {