Skip to content

[tests-only][full-ci] test: set up Keycloak users via HTTP instead of Web UI - #12930

Merged
ishabaral merged 1 commit into
masterfrom
get-token-with-mfa
Sep 16, 2026
Merged

ishabaral merged 1 commit into
masterfrom
get-token-with-mfa

Conversation

@PrajwolAmatya

@PrajwolAmatya PrajwolAmatya commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Description

apiVault tests needs a user logged in with an acr=advanced (MFA step-up) token to request to /vault/graph. This step required headless Chromium (Playwright): log in via the web UI, switch to vault mode, scrape the TOTP QR code, and extract the token from browser storage. This step would only work for user roles Admin and Space Admin. In addition to that, the webUI steps takes more time to complete this flow and tests sometimes failed when decoding the QR code.

Key Changes:

  • KeycloakHelper::getCode() now drives the whole login, including MFA, purely over HTTP.
  • Renamed the authenticateKeycloakUserIfNeeded function to setUpKeycloakUserInOcis
  • The step in vault.feature, And user "<user>" has logged in via web UI is replaced with And user "<user>" has been set up in oCIS, wihch uses the function setUpKeycloakUserInOcis to setup the user in oCIS.
  • Removed WebUIHelper.php file and Playwright dependency.

With the changes the flaky test failure in apiVault with error Failed to base64-decode QR image data should be gone as we now don't rely on QR scanning step. Likewise, the test run time is reduced with the removal of web UI steps.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

@kw-security

kw-security commented Sep 11, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@PrajwolAmatya
PrajwolAmatya force-pushed the get-token-with-mfa branch 11 times, most recently from fe73f03 to f91ba98 Compare September 14, 2026 06:15
@PrajwolAmatya PrajwolAmatya changed the title [tests-only][full-ci] test: fix user mfa setup for vault [tests-only][full-ci][k8s] test: fix user mfa setup for vault Sep 14, 2026
@PrajwolAmatya
PrajwolAmatya force-pushed the get-token-with-mfa branch 4 times, most recently from 1591c45 to fed0cc8 Compare September 14, 2026 08:17
@PrajwolAmatya PrajwolAmatya changed the title [tests-only][full-ci][k8s] test: fix user mfa setup for vault [tests-only][full-ci] test: fix user mfa setup for vault Sep 14, 2026
Signed-off-by: Prajwol Amatya <prajwolamatya11@gmail.com>
@PrajwolAmatya PrajwolAmatya changed the title [tests-only][full-ci] test: fix user mfa setup for vault [tests-only][full-ci] test: set up Keycloak users via HTTP instead of Web UI Sep 16, 2026
@PrajwolAmatya
PrajwolAmatya marked this pull request as ready for review September 16, 2026 04:15
@PrajwolAmatya
PrajwolAmatya requested a review from a team as a code owner September 16, 2026 04:15
@ishabaral
ishabaral merged commit 3e3bb41 into master Sep 16, 2026
141 of 143 checks passed
@ishabaral
ishabaral deleted the get-token-with-mfa branch September 16, 2026 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants