Skip to content

Commit cadd015

Browse files
committed
test: Fix flaky time drift tests
1 parent 07604c3 commit cadd015

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

playwright.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export default defineConfig({
1919
},
2020
expect: {
2121
toHaveScreenshot: {
22+
maxDiffPixelRatio: 0.02,
2223
pathTemplate: "{testDir}/screenshots{/projectName}/{testFilePath}/{testName}{ext}",
2324
},
2425
},

tests/TimersPage.spec.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { expect, test } from "./fixtures/extension";
33
test.beforeEach(async ({ page, issuesPage }) => {
44
await issuesPage.waitForIssuesToLoad();
55

6+
await page.clock.setSystemTime(new Date(process.env.TESTING_FREEZE_TIME!));
7+
68
// Start some timers
79
await issuesPage.triggerTimerAction(0, "start");
810
await page.clock.fastForward("01:33:07");

0 commit comments

Comments
 (0)