Skip to content

Commit 9e7816c

Browse files
authored
Merge pull request #271 from rgis-app/remove-max-diff-pixel-ratio
Remove maxDiffPixelRatio tolerance from screenshot tests
2 parents fe0bded + 20df811 commit 9e7816c

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

www/playwright.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ export default defineConfig({
1414

1515
expect: {
1616
toHaveScreenshot: {
17-
maxDiffPixelRatio: 0.03,
17+
// Hardware GPU rendering is inherently non-deterministic between runs
18+
maxDiffPixelRatio: 0.05,
1819
threshold: 0.2,
1920
},
2021
},

www/tests/fixtures/app-fixture.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ export class AppPage {
8686
await this.waitForNextFrame();
8787
}
8888

89-
async expectScreenshot(name: string, options?: { maxDiffPixelRatio?: number }) {
89+
async expectScreenshot(name: string) {
9090
await this.stabilizeForScreenshot();
91-
await expect(this.page).toHaveScreenshot(name, options);
91+
await expect(this.page).toHaveScreenshot(name);
9292
}
9393

9494
async clickOnCanvas(xFrac: number, yFrac: number) {

www/tests/raster-layer.spec.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,6 @@ for (const filePath of geotiffFiles) {
6161

6262
await appPage.loadGeoTIFFFile(`./dist/geotiff-test-data/${filePath}`);
6363

64-
// Remote raster data can have minor non-deterministic rendering differences
65-
const options = filePath.startsWith("real_data/")
66-
? { maxDiffPixelRatio: 0.05 }
67-
: undefined;
68-
await appPage.expectScreenshot(snapshotName(filePath), options);
64+
await appPage.expectScreenshot(snapshotName(filePath));
6965
});
7066
}

0 commit comments

Comments
 (0)