test(group-management): [OCISDEV-995] fix flaky e2e by waiting for OIDC callback to settle#474
Merged
Merged
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
…avigating in e2e
After the logon response arrives the browser still follows an in-flight
redirect to /web-oidc-callback (or /oidc-callback.html). Calling
page.goto('/group-management') before that redirect settles races against
it and causes an intermittent 'navigation interrupted' failure.
Fix loginAsUser() in authHelper.ts to wait for the My Account button to
appear (confirming the OIDC flow is fully complete) before returning.
Refactor groupManagement.spec.ts to use loginAsUser/logout from
authHelper.ts instead of inlining the login sequence, so the fix lives
in one place.
Signed-off-by: Lukas Hirt <info@hirt.cz>
mzner
approved these changes
Jun 23, 2026
0385547 to
a580f1c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
loginAsUser()inauthHelper.tsnow waits for the My Account button to be visible after login, confirming the OIDC redirect has fully completed before returninggroupManagement.spec.tsrefactored to useloginAsUser/logoutfromauthHelper.tsinstead of inlining the login sequence — so the fix lives in one placeRoot cause
After the
logonPOST returns 200, the browser still follows an in-flight redirect to/web-oidc-callback(or/oidc-callback.html). The previousbeforeEachreturned as soon as that response arrived, so the subsequentpage.goto('/group-management')raced against the OIDC redirect and was intermittently interrupted.Test plan
pnpm --filter group-management test:e2e— all 6 tests (chrome, firefox, webkit × 2 scenarios) passauthHelper.tschange applies to all callers ofloginAsUser)Closes #473