fix: improve E2E auth resilience and diagnostics #33

Merged
ghost merged 1 commits from fix/e2e-auth-resilience into main 2026-03-10 07:31:27 +00:00
ghost commented 2026-03-09 21:15:09 +00:00 (Migrated from github.com)

Summary

  • Wait for Authentik popup to fully load (domcontentloaded + networkidle) before interacting with form elements
  • Add explicit waitFor on username/password fields with 15s timeout
  • Enable screenshot capture on test failure for diagnostics
  • Increase auth setup timeout to 60s (external IdP can be slow)

Context

The latest E2E run (22865622869) fails at auth setup — the Authentik popup opens but the username textbox isn't found within the 30s timeout. The popup likely needs more time to render its form. This PR adds proper load state waits between each interaction step.

Note: There's also a plugin version mismatch (repo=0.7.0, deployed=0.6.0) that will cause data-dependent tests to fail even after auth is fixed. That's tracked separately (needs Headlamp redeploy with v0.7.0 plugin).

Test plan

  • Verify E2E run on this branch passes auth setup
  • Check that screenshot artifacts are uploaded on failure
  • Confirm auth timeout gives Authentik adequate load time

Refs: PRI-28

## Summary - Wait for Authentik popup to fully load (`domcontentloaded` + `networkidle`) before interacting with form elements - Add explicit `waitFor` on username/password fields with 15s timeout - Enable screenshot capture on test failure for diagnostics - Increase auth setup timeout to 60s (external IdP can be slow) ## Context The latest E2E run ([22865622869](https://github.com/privilegedescalation/headlamp-polaris-plugin/actions/runs/22865622869)) fails at auth setup — the Authentik popup opens but the username textbox isn't found within the 30s timeout. The popup likely needs more time to render its form. This PR adds proper load state waits between each interaction step. **Note:** There's also a plugin version mismatch (repo=0.7.0, deployed=0.6.0) that will cause data-dependent tests to fail even after auth is fixed. That's tracked separately (needs Headlamp redeploy with v0.7.0 plugin). ## Test plan - [ ] Verify E2E run on this branch passes auth setup - [ ] Check that screenshot artifacts are uploaded on failure - [ ] Confirm auth timeout gives Authentik adequate load time Refs: PRI-28
ghost commented 2026-03-09 21:20:54 +00:00 (Migrated from github.com)

E2E Results on this branch

Auth fix confirmed working. Run 22875129554:

  • 2 passed (sidebar tests — auth succeeds, tests that don't need plugin data pass)
  • 14 failed (all data-dependent — version mismatch: deployed=0.6.0, expected=0.7.0)

Compare with the previous run on main 22865622869:

  • 0 passed, 1 failed (auth setup itself failed), 15 did not run

The auth resilience changes fix the OIDC popup interaction. The remaining 14 failures will resolve when Headlamp is redeployed with the v0.7.0 plugin.

Ready for review and merge.

## E2E Results on this branch **Auth fix confirmed working.** Run [22875129554](https://github.com/privilegedescalation/headlamp-polaris-plugin/actions/runs/22875129554): - 2 passed (sidebar tests — auth succeeds, tests that don't need plugin data pass) - 14 failed (all data-dependent — version mismatch: deployed=0.6.0, expected=0.7.0) Compare with the previous run on `main` [22865622869](https://github.com/privilegedescalation/headlamp-polaris-plugin/actions/runs/22865622869): - 0 passed, 1 failed (auth setup itself failed), 15 did not run The auth resilience changes fix the OIDC popup interaction. The remaining 14 failures will resolve when Headlamp is redeployed with the v0.7.0 plugin. Ready for review and merge.
Chris Farhood reviewed 2026-03-10 01:55:42 +00:00
Chris Farhood left a comment

QA Review: PR #33 — E2E Auth Resilience

Changes Verified

  1. e2e/auth.setup.ts - Correctly implemented:

    • Added waitForLoadState before form interaction
    • Added explicit waitFor on username/password fields (15s timeout)
    • Added network idle wait between auth steps
  2. playwright.config.ts - Added:

    • screenshot: \only-on-failure`` for diagnostics
    • timeout: 60_000 for auth setup
  3. e2e/settings.spec.ts - Fixed selector to polaris

Test Results

Test Type Result Notes
Lint Pass
TypeScript ⚠️ Errors Pre-existing vite type def issues (not from this PR)
Unit tests 7 failed Pre-existing failures, also fail on main branch
E2E tests Failing Version mismatch (repo=0.7.0, deployed=0.6.0) - infrastructure issue

Verdict

APPROVED — Auth resilience changes are correctly implemented. E2E failures are due to plugin version mismatch in CI environment (preflight correctly detected this), not regressions from this PR.

## QA Review: PR #33 — E2E Auth Resilience ### Changes Verified 1. **e2e/auth.setup.ts** - ✅ Correctly implemented: - Added `waitForLoadState` before form interaction - Added explicit `waitFor` on username/password fields (15s timeout) - Added network idle wait between auth steps 2. **playwright.config.ts** - ✅ Added: - `screenshot: \`only-on-failure\`` for diagnostics - `timeout: 60_000` for auth setup 3. **e2e/settings.spec.ts** - ✅ Fixed selector to `polaris` ### Test Results | Test Type | Result | Notes | |-----------|--------|-------| | Lint | ✅ Pass | | | TypeScript | ⚠️ Errors | Pre-existing vite type def issues (not from this PR) | | Unit tests | 7 failed | Pre-existing failures, also fail on main branch | | E2E tests | Failing | Version mismatch (repo=0.7.0, deployed=0.6.0) - infrastructure issue | ### Verdict **APPROVED** — Auth resilience changes are correctly implemented. E2E failures are due to plugin version mismatch in CI environment (preflight correctly detected this), not regressions from this PR.
Chris Farhood approved these changes 2026-03-10 01:55:49 +00:00
Chris Farhood left a comment

Changes verified and approved.

Changes verified and approved.
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: privilegedescalation/headlamp-polaris-plugin#33