mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-05-31 05:49:23 -05:00
[PR #7248] Fix playwright: get the test suite back to green against bundled web-vault v2026.4.1 #26122
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/dani-garcia/vaultwarden/pull/7248
Author: @zaid-marji
Created: 5/24/2026
Status: 🔄 Open
Base:
main← Head:playwright-helpers-fix📝 Commits (8)
c0589bbplaywright: fix stale Master password selectors against bundled web vaultc02ced4playwright: fix TOTP setup flow against bundled web vaultf30847dplaywright: serve the test Vaultwarden over HTTPSa3fb027gitignore: catch stray playwright artifacts at the repo root9186ec2playwright: fix stale org-nav selectors against bundled web vault0c009d6playwright: fix invitation-accepted toast text + SSO existing-account redirectad582b4playwright: centralize web-vault selectors into shared setup helpers88ab514playwright: centralize 2FA challenge handling📊 Changes
17 files changed (+241 additions, -122 deletions)
View changed files
📝
.gitignore(+6 -0)📝
playwright/.env.template(+2 -1)📝
playwright/compose/warden/Dockerfile(+12 -0)📝
playwright/global-utils.ts(+1 -1)📝
playwright/playwright.config.ts(+1 -0)📝
playwright/test.env(+2 -1)📝
playwright/tests/login.smtp.spec.ts(+5 -16)📝
playwright/tests/login.spec.ts(+2 -17)📝
playwright/tests/organization.smtp.spec.ts(+6 -7)📝
playwright/tests/setups/2fa.ts(+96 -38)📝
playwright/tests/setups/orgs.ts(+14 -6)📝
playwright/tests/setups/sso.ts(+7 -25)📝
playwright/tests/setups/user.ts(+78 -4)📝
playwright/tests/sso_login.smtp.spec.ts(+1 -1)📝
playwright/tests/sso_login.spec.ts(+1 -1)📝
playwright/tests/sso_organization.smtp.spec.ts(+6 -3)📝
playwright/tests/sso_organization.spec.ts(+1 -1)📄 Description
Summary
The bundled web vault (
v2026.4.1perdocker/DockerSettings.yaml) refusesthe playwright suite's interactions for several compounding reasons: stale
label selectors, stale org-nav selectors, a renamed invitation-acceptance
toast, an SSO existing-account flow that no longer auto-redirects to the
IdP, and the web vault refusing plain HTTP.
login.spec.tsand every speccalling
createAccount/logUser/activateTOTP/orgs.*/*.smtp.spec.tsorg-invite flows fails before doing anything useful. ThisPR restores the suite to green against the current bundled vault, and along
the way centralises the selectors and 2FA-challenge flow so the next
web-vault bump has one place to update.
Eight commits, each with a single concern (commit bodies have the full
motivation):
fix stale Master password selectors— the input lost its(required)suffix. Switch togetByLabel('Master password')and anchorthe ambiguous new/confirm fields by
formcontrolname.fix TOTP setup flow— Continue race with AngularupdateOn: 'blur'(submit via
Enter), Key selector ambiguous with Yubico SVG aria-label(anchor
{ exact: true }), Close button transiently disabled during thesuccess-dialog transition (drop the click; dialog auto-closes).
serve the test Vaultwarden over HTTPS— the web vault refusesregistration over HTTP. Self-signed cert generated in the test image,
ROCKET_TLSpointed at it,DOMAINswitched tohttps://,ignoreHTTPSErrors: trueset on every playwright context.gitignore: catch stray playwright artifacts at the repo root—adds
test-results/andplaywright-report/to root.gitignore.fix stale org-nav selectors— product-switch nav links and thein-org "Members" entry are icon-only; switch to
getByRole('link', { name: '…' })and force-click past the hovertooltip that intercepts the click.
fix invitation-accepted toast text + SSO existing-account redirect— toast is now
"Successfully accepted your invitation"; the SSOinvited-with-existing-account flow no longer auto-redirects to Keycloak
(explicit "Use single sign-on" click required).
centralize web-vault selectors into shared setup helpers— extractsthe avatar menu, registration MP-fill, user-verification gate, and the
TOTP/email enrol+disable flow into shared helpers in
setups/. Futureweb-vault selector changes only have to be updated in one place.
centralize 2FA challenge handling—submitTwoFactor(test, page, twoFactor)with aTwoFactordiscriminated union (totp/mail2fa/fido2) drives the/#/2fapage fromsetups/2fa.ts. BothlogUservariants (MP and SSO) gain a
twoFactor?: TwoFactoroption that delegatesto it; the four inline 2FA submission blocks across
login.spec.ts,login.smtp.spec.ts,sso_login.spec.ts, andsso_login.smtp.spec.tscollapse to one line each.
Test plan
Verified against bundled web-vault
v2026.4.1over the fullparallel-projects docker suite (sqlite + mariadb + mysql + postgres + four
SSO variants, 140 tests, 129 pass). Every previously-broken
master-password / TOTP / org-nav / invite-toast / HTTPS path now passes on
every DB backend.
The remaining failures are unrelated to this branch's scope: PBKDF2-key-
derivation timing flakes under the saturated parallel-projects suite (the
same tests pass on sibling DB projects under identical code).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.