Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion www/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
},
Expand Down
4 changes: 2 additions & 2 deletions www/tests/fixtures/app-fixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 1 addition & 5 deletions www/tests/raster-layer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
});
}