Skip to content

Playwright Test - Login with HA enabled #1228

Open
trdoyle81 wants to merge 7 commits into
redhat-developer:masterfrom
trdoyle81:GITOPS-102920-Login-With-HA
Open

Playwright Test - Login with HA enabled #1228
trdoyle81 wants to merge 7 commits into
redhat-developer:masterfrom
trdoyle81:GITOPS-102920-Login-With-HA

Conversation

@trdoyle81

@trdoyle81 trdoyle81 commented Jul 21, 2026

Copy link
Copy Markdown
Member

What type of PR is this?

/kind enhancement
/kind cleanup

What does this PR do / why we need it:

This PR introduces a new E2E test suite to verify UI login functionality when Argo CD is configured with High Availability (HA) enabled.

Alongside the new test, it hardens the existing Playwright E2E framework
Improved error handling, timeout tuning, and UI locators to reduce test flakiness.
Cleaned up the run-ui-tests.sh execution script and added strict fail checks.

Have you updated the necessary documentation?

  • Documentation update is required by this PR.
  • Documentation has been updated.

Which issue(s) this PR fixes:

Fixes GITOPS-102920

Test acceptance criteria:

  • Unit Test
  • E2E Test

How to test changes / Special notes to the reviewer:

Verified on

GitOps Operator Version Embedded Argo CD Version
v1.21.x v3.4.x
v1.20.x v3.3.x
v1.19.x v3.1.x

Run the new test locally against any provisioned cluster:
./test/ui-e2e/run-ui-tests.sh tests/ha-login.spec.ts --headed --reporter=list --trace on --project=chromium

Triona Doyle added 4 commits July 21, 2026 10:37
Signed-off-by: Triona Doyle <tekton@example.com>
Signed-off-by: Triona Doyle <tekton@example.com>
Signed-off-by: Triona Doyle <tekton@example.com>
Signed-off-by: Triona Doyle <tekton@example.com>
@openshift-ci openshift-ci Bot added kind/enhancement New feature or request kind/cleanup Categorizes issue or PR as related to cleaning up code, process. labels Jul 21, 2026
@openshift-ci
openshift-ci Bot requested review from varshab1210 and wtam2018 July 21, 2026 09:45
@openshift-ci

openshift-ci Bot commented Jul 21, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign chetan-rns for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: b1ef32f6-e2fa-4a27-89c7-0abb4e9a7abf

📥 Commits

Reviewing files that changed from the base of the PR and between e5e6047 and 480a063.

📒 Files selected for processing (1)
  • test/ui-e2e/tests/ha-login.spec.ts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • argoproj-labs/argocd-operator (manual)
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/ui-e2e/tests/ha-login.spec.ts

📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • Added UI end-to-end coverage for Argo CD login in high-availability mode, including local administrator and OpenShift SSO scenarios.
  • Bug Fixes
    • Made identity-provider selection during login more tolerant to UI variations.
    • Increased the time allowed for navigation to the Applications dashboard to reduce flakiness.
    • Improved the UI test runner by bounding API calls and failing fast when setup prerequisites fail.
  • Tests
    • Added HA rollout and shutdown assertions around the login flow.
    • Simplified a resource tree test’s callback signature for clarity.

Walkthrough

Adds Playwright coverage for local and OpenShift SSO login during HA deployments, improves HA setup and teardown handling, hardens the UI test runner against stalled or failed setup commands, and adjusts login and locator timing.

Changes

UI end-to-end validation

Layer / File(s) Summary
HA cluster lifecycle
test/ui-e2e/tests/ha-login.spec.ts
Enables HA for serial login tests, waits for proxy and server rollouts, then restores non-HA state during teardown.
HA login scenarios
test/ui-e2e/tests/ha-login.spec.ts, test/ui-e2e/src/pages/LoginPage.ts
Adds local admin and OpenShift SSO login tests under HA and extends the dashboard navigation timeout.
Runner and locator resilience
test/ui-e2e/run-ui-tests.sh, test/ui-e2e/.auth/setup.ts, test/ui-e2e/global.setup.ts, test/ui-e2e/tests/resource-tree.spec.ts
Adds bounded API version discovery, fatal installation errors, tolerant IDP matching, updated modal notes, corrected formatting, and removes an unused fixture value.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Playwright
  participant OpenShiftCluster
  participant ArgoCDUI
  Playwright->>OpenShiftCluster: Enable HA and wait for rollouts
  Playwright->>OpenShiftCluster: Extract admin password
  Playwright->>ArgoCDUI: Submit local admin login
  Playwright->>ArgoCDUI: Perform OpenShift SSO login
  ArgoCDUI-->>Playwright: Navigate to applications
  Playwright-->>Playwright: Assert Applications is visible
  Playwright->>OpenShiftCluster: Disable HA and wait for availability
Loading

Suggested reviewers: wtam2018, varshab1210

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: a new Playwright login test for HA-enabled Argo CD.
Description check ✅ Passed The description is directly related and accurately summarizes the HA login suite and Playwright hardening changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test/ui-e2e/tests/ha-login.spec.ts`:
- Around line 11-56: Extend the timeout for the HA setup hook in test.beforeAll
so its intentional polling and rollout waits can complete within the possible
multi-minute duration. Use the hook’s testInfo parameter and call
testInfo.setTimeout with a budget covering the retry loop and rollout commands,
while leaving the existing setup behavior unchanged.
- Around line 10-11: Override the inherited authentication state for the
ha-login spec by adding test.use with empty cookies and origins before the
tests, so page.goto('/login?dex=none') always reaches the login form. Keep the
existing login flow and beforeAll setup unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: b7eaf2bf-5a5b-4d57-929a-da1ef7ff0e1b

📥 Commits

Reviewing files that changed from the base of the PR and between 6103be5 and f9ec954.

📒 Files selected for processing (6)
  • test/ui-e2e/.auth/setup.ts
  • test/ui-e2e/global.setup.ts
  • test/ui-e2e/run-ui-tests.sh
  • test/ui-e2e/src/pages/LoginPage.ts
  • test/ui-e2e/tests/ha-login.spec.ts
  • test/ui-e2e/tests/resource-tree.spec.ts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • argoproj-labs/argocd-operator (manual)

Comment thread test/ui-e2e/tests/ha-login.spec.ts Outdated
Comment thread test/ui-e2e/tests/ha-login.spec.ts Outdated
@trdoyle81
trdoyle81 force-pushed the GITOPS-102920-Login-With-HA branch from f9ec954 to 1cd2f7e Compare July 21, 2026 09:51

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test/ui-e2e/tests/ha-login.spec.ts`:
- Around line 58-72: Update the test.afterAll cleanup hook to wait for every
HA-related resource to finish rolling back, including the redis-ha statefulset,
redis-ha-haproxy, openshift-gitops-server, and dex-server, mirroring the
beforeAll checks. Add an explicit hook timeout covering the combined patch and
wait operations, while preserving the existing cleanup error handling and
success message.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: b7ca0596-0444-4584-94c8-372c23e57c79

📥 Commits

Reviewing files that changed from the base of the PR and between f9ec954 and 1cd2f7e.

📒 Files selected for processing (5)
  • test/ui-e2e/.auth/setup.ts
  • test/ui-e2e/run-ui-tests.sh
  • test/ui-e2e/src/pages/LoginPage.ts
  • test/ui-e2e/tests/ha-login.spec.ts
  • test/ui-e2e/tests/resource-tree.spec.ts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • argoproj-labs/argocd-operator (manual)
🚧 Files skipped from review as they are similar to previous changes (4)
  • test/ui-e2e/tests/resource-tree.spec.ts
  • test/ui-e2e/src/pages/LoginPage.ts
  • test/ui-e2e/.auth/setup.ts
  • test/ui-e2e/run-ui-tests.sh

Comment thread test/ui-e2e/tests/ha-login.spec.ts Outdated
Signed-off-by: Triona Doyle <tekton@example.com>
@trdoyle81
trdoyle81 force-pushed the GITOPS-102920-Login-With-HA branch from 1cd2f7e to 2c94e1f Compare July 21, 2026 11:06

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
test/ui-e2e/tests/ha-login.spec.ts (1)

70-75: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Do not treat deletion timeouts as successful cleanup.

A stuck StatefulSet deletion throws after 300s, is swallowed here, skips the HAProxy wait, and still logs a restored cluster. Wait for both resources independently; ignore only confirmed NotFound responses and rethrow timeouts/API failures.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/ui-e2e/tests/ha-login.spec.ts` around lines 70 - 75, Update the cleanup
try/catch block to wait for the StatefulSet and HAProxy deployment
independently, so failure of the first wait does not skip the second. In the
cleanup logic, ignore only confirmed NotFound deletion responses; rethrow
timeout and other API errors, and only log the cluster as restored after both
resources have been handled successfully.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test/ui-e2e/tests/ha-login.spec.ts`:
- Line 19: Add a finite timeout to both execSync oc patch calls in
test/ui-e2e/tests/ha-login.spec.ts at lines 19 and 63, using the execSync
options so unavailable API servers cannot block the Playwright worker
indefinitely; preserve the existing patch commands and inherited stdio behavior.

---

Duplicate comments:
In `@test/ui-e2e/tests/ha-login.spec.ts`:
- Around line 70-75: Update the cleanup try/catch block to wait for the
StatefulSet and HAProxy deployment independently, so failure of the first wait
does not skip the second. In the cleanup logic, ignore only confirmed NotFound
deletion responses; rethrow timeout and other API errors, and only log the
cluster as restored after both resources have been handled successfully.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 9c2bcc97-539e-4bbb-8b1f-b477fe317e6e

📥 Commits

Reviewing files that changed from the base of the PR and between 1cd2f7e and 2c94e1f.

📒 Files selected for processing (5)
  • test/ui-e2e/.auth/setup.ts
  • test/ui-e2e/run-ui-tests.sh
  • test/ui-e2e/src/pages/LoginPage.ts
  • test/ui-e2e/tests/ha-login.spec.ts
  • test/ui-e2e/tests/resource-tree.spec.ts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • argoproj-labs/argocd-operator (manual)
🚧 Files skipped from review as they are similar to previous changes (4)
  • test/ui-e2e/tests/resource-tree.spec.ts
  • test/ui-e2e/src/pages/LoginPage.ts
  • test/ui-e2e/run-ui-tests.sh
  • test/ui-e2e/.auth/setup.ts

Comment thread test/ui-e2e/tests/ha-login.spec.ts Outdated
Triona Doyle added 2 commits July 21, 2026 12:22
Signed-off-by: Triona Doyle <tekton@example.com>
Signed-off-by: Triona Doyle <tekton@example.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/cleanup Categorizes issue or PR as related to cleaning up code, process. kind/enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant