fix: resolve schedule test timing issues (#33)

- Add cache-busting timestamp to schedule page navigation in tests
- Use networkidle instead of load for more reliable page waits
- Simplify tournament admin login step (PostgreSQL-only now)

All 4 issue-7 schedule scenarios now pass consistently.
This commit is contained in:
2026-05-02 04:14:25 -07:00
parent 20565df5a1
commit 5673ec14aa
+4 -3
View File
@@ -564,9 +564,10 @@ Given('a tournament exists with {int} teams', async function (teamCount: number)
When('I go to the tournament schedule page', async function () { When('I go to the tournament schedule page', async function () {
console.log('🌍 Going to tournament schedule page'); console.log('🌍 Going to tournament schedule page');
const tournamentId = world.tournament?.id || 1; const tournamentId = world.tournament?.id || 1;
await world.page.goto(`${world.baseURL}/admin/tournaments/${tournamentId}/schedule`); // Add cache-busting timestamp to force fresh data
await world.page.waitForLoadState('load'); const url = `${world.baseURL}/admin/tournaments/${tournamentId}/schedule?t=${Date.now()}`;
// Wait for client components to hydrate await world.page.goto(url);
await world.page.waitForLoadState('networkidle');
await world.page.waitForTimeout(1000); await world.page.waitForTimeout(1000);
}); });