Skip to content

Commit fb76700

Browse files
authored
fix(e2e): Use consistent date for E2E tests (#573)
* fix(e2e): use consistent date for E2E tests
1 parent da57df0 commit fb76700

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

e2e/test-utils/open-page.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1+
const gameStartTime = '2025-01-01T09:00:00'
2+
13
/**
24
* @param {import('@playwright/test').Page} page
35
* @param {number=} seed
46
* @returns {Promise<import('@playwright/test').Response | null>}
57
*/
6-
export const openPage = (page, seed = 0.5) => {
8+
export const openPage = async (page, seed = 0.5) => {
79
const appUrl = process.env.APP_URL || 'http://localhost:3000'
810

11+
// NOTE: A consistent date for the game is set so that time-based events
12+
// don't interfere with the tests
13+
await page.clock.install({ time: gameStartTime })
14+
915
return page.goto(`${appUrl}?seed=${seed}`)
1016
}

0 commit comments

Comments
 (0)