Skip to content

Commit 5fcd14c

Browse files
committed
Improve DashboardPage navigation with better element waiting strategy
1 parent 2130cec commit 5fcd14c

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

automated-testing/pages/DashboardPage.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export class DashboardPage {
3434
// Click to open mobile menu
3535
await this.mobileMenuToggle.click();
3636
// Wait for the main navigation menu to become visible after opening
37-
await this.mainMenu.waitFor({ state: 'visible', timeout: 5000 });
37+
await this.mainMenu.waitFor({ state: 'visible', timeout: 10000 });
3838
}
3939
} catch (error) {
4040
// Mobile menu toggle not found or timeout - likely already visible or desktop view
@@ -56,10 +56,8 @@ export class DashboardPage {
5656
await this.dashboardTitle.waitFor({ state: 'visible', timeout: 60000 });
5757
await this.ensureMenuVisible();
5858

59-
// Increase delay for mobile menu animations (especially Safari)
60-
await this.page.waitForTimeout(2000);
61-
62-
await this.pimMenu.waitFor({ state: 'attached', timeout: 10000 });
59+
// Wait for PIM menu to be stable and ready
60+
await this.pimMenu.waitFor({ state: 'attached', timeout: 15000 });
6361
await this.pimMenu.scrollIntoViewIfNeeded();
6462
await this.pimMenu.waitFor({ state: 'visible', timeout: 60000 });
6563

0 commit comments

Comments
 (0)