You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This suite validates the OpenShift GitOps Operator UI, focusing on Argo CD and SSO integration.
4
+
5
+
## Prerequisites
6
+
1.**Node.js** (v18+)
7
+
2.**OpenShift CLI (oc)**: Installed and in your PATH.
8
+
3.**Install Dependencies:** Navigate to this directory and install required packages:
9
+
```bash
10
+
cd test/ui-e2e
11
+
npm install
12
+
npx playwright install chromium
13
+
```
14
+
15
+
## Environment Variables
16
+
You must provide cluster credentials before running tests. You can either `export` these in your terminal (or pipeline), or create a `.env` file in the `test/ui-e2e` directory:
CLUSTER_USER=kubeadmin # (Optional) Defaults to kubeadmin
23
+
IDP=kube:admin # (Optional) Defaults to kube:admin
24
+
```
25
+
26
+
## Execution Commands
27
+
28
+
All commands use the `./run-ui-tests.sh` wrapper which handles auth, OpenShift token generation, and URL discovery. **Ensure you are in the `test/ui-e2e` directory.**
29
+
30
+
**Run All Tests (Headless):**
31
+
```bash
32
+
./run-ui-tests.sh --project=chromium
33
+
```
34
+
35
+
**Run All Tests (Headed + Trace):**
36
+
```bash
37
+
./run-ui-tests.sh --project=chromium --headed --reporter=list --trace on
38
+
```
39
+
40
+
**Run Single Test (Headed + Trace):**
41
+
```bash
42
+
./run-ui-tests.sh tests/login.spec.ts --project=chromium --headed --trace on
*`--headed`: Runs tests in a visible browser. Without this, tests run in "headless" mode (invisible background).
52
+
*`--reporter=list`: Changes console output to a clean, line-by-line list so you can see exactly which test is running in real-time.
53
+
*`--trace on`: Captures a full "recording" (DOM snapshots, network, actions) of the test for debugging.
54
+
55
+
## Architecture
56
+
57
+
**Global Setup:**
58
+
`.auth/setup.ts` logs into the OCP console to generate a reusable session (`storageState.json`). This prevents having to log in repeatedly for every test file.
59
+
60
+
**Spec Isolation:**
61
+
`login.spec.ts` explicitly clears session cookies to force a full SSO UI validation from a fresh state.
62
+
63
+
## Troubleshooting
64
+
65
+
***"Invalid login or password" during automated login:** If you are testing against multiple clusters sequentially, your terminal's `oc` CLI might be holding onto a sticky session from an older cluster. Run `oc logout` before running the bash script to force a clean authentication.
0 commit comments