Skip to content

Added a missing dependency - #462

Open
Abdul-ardc wants to merge 11 commits into
mainfrom
defect/dependency
Open

Added a missing dependency#462
Abdul-ardc wants to merge 11 commits into
mainfrom
defect/dependency

Conversation

@Abdul-ardc

Copy link
Copy Markdown
Contributor

changelog: fixed dependecy

@Abdul-ardc
Abdul-ardc requested a review from robleney-ardc May 25, 2026 02:10
@Abdul-ardc
Abdul-ardc requested review from mpfl and removed request for robleney-ardc May 25, 2026 02:50
Abdul-ardc and others added 8 commits May 25, 2026 15:23
- Add setup.setTimeout(120_000) to give the auth setup test a 2-minute
  budget (cold Keycloak JVM + multiple redirect hops)
- Add global timeout: 90_000 in CI to playwright.config.ts so ordinary
  tests also have headroom on slow CI runners
- Switch page.goto('/login') and waitForURL() to waitUntil:'domcontentloaded'
  so Playwright returns as soon as HTML is parsed instead of blocking on
  Keycloak's slow 'load' event (all JS/CSS/fonts from a cold JVM)
- Raise waitForURL timeout to 60_000 and post-login waitForFunction to
  30_000 to accommodate cold CI startup delays

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Previous approach: goto('/login') and wait for the app's JS chain
(config fetch -> React render -> Keycloak JS init -> silent SSO iframe)
to redirect to Keycloak. That chain can exceed 60 s on a cold CI JVM,
causing waitForURL to time out before the redirect ever fires.

New approach:
1. Build a PKCE pair and navigate straight to Keycloak's /auth endpoint.
   This skips the entire app boot sequence and goes directly to the login
   form — Keycloak just needs to serve its own HTML.
2. Fill in credentials; Keycloak sets the SSO session cookie and redirects
   to BASE_URL/?code=... (we don't need to exchange the code).
3. Navigate to BASE_URL/raids cleanly (no ?code= params). The app's
   check-sso now resolves immediately because Keycloak already has an
   active session in its cookie, so no cold-start delay.
4. Use an inverse waitForURL: if /login appears we fail fast; timeout
   means we stayed on /raids and auth succeeded.

Also adds VITE_KEYCLOAK_REALM, VITE_KEYCLOAK_CLIENT_ID and BASE_URL
env-var guards (all already set in the CI workflow).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Three fixes for the remaining E2E failures:

1. Skip @Local tests in CI (playwright.config.ts)
   Tests 02-06 are tagged { tag: '@Local' } because they require local
   dev infrastructure (mock ORCID server, sandbox ORCID IDs, pre-seeded
   data). Without a grepInvert filter they ran in CI and consistently
   failed on 'getByTestId(raid-form)' — 20 of 26 failures.

2. Raise navigation timeout in CI to 90 s (playwright.config.ts)
   page.goto() defaults to the navigationTimeout (30 s), not the test
   timeout (90 s). The unauthenticated redirect tests were calling
   goto('/') with default waitUntil:'load', which follows the client-side
   redirect to Keycloak and then waits for Keycloak's load event — easily
   exceeding 30 s on a cold JVM.

3. Fix unauthenticated redirect tests (01-auth.spec.ts)
   - Use waitUntil:'domcontentloaded' on goto() so Playwright returns as
     soon as the app HTML is parsed, before the Keycloak JS redirect fires.
   - Raise waitForURL timeout to 60 s (was 30 s) to give the full
     app-boot -> check-sso -> login() -> Keycloak chain time to complete.
   - Raise the RAiD list visibility check from 15 s to 30 s to allow for
     check-sso round-trip + API response on CI cold start.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1. waitForURL was blocking on Keycloak's 'load' event (same problem as
   page.goto) — add waitUntil:'domcontentloaded' to both unauthenticated
   redirect assertions so we return as soon as Keycloak's login HTML is
   parsed, not after all JS/CSS/fonts finish loading.

2. The 'authenticated user can see the RAiD list page' test was checking
   for 'No RAiDs found' which doesn't exist in RaidTable — the DataGrid
   renders even with 0 rows, and a 403 from the API renders an
   ErrorAlertComponent instead. Accept both states, raise timeout to 60 s.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
setup.ts:
- Navigate directly to Keycloak auth endpoint with PKCE (bypass app
  boot chain which blocks on config fetch + silent SSO iframe)
- After login, navigate to /raids and wait for DataGrid or error text
  to appear (90 s) before saving storageState — this ensures:
    a) check-sso has completed and tokens are written to localStorage
    b) Keycloak prompt=none JVM code path is warmed up so subsequent
       tests' check-sso completes in seconds, not 60+ s
- Increase setup.setTimeout to 150 s to budget for warm-up

01-auth.spec.ts:
- Change unauthenticated waitForURL to waitUntil:commit (just verify
  redirect started, not that Keycloak page fully loaded) — Keycloak
  domcontentloaded can take 60+ s on cold JVM in CI
- Increase waitForURL timeout to 80 s
- Remove #username visibility assertions (require full page load)
- Increase authenticated grid/error assertion to 90 s timeout

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

2 participants