Skip to content

Commit fabefe7

Browse files
authored
Merge pull request #2742 from bcgov/e2e-test-troubleshoot
chore: updated e2e test wait time
2 parents 99281c9 + 37b1dda commit fabefe7

File tree

5 files changed

+26
-3
lines changed

5 files changed

+26
-3
lines changed

.github/workflows/e2e-test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ on:
2424
pull_request:
2525
branches:
2626
- main
27+
- develop
2728
jobs:
2829
test:
2930
name: Playwright Tests

e2e/pages/alcs/alcs-login-page.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,16 @@ export class ALCSLoginPage {
2222
}
2323

2424
async login(username: string, password: string) {
25-
await this.idirLink.click();
25+
// Click IDIR link and wait for navigation to external auth service
26+
// Use domcontentloaded since external auth services can be slow
27+
await Promise.all([
28+
this.page.waitForURL('**/auth/**', { timeout: 30000, waitUntil: 'domcontentloaded' }),
29+
this.idirLink.click(),
30+
]);
31+
32+
// Wait for login form to be ready
33+
await this.userIdTextbox.waitFor({ state: 'visible', timeout: 30000 });
34+
2635
await this.userIdTextbox.fill(username);
2736
await this.passwordTextbox.fill(password);
2837
await this.continueButton.click();

e2e/pages/portal/parcels-page.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ export class ParcelsPage {
168168
await this.ownerSaveButton.click();
169169

170170
// Wait for dialog to disappear
171-
await expect(this.ownerAddDialog).toBeHidden();
171+
await this.ownerAddDialog.waitFor({ state: 'hidden', timeout: 5000 });
172172
}
173173

174174
// Actions

e2e/pages/portal/portal-login-page.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,16 @@ export class PortalLoginPage {
2222
}
2323

2424
async logIn(username: string, password: string) {
25-
await this.loginButton.click();
25+
// Click login and wait for navigation to external auth service
26+
// Use domcontentloaded since external auth services can be slow
27+
await Promise.all([
28+
this.page.waitForURL('**/auth/**', { timeout: 30000, waitUntil: 'domcontentloaded' }),
29+
this.loginButton.click(),
30+
]);
31+
32+
// Wait for login form to be ready
33+
await this.userIdTextbox.waitFor({ state: 'visible', timeout: 30000 });
34+
2635
await this.userIdTextbox.fill(username);
2736
await this.passwordTextbox.fill(password);
2837
await this.continueButton.click();

e2e/playwright.config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ export default defineConfig({
3030

3131
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
3232
trace: 'on-first-retry',
33+
34+
/* Increase timeouts for external auth services which can be slow */
35+
navigationTimeout: 30000,
36+
actionTimeout: 30000,
3337
},
3438

3539
/* Configure projects for major browsers */

0 commit comments

Comments
 (0)