Skip to content

web: e2e tests for user offboarding - #24369

Merged
GirlBossRush merged 2 commits into
mainfrom
dominic/user-offboarding-e2e
Sep 16, 2026
Merged

GirlBossRush merged 2 commits into
mainfrom
dominic/user-offboarding-e2e

Conversation

@dominic-r

@dominic-r dominic-r commented Jul 25, 2026 •

Copy link
Copy Markdown
Member

Details

What does this PR change?

Adds web/test/browser/310-user-offboarding.test.ts, covering scheduled user offboarding end to end:

  • Schedule, list, cancel, and reschedule an offboarding.
  • Reject a schedule in the past.
  • Hide self-offboarding while keeping regular service accounts eligible.
  • Bulk-cancel pending offboardings.
  • Execute a scheduled deactivation and a scheduled deletion, asserting the resulting audit events and that a deactivated user can no longer sign in.

This branch previously carried the whole offboarding feature. That has since merged into main, so it has been rebased down to just the test file, and stacked on the user switching e2e branch.

Why is this change needed?

Offboarding shipped without browser coverage.

How was this tested?

npx playwright test 310-user-offboarding against a local instance with a valid enterprise license: 7 tests green across two consecutive runs.

The inherited tests were written against an earlier iteration of the offboarding UI and did not pass. What had to change:

  • Field interactions are scoped to the modal wrapper, not the dialog element. ak-forms-modal / ak-forms-confirm / ak-forms-delete-bulk slot their content into ak-modal, whose <dialog> lives in a shadow root — so the dialog is not a DOM ancestor of any field, and role queries scoped to it matched nothing. This is worth knowing for any test touching these older slot-based modals.
  • The pending-offboarding trigger is matched by text. Its label sits inside a pf-tooltip, whose shadow root keeps it out of the button's computed accessible name.
  • The Active row is reached from its dt across to the paired dd. The ARIA term role does not take its name from content, so getByRole("term", { name: "Active" }) matches nothing.
  • The System Tasks page is addressed by element, because it renders an unnamed <main> unlike the table pages.
  • The two execution tests get a raised timeout (they wait for a schedule to fall due) and pin their scheduled time immediately before scheduling, so setup can't push it into the past.
  • Waiting for the completed status reloads between attempts, because the list does not refetch when an unchanged search query is re-submitted.

Linked issues

Closes #24763


Co-Authored-By: Claude Opus 5 [email protected]

🤖 Generated with Claude Code

@dominic-r dominic-r self-assigned this Jul 25, 2026
Copilot AI lite review requested due to automatic review settings July 25, 2026 20:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@netlify

netlify Bot commented Jul 25, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-storybook ready!

Name Link
🔨 Latest commit af23816
🔍 Latest deploy log https://app.netlify.com/projects/authentik-storybook/deploys/6a72271a595b28000831897b
😎 Deploy Preview https://deploy-preview-24369--authentik-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Jul 25, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-integrations ready!

Name Link
🔨 Latest commit 98fe4fb
🔍 Latest deploy log https://app.netlify.com/projects/authentik-integrations/deploys/6a72360065ea040008d6c59b
😎 Deploy Preview https://deploy-preview-24369--authentik-integrations.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Jul 25, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit 98fe4fb
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/6a72360043dc830008010ec7
😎 Deploy Preview https://deploy-preview-24369--authentik-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented Jul 25, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.89%. Comparing base (0bdb759) to head (238266f).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #24369   +/-   ##
=======================================
  Coverage   91.89%   91.89%           
=======================================
  Files        1171     1171           
  Lines       75653    75653           
  Branches     4056     4056           
=======================================
  Hits        69522    69522           
  Misses       6089     6089           
  Partials       42       42           
Flag Coverage Δ
conformance 33.69% <ø> (+<0.01%) ⬆️
e2e 38.36% <ø> (+<0.01%) ⬆️
integration 30.41% <ø> (+<0.01%) ⬆️
rust 42.89% <ø> (ø)
unit 93.45% <ø> (ø)
unit-migrate 93.48% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@github-actions

github-actions Bot commented Jul 25, 2026 •

Copy link
Copy Markdown
Contributor

authentik PR Installation instructions

Instructions for docker-compose

Add the following block to your .env file:

AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-238266f5989a24ecc4f75d2d48a1230ad9af8900
AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE=ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s

Afterwards, run the upgrade commands from the latest release notes.

Instructions for Kubernetes

Add the following block to your values.yml file:

authentik:
    outposts:
        container_image_base: ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s
global:
    image:
        repository: ghcr.io/goauthentik/dev-server
        tag: gh-238266f5989a24ecc4f75d2d48a1230ad9af8900

Afterwards, run the upgrade commands from the latest release notes.

@dominic-r
dominic-r force-pushed the dominic/user-offboarding-e2e branch from ec91885 to af23816 Compare August 4, 2026 17:53
Copilot AI review requested due to automatic review settings August 4, 2026 17:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@dominic-r dominic-r changed the title Dominic/user offboarding e2e web: e2e tests for user offboarding Aug 4, 2026
@dominic-r
dominic-r changed the base branch from main to dominic/user-switching-e2e August 4, 2026 17:54
@dominic-r
dominic-r marked this pull request as ready for review August 4, 2026 17:57
@dominic-r
dominic-r force-pushed the dominic/user-offboarding-e2e branch from af23816 to c3a907b Compare August 4, 2026 17:57
@dominic-r
dominic-r requested a review from a team as a code owner August 4, 2026 17:57
Copilot AI review requested due to automatic review settings August 4, 2026 18:57
@dominic-r
dominic-r force-pushed the dominic/user-offboarding-e2e branch from c3a907b to 98fe4fb Compare August 4, 2026 18:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@dominic-r
dominic-r force-pushed the dominic/user-offboarding-e2e branch from 98fe4fb to 73753f4 Compare September 13, 2026 01:23
Base automatically changed from dominic/user-switching-e2e to main September 13, 2026 06:51
@GirlBossRush
GirlBossRush force-pushed the dominic/user-offboarding-e2e branch from 73753f4 to 6782436 Compare September 13, 2026 06:51
@dominic-r dominic-r mentioned this pull request Sep 14, 2026
1 of 3 tasks
@dominic-r
dominic-r force-pushed the dominic/user-offboarding-e2e branch from 0e18639 to 46dbbf1 Compare September 14, 2026 16:20
@dominic-r
dominic-r requested a review from a team as a code owner September 14, 2026 16:20
dominic-r and others added 2 commits September 14, 2026 12:55
Adds web/test/browser/310-user-offboarding.test.ts, covering scheduling,
listing, cancelling, rescheduling, bulk cancellation, and execution of
user offboardings, plus the audit events they emit.

Carried over from dominic/user-offboarding-e2e and reconciled with the UI
that actually merged. Fixes needed to make the suite pass:

- Scope field interactions to the modal wrapper, not the `dialog` element.
  `ak-forms-modal`/`ak-forms-confirm`/`ak-forms-delete-bulk` slot their
  content into `ak-modal`, whose `<dialog>` lives in a shadow root, so the
  dialog is not a DOM ancestor of any field and role queries scoped to it
  matched nothing at all.
- Match the pending-offboarding trigger by text. Its label sits inside a
  `pf-tooltip`, which keeps it out of the button's accessible name.
- Address the Active row from its `dt` across to the paired `dd`; the
  `term` role does not take its name from content.
- Address the System Tasks page by element, since it renders an unnamed
  `<main>` unlike the table pages.
- Raise the timeout on the two execution tests, which wait for a schedule
  to fall due, and pin their scheduled time immediately before scheduling
  so setup cannot push it into the past.
- Reload between attempts when waiting for the completed status; the list
  does not refetch when an unchanged search query is re-submitted.

Signed-off-by: Dominic R <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
@dominic-r
dominic-r force-pushed the dominic/user-offboarding-e2e branch from 46dbbf1 to 238266f Compare September 14, 2026 16:55
@github-project-automation github-project-automation Bot moved this from Todo to In Progress in authentik Core Sep 16, 2026
@GirlBossRush
GirlBossRush merged commit 47c22d3 into main Sep 16, 2026
145 checks passed
@GirlBossRush
GirlBossRush deleted the dominic/user-offboarding-e2e branch September 16, 2026 15:19
@github-project-automation github-project-automation Bot moved this from In Progress to Done in authentik Core Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

web: e2e coverage for user offboarding

3 participants