test: add different expectation for macOS/headed 'should work for canvas' (#32774)

This commit is contained in:
Max Schmitt 2024-09-24 12:27:36 +02:00 committed by GitHub
parent b01dd55697
commit 137f192d55
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View file

@ -280,12 +280,15 @@ it.describe('page screenshot', () => {
expect(screenshot).toMatchSnapshot('screenshot-clip-odd-size.png'); 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'); it.fixme(isElectron && isMac, 'Fails on the bots');
await page.setViewportSize({ width: 500, height: 500 }); await page.setViewportSize({ width: 500, height: 500 });
await page.goto(server.PREFIX + '/screenshots/canvas.html'); await page.goto(server.PREFIX + '/screenshots/canvas.html');
const screenshot = await page.screenshot(); 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 }) => { it('should capture canvas changes', async ({ page, isElectron, browserName, isMac, isWebView2 }) => {

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB