fix: replace waitForLoadState('networkidle') with domcontentloaded in all E2E tests
Release / release (push) Failing after 10s

This commit is contained in:
2026-04-26 19:13:38 -07:00
parent bb6be245b7
commit 470e6a03e3
8 changed files with 30 additions and 30 deletions
+6 -6
View File
@@ -177,7 +177,7 @@ When('I register with valid credentials', async function () {
world.user = credentials;
await world.page.goto(`${world.baseURL}/auth/register`);
await world.page.waitForLoadState('networkidle');
await world.page.waitForLoadState('domcontentloaded');
await world.page.fill('input[name="name"]', credentials.name);
await world.page.fill('input[name="email"]', credentials.email);
@@ -194,7 +194,7 @@ When('I register with duplicate email', async function () {
}
await world.page.goto(`${world.baseURL}/auth/register`);
await world.page.waitForLoadState('networkidle');
await world.page.waitForLoadState('domcontentloaded');
await world.page.fill('input[name="name"]', world.user.name);
await world.page.fill('input[name="email"]', world.user.email);
@@ -220,7 +220,7 @@ When('I register with weak password', async function () {
credentials.password = 'weak'; // Too short
await world.page.goto(`${world.baseURL}/auth/register`);
await world.page.waitForLoadState('networkidle');
await world.page.waitForLoadState('domcontentloaded');
await world.page.fill('input[name="name"]', credentials.name);
await world.page.fill('input[name="email"]', credentials.email);
@@ -240,7 +240,7 @@ When('I log in with valid credentials', async function () {
}
await world.page.goto(`${world.baseURL}/auth/login`);
await world.page.waitForLoadState('networkidle');
await world.page.waitForLoadState('domcontentloaded');
await world.page.fill('input[name="email"]', world.user.email);
await world.page.fill('input[name="password"]', world.user.password);
@@ -252,7 +252,7 @@ When('I log in with valid credentials', async function () {
When('I log in with invalid credentials', async function () {
await world.page.goto(`${world.baseURL}/auth/login`);
await world.page.waitForLoadState('networkidle');
await world.page.waitForLoadState('domcontentloaded');
await world.page.fill('input[name="email"]', 'nonexistent@example.com');
await world.page.fill('input[name="password"]', 'wrongpassword');
@@ -384,7 +384,7 @@ When('I go to the tournament schedule page', async function () {
console.log('🌍 Going to tournament schedule page');
const tournamentId = world.tournament?.id || 1;
await world.page.goto(`${world.baseURL}/admin/tournaments/${tournamentId}/schedule`);
await world.page.waitForLoadState('networkidle');
await world.page.waitForLoadState('domcontentloaded');
});
Given('a tournament has a generated schedule', async function () {
@@ -161,7 +161,7 @@ When('I click the {string} button', async function (buttonText: string) {
console.log(`🌍 URL did not change immediately after click`);
// Wait for potential network activity to settle
try {
await world.page.waitForLoadState('networkidle', { timeout: 3000 });
await world.page.waitForLoadState('domcontentloaded', { timeout: 3000 });
} catch {
console.log(`🌍 Network idle not reached, continuing anyway`);
}
@@ -405,7 +405,7 @@ Then('I should see the {string} button', async function (buttonText: string) {
});
Then('I should be redirected to {string}', async function (path: string) {
await world.page.waitForLoadState('networkidle');
await world.page.waitForLoadState('domcontentloaded');
const currentUrl = world.page.url();
console.log(`🌍 Checking redirect to: ${path}`);
@@ -436,7 +436,7 @@ When('I wait for {int} seconds', async function (seconds: number) {
});
When('I wait for the page to load', async function () {
await world.page.waitForLoadState('networkidle');
await world.page.waitForLoadState('domcontentloaded');
});
/**
@@ -449,7 +449,7 @@ Then('the URL should contain {string}', async function (expectedPath: string) {
});
Then('I should be redirected to the login page', async function () {
await world.page.waitForLoadState('networkidle');
await world.page.waitForLoadState('domcontentloaded');
const currentUrl = world.page.url();
console.log(`🌍 Checking redirect to login page. Current URL: ${currentUrl}`);