diff --git a/www/playwright.config.ts b/www/playwright.config.ts index 81a38ecf..414f80c4 100644 --- a/www/playwright.config.ts +++ b/www/playwright.config.ts @@ -14,7 +14,8 @@ export default defineConfig({ expect: { toHaveScreenshot: { - maxDiffPixelRatio: 0.03, + // Hardware GPU rendering is inherently non-deterministic between runs + maxDiffPixelRatio: 0.05, threshold: 0.2, }, }, diff --git a/www/tests/fixtures/app-fixture.ts b/www/tests/fixtures/app-fixture.ts index 1b61591d..4f321ba0 100644 --- a/www/tests/fixtures/app-fixture.ts +++ b/www/tests/fixtures/app-fixture.ts @@ -86,9 +86,9 @@ export class AppPage { await this.waitForNextFrame(); } - async expectScreenshot(name: string, options?: { maxDiffPixelRatio?: number }) { + async expectScreenshot(name: string) { await this.stabilizeForScreenshot(); - await expect(this.page).toHaveScreenshot(name, options); + await expect(this.page).toHaveScreenshot(name); } async clickOnCanvas(xFrac: number, yFrac: number) { diff --git a/www/tests/raster-layer.spec.ts b/www/tests/raster-layer.spec.ts index 38201fa6..3ab52bfe 100644 --- a/www/tests/raster-layer.spec.ts +++ b/www/tests/raster-layer.spec.ts @@ -61,10 +61,6 @@ for (const filePath of geotiffFiles) { await appPage.loadGeoTIFFFile(`./dist/geotiff-test-data/${filePath}`); - // Remote raster data can have minor non-deterministic rendering differences - const options = filePath.startsWith("real_data/") - ? { maxDiffPixelRatio: 0.05 } - : undefined; - await appPage.expectScreenshot(snapshotName(filePath), options); + await appPage.expectScreenshot(snapshotName(filePath)); }); }