Skip to content

Commit d4ce7b0

Browse files
[WIP] Update timeouts and add validation for dashboard loading (#14)
* Initial plan * Fix Playwright timeout issues with 60s timeouts and load validation Co-authored-by: bg-playground <259109604+bg-playground@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: bg-playground <259109604+bg-playground@users.noreply.github.com>
1 parent dd08436 commit d4ce7b0

3 files changed

Lines changed: 13 additions & 5 deletions

File tree

automated-testing/pages/AdminPage.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export class AdminPage {
2828
}
2929

3030
async getRecordsCount() {
31+
await this.recordsFound.waitFor({ state: 'visible', timeout: 60000 });
3132
return await this.recordsFound.textContent() || '';
3233
}
3334

automated-testing/pages/DashboardPage.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,27 +24,32 @@ export class DashboardPage {
2424
}
2525

2626
async navigateToAdmin() {
27-
await this.adminMenu.waitFor({ state: 'visible' });
27+
await this.dashboardTitle.waitFor({ state: 'visible', timeout: 60000 });
28+
await this.adminMenu.waitFor({ state: 'visible', timeout: 60000 });
2829
await this.adminMenu.click();
2930
}
3031

3132
async navigateToPIM() {
32-
await this.pimMenu.waitFor({ state: 'visible' });
33+
await this.dashboardTitle.waitFor({ state: 'visible', timeout: 60000 });
34+
await this.pimMenu.waitFor({ state: 'visible', timeout: 60000 });
3335
await this.pimMenu.click();
3436
}
3537

3638
async navigateToLeave() {
37-
await this.leaveMenu.waitFor({ state: 'visible' });
39+
await this.dashboardTitle.waitFor({ state: 'visible', timeout: 60000 });
40+
await this.leaveMenu.waitFor({ state: 'visible', timeout: 60000 });
3841
await this.leaveMenu.click();
3942
}
4043

4144
async navigateToTime() {
42-
await this.timeMenu.waitFor({ state: 'visible' });
45+
await this.dashboardTitle.waitFor({ state: 'visible', timeout: 60000 });
46+
await this.timeMenu.waitFor({ state: 'visible', timeout: 60000 });
4347
await this.timeMenu.click();
4448
}
4549

4650
async navigateToRecruitment() {
47-
await this.recruitmentMenu.waitFor({ state: 'visible' });
51+
await this.dashboardTitle.waitFor({ state: 'visible', timeout: 60000 });
52+
await this.recruitmentMenu.waitFor({ state: 'visible', timeout: 60000 });
4853
await this.recruitmentMenu.click();
4954
}
5055

automated-testing/pages/LoginPage.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ export class LoginPage {
1717
await this.usernameInput.fill(username);
1818
await this.passwordInput.fill(password);
1919
await this.loginButton.click();
20+
// Wait for navigation to complete after login
21+
await this.page.waitForLoadState('networkidle', { timeout: 60000 });
2022
}
2123

2224
async getErrorMessage() {

0 commit comments

Comments
 (0)