Skip to content
Merged
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
8 changes: 7 additions & 1 deletion e2e/test-utils/open-page.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
const gameStartTime = '2025-01-01T09:00:00'

/**
* @param {import('@playwright/test').Page} page
* @param {number=} seed
* @returns {Promise<import('@playwright/test').Response | null>}
*/
export const openPage = (page, seed = 0.5) => {
export const openPage = async (page, seed = 0.5) => {
const appUrl = process.env.APP_URL || 'http://localhost:3000'

// NOTE: A consistent date for the game is set so that time-based events
// don't interfere with the tests
await page.clock.install({ time: gameStartTime })

return page.goto(`${appUrl}?seed=${seed}`)
}
Loading