The readme for the e2e framework is located here The contribution guidelines are here The example and bootstraps to create tests are here
This directory contains scripts to run e2e tests locally against an OpenShift cluster.
Before running, ensure you have:
- Podman installed and running with at least 8GB RAM and 4 CPUs
- oc CLI installed and logged into your OpenShift cluster (
oc login) - Vault CLI installed (for fetching secrets)
- jq installed (for JSON parsing)
- Access to the OpenShift CI vault (
https://vault.ci.openshift.org/ui/vault/secrets/kv/list/selfservice/rhdh-qe/) - if you don't have access, reach out to @rhdh-qe in the team-rhdh channel.
# Install tools via Homebrew
brew install podman jq rsync openshift-cli
# Install HashiCorp Vault (requires tap)
brew tap hashicorp/tap
brew install hashicorp/tap/vault
# Setup Podman machine (first time only)
podman machine init --memory 8192 --cpus 4
podman machine startInstall podman, oc, kubectl, vault, jq, rsync, and curl using your distribution's package manager.
You need an OpenShift cluster to run e2e tests. Here are your options:
Use the cluster-bot Slack app to request an ephemeral cluster. Send a direct message to the cluster-bot app:
launch 4.18 aws
The bot will provide login credentials once the cluster is ready (usually within a few minutes).
You can use the rhdh-test-instance to get an ephemeral cluster.
⚠️ Warning: This option is not recommended for frequent testing as it may interfere with existing PR test runs due to cluster claim conflicts. Use occasionally or for one-off testing only.
See the rhdh-test-instance README for usage instructions.
Use any OpenShift cluster you have access to. Simply login with oc login before running the local test runner.
| Script | Description |
|---|---|
local-run.sh |
Main script - deploys RHDH to cluster and optionally runs tests |
container-init.sh |
Runs inside the container (called by local-run.sh) |
local-test-setup.sh |
Sets up environment for running tests locally in headed mode |
cd e2e-tests
./local-run.shFollow the interactive prompts to select:
- Run mode: Deploy only (default, for headed debugging) or Deploy and run tests
- Job type: OCP Helm PR tests, Nightly tests, Operator tests, etc.
- Image type:
- Downstream (
quay.io/rhdh/rhdh-hub-rhel9):next,latest, or release-specific tag - PR image (
quay.io/rhdh-community/rhdh): Enter PR number
- Downstream (
After the container finishes, you're back on your host with the cluster still accessible.
For automation or quick runs, use CLI flags to skip interactive prompts:
# Test a PR image
./local-run.sh --pr 4023 --skip-tests
# Deploy downstream next image
./local-run.sh --repo rhdh/rhdh-hub-rhel9 --tag next --skip-tests
# Use a custom registry
./local-run.sh --registry registry.redhat.io --repo rhdh/rhdh-hub-rhel9 --tag latest --skip-tests
# Full flags
./local-run.sh -j pull-ci-redhat-developer-rhdh-main-e2e-ocp-helm -R registry.redhat.io -r rhdh/rhdh-hub-rhel9 -t next -s| Flag | Description |
|---|---|
-j, --job |
Job name |
-R, --registry |
Image registry (default: quay.io) |
-r, --repo |
Image repository (e.g., rhdh/rhdh-hub-rhel9) |
-t, --tag |
Image tag (e.g., next, latest, 1.5) |
-p, --pr |
PR number (sets repo to rhdh-community/rhdh, tag to pr-<number>) |
-s, --skip-tests |
Deploy only, skip running tests |
-h, --help |
Show help message |
This is the recommended approach for debugging tests - you can see the browser UI, step through tests, and interact with the application.
cd e2e-tests
./local-run.sh
# Select "Deploy only" (the default option)The container will deploy RHDH and exit. You'll see next steps printed in the terminal.
cd e2e-tests
source local-test-setup.sh # For Showcase tests
# or: source local-test-setup.sh rbac # For RBAC testsyarn install
yarn playwright test --headed# Run all tests
yarn playwright test --headed
# Run a specific test file (use --project to specify which project)
yarn playwright test playwright/e2e/plugins/quick-access-and-tech-radar.spec.ts --headed --project=showcase
# Run RBAC tests (requires RBAC URL - use: source local-test-setup.sh rbac)
yarn playwright test playwright/e2e/plugins/rbac/rbac.spec.ts --headed --project=showcase-rbac
# Run tests matching a pattern (by test name)
yarn playwright test --headed -g "guest user"
yarn playwright test --headed -g "catalog"
# Run with trace for debugging
yarn playwright test --headed --trace on
# Run in UI mode (interactive debugging with time-travel)
yarn playwright test --ui
# View the last test report
npx playwright show-report .local-test/rhdh/.local-test/artifact_dir/showcaseTip: UI mode (
--ui) opens an interactive browser where you can:
- See all tests and run them individually
- Watch tests execute in real-time
- Step through test actions with time-travel debugging
- Inspect DOM snapshots at each step
- View console logs and network requests
Specs declare @tag markers via Playwright's native
test tags — the tag
option on test / test.describe (e.g.
test.describe("Smoke test", { tag: "@smoke" }, () => { ... })). This keeps the
tag out of the test title, so names stay stable for historical reporting while
Playwright's --grep / --grep-invert filters still select tests by tag,
letting CI or a local run target a subset.
| Tag | Meaning |
|---|---|
@layer3-equivalent |
A UI behavior in this spec also has a sibling Layer 3 component test (in packages/app). |
@smoke |
Fast, high-signal check suitable to run on every PR. |
@ga-plugin |
Exercises a generally-available (GA) plugin. |
@non-ga-plugin |
Exercises a tech-preview / dev-preview (non-GA) plugin. |
@blocked |
Blocked by a known issue; tests are skipped with a Jira reference. |
# Run only smoke-tagged tests
yarn playwright test --project=showcase --grep "@smoke"
# Run everything except specs that already have a Layer 3 equivalent
yarn playwright test --project=showcase --grep-invert "@layer3-equivalent"In CI, set the PLAYWRIGHT_GREP environment variable (consumed by
.ci/pipelines/lib/testing.sh) to apply the same filter to a job, e.g.
PLAYWRIGHT_GREP='@smoke'.
Note:
@layer3-equivalentmarks overlap with Layer 3 coverage; it does not remove the E2E spec. Whether to retire any duplicated E2E coverage is a separate decision tracked elsewhere.
All job types are supported as long as you're logged into the target cluster (oc login or kubectl login).
| Option | JOB_NAME Pattern | Description |
|---|---|---|
| 1 | *pull*ocp*helm* |
OCP Helm PR tests |
| 2 | *ocp*helm*nightly* |
OCP Helm Nightly tests |
| 3 | *ocp*operator*nightly* |
OCP Operator Nightly tests |
| 4 | *ocp*helm*upgrade*nightly* |
OCP Helm Upgrade tests |
| 5 | *ocp*operator*auth-providers*nightly* |
Auth Providers tests |
| 6 | Custom | Enter your own JOB_NAME |
Other supported patterns (use Custom option):
*aks*helm*nightly*/*aks*operator*nightly*- Azure AKS*eks*helm*nightly*/*eks*operator*nightly*- AWS EKS*gke*helm*nightly*/*gke*operator*nightly*- Google GKE*osd-gcp*helm*nightly*/*osd-gcp*operator*nightly*- OSD GCP
| Option | Repository | Description |
|---|---|---|
| 1 | rhdh-community/rhdh |
Community image (default) |
| 2 | rhdh/rhdh-hub-rhel9 |
Red Hat official image |
| 3 | Custom | Enter your own repository |
| Option | Tag | Description |
|---|---|---|
| 1 | next |
Latest development build (default) |
| 2 | latest |
Latest stable release |
| 3 | pr-<number> |
PR-specific build (e.g., pr-4020) |
| 4 | Custom | Enter your own tag |
Test changes from PR #4020 using the community image:
cd e2e-tests
./local-run.sh
# Select:
# Job: 1 (OCP Helm PR tests)
# Repo: 1 (rhdh-community/rhdh)
# Tag: 3 (PR image) → Enter: 4020
# Run: 1 (Deploy and run tests)Deploy and then run specific tests in headed mode:
cd e2e-tests
./local-run.sh
# Select:
# Job: 1 (OCP Helm PR tests)
# Repo: 1 (rhdh-community/rhdh)
# Tag: 1 (next)
# Run: 2 (Deploy only)
# Keep container running, open new terminal:
cd e2e-tests
source local-test-setup.sh
yarn install
yarn playwright test --headed -g "guest user"Test the official Red Hat image:
cd e2e-tests
./local-run.sh
# Select:
# Job: 2 (OCP Helm Nightly)
# Repo: 2 (rhdh/rhdh-hub-rhel9)
# Tag: 1 (next)
# Run: 1 (Deploy and run tests)Deploy and run RBAC tests in headed mode:
cd e2e-tests
./local-run.sh
# Select: Deploy only
# New terminal:
cd e2e-tests
source local-test-setup.sh rbac # Use RBAC URL
yarn install
yarn playwright test --headed --project=showcase-rbacFirst login to your cluster, then run:
# Login to your cluster
az aks get-credentials --resource-group myRG --name myAKS
# or: aws eks update-kubeconfig --name myEKS
# or: gcloud container clusters get-credentials myGKE
cd e2e-tests
./local-run.sh
# Select:
# Job: 6 (Custom) → Enter: periodic-ci-aks-helm-nightly
# Repo: 1 (rhdh-community/rhdh)
# Tag: 1 (next)
# Run: 1 (Deploy and run tests)cd e2e-tests
source local-test-setup.sh
yarn install
yarn playwright test playwright/e2e/plugins/quick-access-and-tech-radar.spec.ts --headed --project=showcasecd e2e-tests
source local-test-setup.sh
yarn install
yarn playwright test --headed --trace on -g "catalog"cd e2e-tests
source local-test-setup.sh
yarn install
yarn playwright test --uiThis opens an interactive UI where you can select individual tests, watch them run in real-time, and step through actions with time-travel debugging.
-
local-run.sh:
- Pulls the e2e-runner container image
- Logs into Vault (OIDC) and gets secrets token
- Creates a service account on the cluster with cluster-admin role
- Copies repo to
e2e-tests/.local-test/rhdh(keeps original clean) - Runs container with all credentials
-
container-init.sh (inside container):
- Installs Vault CLI if needed
- Fetches secrets from Vault and writes to
/tmp/secrets/ - Logs into OpenShift cluster
- Sets up environment variables
- Runs deployment via
openshift-ci-tests.sh - If tests are skipped, outputs URLs and saves config
-
local-test-setup.sh (for headed tests):
- Reads config from
e2e-tests/.local-test/rhdh/.local-test/config.env - Exports secrets as environment variables (not stored on disk)
- Gets fresh K8S_CLUSTER_TOKEN from cluster
- Sets BASE_URL for Playwright
- Reads config from
After running local-test-setup.sh, these variables are set:
| Variable | Description |
|---|---|
BASE_URL |
URL of the deployed RHDH instance (Playwright uses this as the test base URL) |
SHOWCASE_URL |
Legacy name for the standard RHDH deployment URL (same value as BASE_URL for showcase tests) |
SHOWCASE_RBAC_URL |
Legacy name for the RBAC deployment URL |
K8S_CLUSTER_URL |
OpenShift API server URL |
K8S_CLUSTER_TOKEN |
Service account token (48-hour duration) |
JOB_NAME |
Selected job name |
IMAGE_REGISTRY |
Image registry (default: quay.io) |
IMAGE_REPO |
Image repository (fallback: QUAY_REPO) |
TAG_NAME |
Image tag |
| Plus all secrets from Vault | (exported with -, ., / replaced by _) |
Note:
BASE_URLis the canonical Playwright base URL for the RHDH instance under test.SHOWCASE_URLandSHOWCASE_RBAC_URLare legacy names retained bylocal-test-setup.shand deployment scripts;local-test-setup.shsetsBASE_URLfrom the appropriate legacy URL. Yarn scripts such asyarn showcase,yarn showcase-rbac, andyarn test:stabilitystill use theshowcasePlaywright project name for historical reasons.
Test artifacts are saved to e2e-tests/.local-test/rhdh/.local-test/:
artifact_dir/- Test artifacts, screenshots, tracesshared_dir/- Shared data between test runsconfig.env- Configuration for local-test-setup.sh
The container will drop into an interactive shell for debugging. Check logs, run commands, and investigate.
Run ./local-run.sh first with "Deploy only" option to create the config.
Run oc login before running local-test-setup.sh.
The script verifies the image exists on quay.io before proceeding (verification is skipped for non-quay registries). For PR images, ensure the PR build has completed.
- Secrets are fetched from Vault and exported as environment variables at runtime (not stored in files locally)
- K8S_CLUSTER_TOKEN is generated fresh each time (not stored)
- The repo is copied to
e2e-tests/.local-test/rhdhso the original stays clean - Service account tokens have a 48-hour duration
The script at .ci/pipelines/trigger-nightly-job.sh triggers RHDH nightly ProwJobs via the OpenShift CI Gangway REST API.
ocCLI installedcurlandjqinstalled- Access to the OpenShift CI cluster (SSO login via browser)
# Basic trigger (default image):
.ci/pipelines/trigger-nightly-job.sh --job periodic-ci-redhat-developer-rhdh-main-e2e-ocp-helm-nightly
# Trigger with a specific image:
.ci/pipelines/trigger-nightly-job.sh \
--job periodic-ci-redhat-developer-rhdh-main-e2e-ocp-helm-nightly \
--image-registry registry.redhat.io \
--image-repo rhdh/rhdh-hub-rhel9 \
--tag 1.9-123
# Dry-run (print the curl command without executing):
.ci/pipelines/trigger-nightly-job.sh \
--job periodic-ci-redhat-developer-rhdh-main-e2e-ocp-helm-nightly \
--dry-run| Flag | Description |
|---|---|
-j, --job |
(required) Full ProwJob name to trigger |
-I, --image-registry |
Override the image registry (default: quay.io) |
-q, --image-repo |
Override the image repository (requires --tag) |
-t, --tag |
Override the image tag |
-o, --org |
Override the GitHub org (default: redhat-developer) |
-r, --repo |
Override the GitHub repo name (default: rhdh) |
-b, --branch |
Override the branch name |
-S, --send-alerts |
Send Slack alerts (default: alerts are skipped) |
-n, --dry-run |
Print the curl command without executing |
The script uses a dedicated kubeconfig (~/.config/openshift-ci/kubeconfig) to avoid interfering with the current cluster context. If not logged in or the token is expired, it opens a browser for SSO login.
A Claude Code command is available at .claude/commands/trigger-nightly-job.md that provides an interactive, AI-guided workflow for triggering nightly jobs. It:
- Fetches available jobs from Prow and presents them in a table
- Maps natural language descriptions to job names (e.g., "ocp helm" or "azure operator")
- Checks for shared cluster constraints (GKE and OSD-GCP jobs share clusters)
- Fetches available image tags from Quay when needed
- Builds the command and asks for confirmation before executing
To use it, run the /trigger-nightly-job command in Claude Code or OpenCode.
The full list of configured nightly jobs is at: https://prow.ci.openshift.org/configured-jobs/redhat-developer/rhdh
Job name pattern: periodic-ci-redhat-developer-rhdh-{BRANCH}-e2e-{PLATFORM}-{METHOD}-nightly