chore: use stock image matcher in library tests (#27319)

This commit is contained in:
Pavel Feldman 2023-09-26 18:46:21 -07:00 committed by GitHub
parent 2032b64ee6
commit 20f20e9fba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View file

@ -84,8 +84,6 @@ const config: Config<CoverageWorkerOptions & PlaywrightWorkerOptions & Playwrigh
outputDir, outputDir,
expect: { expect: {
timeout: 10000, timeout: 10000,
toHaveScreenshot: { _comparator: 'ssim-cie94' } as any,
toMatchSnapshot: { _comparator: 'ssim-cie94' } as any,
}, },
maxFailures: 200, maxFailures: 200,
timeout: video ? 60000 : 30000, timeout: video ? 60000 : 30000,

View file

@ -256,7 +256,8 @@ Call log`);
} }
}); });
test('toHaveScreenshot should populate matcherResult', async ({ page, server }) => { test('toHaveScreenshot should populate matcherResult', async ({ page, server, isAndroid }) => {
test.skip(isAndroid);
await page.setViewportSize({ width: 500, height: 500 }); await page.setViewportSize({ width: 500, height: 500 });
await page.goto(server.EMPTY_PAGE); await page.goto(server.EMPTY_PAGE);
const e = await expect(page).toHaveScreenshot('screenshot-sanity.png').catch(e => e); const e = await expect(page).toHaveScreenshot('screenshot-sanity.png').catch(e => e);
@ -274,7 +275,7 @@ test('toHaveScreenshot should populate matcherResult', async ({ page, server })
expect.soft(stripAnsi(e.toString())).toContain(`Error: Screenshot comparison failed: expect.soft(stripAnsi(e.toString())).toContain(`Error: Screenshot comparison failed:
250000 pixels (ratio 1.00 of all image pixels) are different. 23362 pixels (ratio 0.10 of all image pixels) are different.
Expected:`); Expected:`);
}); });