chore: Add Vault Mode CI setup for E2E tests and tests for second-factor authentication - #12577
Conversation
|
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
70d8aad to
bc5dd16
Compare
35a2b52 to
0e33d32
Compare
535d2d6 to
a7f018b
Compare
59bcbd1 to
4300c57
Compare
There was a problem hiding this comment.
Pull request overview
This PR extends the oCIS acceptance/E2E setup to run Playwright tests in Vault Mode (with Keycloak + MFA/TOTP), including CI matrix wiring and a new Vault-specific E2E spec plus supporting page objects/utilities.
Changes:
- Adds a new
vault-storagePlaywright suite to the GitHub Actions acceptance workflow and propagates theVAULT_STORAGE_NEEDEDflag into the acceptance runner. - Extends the acceptance E2E runner to enable Vault Mode + MFA/OIDC
acrscope and start a dedicatedstorage-users-vaultservice with its own data directory. - Introduces Vault Mode Playwright test coverage (steps/spec) plus a QR→OTP helper for authenticating into Vault.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
web/tests/e2e/support/utils/mfa.ts |
Adds helper to generate OTP from a QR screenshot buffer. |
web/tests/e2e/support/objects/vault/index.ts |
Adds Vault page locators for mode switching and MFA flow elements. |
web/tests/e2e/support/objects/vault/action.ts |
Adds Vault interaction helpers (enter vault, screenshot QR, submit OTP, wait for redirect). |
web/tests/e2e/steps/ui/vault.ts |
Adds step definitions for switching Drive↔Vault and handling MFA authentication. |
web/tests/e2e/steps/ui/index.ts |
Exposes the new Vault UI steps via the UI steps barrel export. |
web/tests/e2e/specs/vault-storage/vault.spec.ts |
Adds a Vault Mode E2E spec exercising MFA and mode switching. |
web/tests/e2e/environment/test.ts |
Skips storeKeycloakGroups() during vault-mode tests via new config flag. |
web/tests/e2e/config.js |
Adds vaultMode config flag from VAULT_MODE env. |
tests/acceptance/run-e2e.py |
Enables Vault Mode + Keycloak/MFA plumbing and starts storage-users-vault for Vault E2E runs. |
.github/workflows/acceptance-tests.yml |
Adds vault-storage suite to the CI matrix and ensures Keycloak setup runs for it. |
Suppressed comments (2)
web/tests/e2e/steps/ui/vault.ts:41
captureQrCodeScreenshot()anduserAuthenticatesWithOTP()are implemented onVaultActions(support/objects/vault/action.ts), not onVaultPage, souserAuthenticatesToVaultwill fail at compile time.
const qrBuffer = await vaultPage.captureQrCodeScreenshot()
const otp = await generateOtpFromScreenshot(qrBuffer)
await vaultPage.userAuthenticatesWithOTP(otp)
web/tests/e2e/steps/ui/vault.ts:63
userEntersDriveMode()is implemented onVaultActions(support/objects/vault/action.ts), not onVaultPage, souserSwitchesToDriveModecurrently won't compile.
await vaultPage.userEntersDriveMode()
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
b79dc4d to
45c65d3
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.
Suppressed comments (2)
tests/acceptance/run-e2e.py:530
KEYCLOAK_HOSTis set in the baseplaywright_enveven whenkeycloak_neededis false, and then set again inside theif keycloak_needed:block. This is redundant and can be confusing for non-Keycloak runs (it implies a Keycloak endpoint even when Keycloak isn't started). Consider only settingKEYCLOAK_HOSTwhenkeycloak_neededis true.
"BROWSER": "chromium",
"KEYCLOAK_HOST": "localhost:8443",
}
web/tests/e2e/specs/vault-storage/vault.spec.ts:27
ui.userAuthenticatesWithOTP()ultimately screenshots the QR code to a fixedqr.pngpath (seeweb/tests/e2e/support/objects/app-admin-settings/general/actions.ts). With Playwright running tests in parallel, this shared filename can cause races/corruption if more than one OTP test runs concurrently (e.g., when running multiple suites locally). Consider updating the OTP helper to write to a per-test/per-worker output path (e.g.,testInfo.outputPath(...)or a worker-specific temp path) to avoid cross-test interference.
await ui.userAuthenticatesWithOTP({ stepUser: 'Alice', deviceName: 'test' })
chore: vault mode ci setup
Signed-off-by: Kavita Gautam <kavita@jankaritech.com>
Signed-off-by: Kavita Gautam <kavita@jankaritech.com>
Signed-off-by: Kavita Gautam <kavita@jankaritech.com>
Signed-off-by: Kavita Gautam <kavita@jankaritech.com>
Signed-off-by: Kavita Gautam <kavita@jankaritech.com>
Signed-off-by: Kavita Gautam <kavita@jankaritech.com>
Signed-off-by: Kavita Gautam <kavita@jankaritech.com>
Signed-off-by: Kavita Gautam <kavita@jankaritech.com>
Signed-off-by: Kavita Gautam <kavita@jankaritech.com>
Signed-off-by: Kavita Gautam <kavita@jankaritech.com>
Signed-off-by: Kavita Gautam <kavita@jankaritech.com>
Description
This PR adds CI configuration to run Vault Mode E2E tests with Keycloak and MFA enabled.
Changes
vault-storageto the Playwright E2E CI matrix.acrscope configuration.OCIS_ENABLE_VAULT_MODEandFRONTEND_ENABLE_VAULT_MODE.storage-users-vaultservice in CI.Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: