chore: use stock image matcher in library tests (#27319)
This commit is contained in:
parent
2032b64ee6
commit
20f20e9fba
|
|
@ -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,
|
||||||
|
|
|
||||||
|
|
@ -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:`);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue