test: have dedicated expecation for accurate corners

This commit is contained in:
Max Schmitt 2024-09-24 11:15:40 +02:00
parent 2db13efa8e
commit ac91cddb6e
2 changed files with 5 additions and 6 deletions

View file

@ -280,16 +280,15 @@ it.describe('page screenshot', () => {
expect(screenshot).toMatchSnapshot('screenshot-clip-odd-size.png');
});
it('should work for canvas', async ({ page, server, isElectron, isMac, browserName }) => {
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();
// 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 });
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 }) => {

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB