Skip to content

test(group-management): [OCISDEV-995] fix flaky e2e by waiting for OIDC callback to settle#474

Merged
LukasHirt merged 1 commit into
mainfrom
chore/group-management-e2e-oidc-race
Jun 23, 2026
Merged

test(group-management): [OCISDEV-995] fix flaky e2e by waiting for OIDC callback to settle#474
LukasHirt merged 1 commit into
mainfrom
chore/group-management-e2e-oidc-race

Conversation

@LukasHirt

@LukasHirt LukasHirt commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • loginAsUser() in authHelper.ts now waits for the My Account button to be visible after login, confirming the OIDC redirect has fully completed before returning
  • groupManagement.spec.ts refactored to use loginAsUser/logout from authHelper.ts instead of inlining the login sequence — so the fix lives in one place

Root cause

After the logon POST returns 200, the browser still follows an in-flight redirect to /web-oidc-callback (or /oidc-callback.html). The previous beforeEach returned as soon as that response arrived, so the subsequent page.goto('/group-management') raced against the OIDC redirect and was intermittently interrupted.

Test plan

  • Run pnpm --filter group-management test:e2e — all 6 tests (chrome, firefox, webkit × 2 scenarios) pass
  • Verify no other e2e suite is broken (the authHelper.ts change applies to all callers of loginAsUser)

Closes #473

@kw-security

kw-security commented Jun 23, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@LukasHirt LukasHirt requested a review from mzner June 23, 2026 11:17
@LukasHirt LukasHirt self-assigned this Jun 23, 2026
…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>
@LukasHirt LukasHirt force-pushed the chore/group-management-e2e-oidc-race branch from 0385547 to a580f1c Compare June 23, 2026 11:19
@LukasHirt LukasHirt changed the title test(group-management): fix flaky e2e by waiting for OIDC callback to settle test(group-management): [OCISDEV-995] fix flaky e2e by waiting for OIDC callback to settle Jun 23, 2026
@LukasHirt LukasHirt merged commit 6533a0d into main Jun 23, 2026
24 checks passed
@LukasHirt LukasHirt deleted the chore/group-management-e2e-oidc-race branch June 23, 2026 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Investigate flaky group management E2E tests

3 participants