Skip to content

Commit f70900f

Browse files
committed
fix(e2e): make oidc logout test more robust
Resolves an intermittent failure in the oidc-suites logout test by using a more robust pattern for waiting for navigation after a click. This avoids a race condition where the test could time out before the navigation completes.
1 parent 4a8638f commit f70900f

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

.changeset/config.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
"baseBranch": "main",
1414
"updateInternalDependencies": "patch",
1515
"ignore": [
16-
"ping-javascript-sdk",
1716
"scratchpad",
1817
"@forgerock/pingone-scripts",
1918
"@forgerock/device-client",

e2e/oidc-suites/src/logout.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ test.describe('Logout tests', () => {
3838

3939
await page.getByLabel('User Name').fill(pingAmUsername);
4040
await page.getByRole('textbox', { name: 'Password' }).fill(pingAmPassword);
41+
const amNavigation = page.waitForURL('http://localhost:8443/ping-am/**');
4142
await page.getByRole('button', { name: 'Next' }).click();
42-
43-
await page.waitForURL('http://localhost:8443/ping-am/**');
43+
await amNavigation;
4444
expect(page.url()).toContain('code');
4545
expect(page.url()).toContain('state');
4646
await expect(page.getByRole('button', { name: 'Login (Background)' })).toBeHidden();
@@ -74,9 +74,9 @@ test.describe('Logout tests', () => {
7474

7575
await page.getByLabel('Username').fill(pingOneUsername);
7676
await page.getByRole('textbox', { name: 'Password' }).fill(pingOnePassword);
77+
const p1Navigation = page.waitForURL('http://localhost:8443/ping-one/**');
7778
await page.getByRole('button', { name: 'Sign On' }).click();
78-
79-
await page.waitForURL('http://localhost:8443/ping-one/**');
79+
await p1Navigation;
8080
expect(page.url()).toContain('code');
8181
expect(page.url()).toContain('state');
8282
await expect(page.getByRole('button', { name: 'Login (Background)' })).toBeHidden();

0 commit comments

Comments
 (0)