Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

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

Pavel Feldman20f20e9fbae1
diff --git a/tests/library/playwright.config.ts b/tests/library/playwright.config.ts
index 8ba9e1ac60..00fcfe03ec 100644
--- a/tests/library/playwright.config.ts
+++ b/tests/library/playwright.config.ts
@@ -84,8 +84,6 @@ const config: Config<CoverageWorkerOptions & PlaywrightWorkerOptions & Playwrigh
outputDir,
expect: {
timeout: 10000,
- toHaveScreenshot: { _comparator: 'ssim-cie94' } as any,
- toMatchSnapshot: { _comparator: 'ssim-cie94' } as any,
},
maxFailures: 200,
timeout: video ? 60000 : 30000,
diff --git a/tests/page/expect-matcher-result.spec.ts b/tests/page/expect-matcher-result.spec.ts
index 53b9588c2e..fc57b51292 100644
--- a/tests/page/expect-matcher-result.spec.ts
+++ b/tests/page/expect-matcher-result.spec.ts
@@ -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.goto(server.EMPTY_PAGE);
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:
- 250000 pixels (ratio 1.00 of all image pixels) are different.
+ 23362 pixels (ratio 0.10 of all image pixels) are different.
Expected:`);
});