Skip to content

CONSOLE-5197: Add Playwright E2E test infrastructure for Prow/CI#16374

Open
vikram-raj wants to merge 1 commit into
openshift:mainfrom
vikram-raj:prow-playwright-e2e
Open

CONSOLE-5197: Add Playwright E2E test infrastructure for Prow/CI#16374
vikram-raj wants to merge 1 commit into
openshift:mainfrom
vikram-raj:prow-playwright-e2e

Conversation

@vikram-raj
Copy link
Copy Markdown
Member

@vikram-raj vikram-raj commented Apr 29, 2026

Analysis / Root cause:
OpenShift Console currently uses Cypress for E2E testing in Prow/CI. This PR adds Playwright E2E testing infrastructure for Prow/CI, providing an alternative E2E testing framework that can run in the CI environment.

Solution description:
Added Playwright E2E testing infrastructure for OpenShift CI/Prow, mirroring the existing Cypress test-prow-e2e.sh workflow.

Files Added

test-prow-playwright-e2e.sh (Prow/CI wrapper at repository root):

  • Mirrors test-prow-e2e.sh workflow for consistency
  • Handles kubeadmin password securely (set +x to avoid logging)
  • Gets BRIDGE_BASE_ADDRESS from cluster using oc CLI
  • Runs contrib/create-user.sh for test user setup
  • Supports three scenarios: e2e, release, and smoke
  • Smoke scenario uses Playwright's native --project=smoke flag
  • Includes same CSP validation (test-puppeteer-csp) as Cypress Prow script
  • Delegates to frontend/integration-tests/test-playwright-e2e.sh for test execution

frontend/integration-tests/test-playwright-e2e.sh (Frontend test runner):

  • Run from frontend/ directory, similar to test-cypress.sh
  • Supports -c flag to run contrib/create-user.sh before tests
  • Sets up environment variables: BRIDGE_BASE_ADDRESS, BRIDGE_BASE_PATH, WEB_CONSOLE_URL
  • Validates running from correct directory
  • Checks for oc availability when auto-detecting cluster URL
  • Uses Playwright's native --project flag for test selection (e.g., --project=helm, --project=smoke)
  • Delegates all Playwright arguments directly to the Playwright CLI
  • Installs Playwright if not present (yarn install check)

Usage Examples

Prow/CI (from repository root):

./test-prow-playwright-e2e.sh e2e
./test-prow-playwright-e2e.sh smoke

Frontend (from frontend/ directory):

./integration-tests/test-playwright-e2e.sh --project=helm
./integration-tests/test-playwright-e2e.sh --project=smoke
./integration-tests/test-playwright-e2e.sh -c --project=dev-console
./integration-tests/test-playwright-e2e.sh --help    # Shows Playwright's native help

Design Decisions

  • Uses Playwright's native --project flag: Rather than implementing custom package selection, the script delegates to Playwright's built-in project selection, reducing maintenance overhead and aligning with standard Playwright workflows
  • Mirrors Cypress patterns: Follows the established test-prow-e2e.sh patterns for consistency and familiarity
  • Simple delegation: Scripts focus on environment setup and delegate test execution to Playwright CLI

Screenshots / screen recording:
N/A - Infrastructure/tooling change only

Test setup:
Prerequisites to test this PR:

  1. Have an OpenShift cluster running
  2. Be logged in with oc CLI, or set BRIDGE_BASE_ADDRESS
  3. Install Playwright in frontend directory:
    cd frontend
    yarn add -D @playwright/test
    yarn playwright install

Test cases:

  • Run ./frontend/integration-tests/test-playwright-e2e.sh --project=smoke to test with smoke project
  • Run ./frontend/integration-tests/test-playwright-e2e.sh -c to verify user creation works
  • Run ./test-prow-playwright-e2e.sh e2e from repo root (Prow/CI entry point)
  • Run ./test-prow-playwright-e2e.sh smoke from repo root
  • Verify WEB_CONSOLE_URL is set correctly from BRIDGE_BASE_ADDRESS + BRIDGE_BASE_PATH
  • Verify script discovers cluster console URL correctly from oc CLI when BRIDGE_BASE_ADDRESS unset
  • Verify script fails gracefully when oc is not available and BRIDGE_BASE_ADDRESS unset
  • Verify kubeadmin password is not logged (set +x / set -x works correctly)
  • Verify CSP validation runs after tests (test-puppeteer-csp)

Browser conformance:
N/A - Infrastructure/tooling change (scripts support any browser Playwright supports)

Additional info:

  • Scripts mirror existing Cypress infrastructure for consistency
  • Playwright's native --project flag provides flexibility for test selection
  • Prow script uses set -exuo pipefail for command tracing (matches Cypress pattern)
  • Frontend script uses set -euo pipefail (no tracing)
  • Clear error messages guide users to correct usage
  • Scripts are marked executable (chmod +x)
  • Comprehensive usage documentation in script header comments

Reviewers and assignees:

🤖 Generated with Claude Code

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Apr 29, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

openshift-ci-robot commented Apr 29, 2026

@vikram-raj: This pull request references CONSOLE-5197 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Analysis / Root cause:
OpenShift Console currently uses Cypress for E2E testing in Prow/CI. This PR adds infrastructure to support Playwright E2E tests, providing an alternative test framework option with different capabilities and workflow.

Solution description:
Added two new bash scripts to support Playwright E2E testing in both local development and CI environments:

  1. frontend/integration-tests/test-playwright-e2e.sh - Main test runner script
  • Automatically discovers cluster console URL from oc CLI or uses BRIDGE_BASE_ADDRESS
  • Handles kubeadmin password for login flows (from KUBEADMIN_PASSWORD_FILE or INSTALLER_DIR)
  • Supports running from subdirectories within frontend/ with -d flag
  • Flexible Playwright test argument pass-through
  • Security-conscious password handling (prevents logging)
  • Path validation to prevent directory traversal
  1. test-prow-playwright-e2e.sh - Prow/CI entrypoint wrapper
  • Wraps test-playwright-e2e.sh for CI environments
  • Handles user creation via contrib/create-user.sh (htpasswd IDP)
  • Supports multiple test scenarios: e2e, release, smoke
  • Includes CSP validation check (test-puppeteer-csp)
  • Follows same patterns as existing Cypress Prow tests

The scripts follow bash best practices:

  • set -euo pipefail for robust error handling
  • Proper variable quoting throughout
  • Clear error messages and validation
  • Comprehensive usage documentation

Screenshots / screen recording:
N/A - Infrastructure/tooling change only

Test setup:
Prerequisites to test this PR:

  1. Have an OpenShift cluster running
  2. Be logged in with oc CLI, or set BRIDGE_BASE_ADDRESS
  3. Install Playwright in your test directory:
cd frontend/packages/your-plugin
yarn add -D @playwright/test
yarn playwright install
  1. Create a playwright.config.ts in the test directory

Test cases:

  • Run ./frontend/integration-tests/test-playwright-e2e.sh from frontend directory
  • Verify script discovers cluster console URL correctly
  • Test with -d packages/my-plugin to run from subdirectory
  • Test with -c flag to verify user creation works
  • Run ./test-prow-playwright-e2e.sh e2e from repo root
  • Verify CSP check runs after tests complete
  • Verify kubeadmin password handling (no password in logs)

Browser conformance:
N/A - Infrastructure/tooling change (scripts support any browser Playwright supports)

Additional info:

  • Both scripts include comprehensive usage documentation in header comments
  • Scripts are marked executable (chmod +x)
  • Follows same operational patterns as existing test-cypress.sh
  • Second commit fixes a shell tracing issue found during review

Reviewers and assignees:

🤖 Generated with Claude Code

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci Bot requested review from rhamilto and sanketpathak April 29, 2026 14:20
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 29, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: vikram-raj
Once this PR has been reviewed and has the lgtm label, please assign rhamilto 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
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 29, 2026

📝 Walkthrough

Walkthrough

Two new executable shell scripts are introduced to standardize Playwright E2E test execution. test-playwright-e2e.sh serves as the primary entrypoint, handling environment configuration (kubeadmin credentials, base address derivation via oc), CLI argument parsing (-d for install directory, -c for user creation), dependency installation, and test execution via playwright test. test-prow-playwright-e2e.sh wraps this for CI/Prow environments, setting strict Bash options, populating cluster credentials and console URL, provisioning test users, and supporting scenario-based test selection (e2e, release, smoke). Together these establish a consistent interface for E2E test execution across local and CI contexts.

🚥 Pre-merge checks | ✅ 12
✅ Passed checks (12 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly references the Jira issue (CONSOLE-5197) and accurately describes the main change: adding Playwright E2E test infrastructure for Prow/CI environments.
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.
Stable And Deterministic Test Names ✅ Passed PR adds bash shell scripts for Playwright E2E testing infrastructure, not Go Ginkgo test definitions, making the Ginkgo test validation check inapplicable.
Test Structure And Quality ✅ Passed This PR adds bash shell scripts for Playwright E2E testing infrastructure, not Go Ginkgo tests, making the Ginkgo-focused custom check inapplicable.
Microshift Test Compatibility ✅ Passed PR adds only bash shell scripts for Playwright E2E test infrastructure, not new Ginkgo Go e2e tests. The check applies exclusively to new Ginkgo e2e tests with declarations like It(), Describe(), Context(), When().
Single Node Openshift (Sno) Test Compatibility ✅ Passed This PR does not add any Ginkgo e2e tests. The changes consist solely of two executable bash scripts that serve as test infrastructure and CI orchestration for Playwright tests in the frontend. These are shell scripts that configure environments, parse arguments, and invoke test runners — they contain no Go code and do not define Ginkgo test cases.
Topology-Aware Scheduling Compatibility ✅ Passed PR contains only test infrastructure bash scripts with no Kubernetes resource definitions, deployment manifests, operator code, or scheduling constraints, making the custom check inapplicable.
Ote Binary Stdout Contract ✅ Passed OTE Binary Stdout Contract applies only to Go test binaries; this PR adds only Bash shell scripts for Playwright E2E orchestration, not Go test code.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PR adds shell scripts for Playwright test orchestration, not Ginkgo e2e tests. Check only applies to Go-based Ginkgo tests with IPv4 assumptions.
Description check ✅ Passed PR description is comprehensive, well-structured, and addresses all template sections with clear analysis, solution details, test cases, and setup instructions.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (3)
frontend/integration-tests/test-playwright-e2e.sh (1)

49-54: Declare and assign separately to avoid masking return values.

Per ShellCheck SC2155: combining export with command substitution masks the exit status of cat. While the file existence check mitigates risk, separating declaration and assignment is the more robust pattern.

♻️ Proposed fix
 if [ -z "${BRIDGE_KUBEADMIN_PASSWORD:-}" ]; then
   pass_file="${KUBEADMIN_PASSWORD_FILE:-${INSTALLER_DIR}/auth/kubeadmin-password}"
   if [ -f "$pass_file" ]; then
-    export BRIDGE_KUBEADMIN_PASSWORD="$(cat "$pass_file")"
+    BRIDGE_KUBEADMIN_PASSWORD="$(cat "$pass_file")"
+    export BRIDGE_KUBEADMIN_PASSWORD
   fi
 fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/integration-tests/test-playwright-e2e.sh` around lines 49 - 54, The
existing combined export with command substitution masks cat's exit status;
change the BRIDGE_KUBEADMIN_PASSWORD assignment to be done in two steps: set a
local variable (e.g., tmp_pass) by running cat "$pass_file" and check its exit
status if desired, then export BRIDGE_KUBEADMIN_PASSWORD="$tmp_pass". Update the
block that computes pass_file (using KUBEADMIN_PASSWORD_FILE and INSTALLER_DIR)
and replace the single-line export with this two-step assignment so
BRIDGE_KUBEADMIN_PASSWORD, pass_file, KUBEADMIN_PASSWORD_FILE and INSTALLER_DIR
are used but command substitution is not performed inside export.
test-prow-playwright-e2e.sh (2)

26-27: Minor inconsistency in parameter expansion operators.

Line 26 uses :- (substitute only) while line 27 uses := (set and substitute). This inconsistency could cause subtle issues if INSTALLER_DIR is referenced later without a default. For consistency with line 26 and the pattern in test-playwright-e2e.sh, consider using :-.

♻️ Proposed fix for consistency
 ARTIFACT_DIR=${ARTIFACT_DIR:-/tmp/artifacts}
-INSTALLER_DIR=${INSTALLER_DIR:=${ARTIFACT_DIR}/installer}
+INSTALLER_DIR=${INSTALLER_DIR:-${ARTIFACT_DIR}/installer}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test-prow-playwright-e2e.sh` around lines 26 - 27, The assignment uses
inconsistent parameter expansion: change INSTALLER_DIR from using := to :- to
avoid assigning into the environment (use the same pattern as ARTIFACT_DIR);
specifically update the INSTALLER_DIR expansion so
INSTALLER_DIR=${INSTALLER_DIR:-${ARTIFACT_DIR}/installer} (referencing the
INSTALLER_DIR and ARTIFACT_DIR variables) to ensure it only substitutes a
default without mutating the variable.

29-33: Declare and assign separately to avoid masking return values.

Per ShellCheck SC2155: combining export with command substitution masks the exit status of cat and oc get. While set -e will still catch downstream failures, separating declaration and assignment makes error attribution clearer.

Additionally, unlike test-playwright-e2e.sh, this script doesn't guard against a missing password file—if it's absent, the script fails immediately. This is likely intentional for CI, but worth documenting explicitly.

♻️ Proposed fix
 # don't log kubeadmin-password
 set +x
-export BRIDGE_KUBEADMIN_PASSWORD="$(cat "${KUBEADMIN_PASSWORD_FILE:-${INSTALLER_DIR}/auth/kubeadmin-password}")"
+BRIDGE_KUBEADMIN_PASSWORD="$(cat "${KUBEADMIN_PASSWORD_FILE:-${INSTALLER_DIR}/auth/kubeadmin-password}")"
+export BRIDGE_KUBEADMIN_PASSWORD
 set -x
-export BRIDGE_BASE_ADDRESS="$(oc get consoles.config.openshift.io cluster -o jsonpath='{.status.consoleURL}')"
+BRIDGE_BASE_ADDRESS="$(oc get consoles.config.openshift.io cluster -o jsonpath='{.status.consoleURL}')"
+export BRIDGE_BASE_ADDRESS
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test-prow-playwright-e2e.sh` around lines 29 - 33, Split the combined
export+command-substitution assignments so the exit status of cat/oc is not
masked: first assign BRIDGE_KUBEADMIN_PASSWORD="$(cat
"${KUBEADMIN_PASSWORD_FILE:-${INSTALLER_DIR}/auth/kubeadmin-password"}")" to a
variable (without export), check the command exit status or test file existence
(e.g. guard that the kubeadmin password file exists) and then export
BRIDGE_KUBEADMIN_PASSWORD; do the same for BRIDGE_BASE_ADDRESS by assigning the
output of oc get consoles.config.openshift.io ... to a variable, verify the
command succeeded, and then export BRIDGE_BASE_ADDRESS; reference
BRIDGE_KUBEADMIN_PASSWORD, KUBEADMIN_PASSWORD_FILE, INSTALLER_DIR,
BRIDGE_BASE_ADDRESS and the oc get consoles.config.openshift.io call when
locating the lines to change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@frontend/integration-tests/test-playwright-e2e.sh`:
- Around line 49-54: The existing combined export with command substitution
masks cat's exit status; change the BRIDGE_KUBEADMIN_PASSWORD assignment to be
done in two steps: set a local variable (e.g., tmp_pass) by running cat
"$pass_file" and check its exit status if desired, then export
BRIDGE_KUBEADMIN_PASSWORD="$tmp_pass". Update the block that computes pass_file
(using KUBEADMIN_PASSWORD_FILE and INSTALLER_DIR) and replace the single-line
export with this two-step assignment so BRIDGE_KUBEADMIN_PASSWORD, pass_file,
KUBEADMIN_PASSWORD_FILE and INSTALLER_DIR are used but command substitution is
not performed inside export.

In `@test-prow-playwright-e2e.sh`:
- Around line 26-27: The assignment uses inconsistent parameter expansion:
change INSTALLER_DIR from using := to :- to avoid assigning into the environment
(use the same pattern as ARTIFACT_DIR); specifically update the INSTALLER_DIR
expansion so INSTALLER_DIR=${INSTALLER_DIR:-${ARTIFACT_DIR}/installer}
(referencing the INSTALLER_DIR and ARTIFACT_DIR variables) to ensure it only
substitutes a default without mutating the variable.
- Around line 29-33: Split the combined export+command-substitution assignments
so the exit status of cat/oc is not masked: first assign
BRIDGE_KUBEADMIN_PASSWORD="$(cat
"${KUBEADMIN_PASSWORD_FILE:-${INSTALLER_DIR}/auth/kubeadmin-password"}")" to a
variable (without export), check the command exit status or test file existence
(e.g. guard that the kubeadmin password file exists) and then export
BRIDGE_KUBEADMIN_PASSWORD; do the same for BRIDGE_BASE_ADDRESS by assigning the
output of oc get consoles.config.openshift.io ... to a variable, verify the
command succeeded, and then export BRIDGE_BASE_ADDRESS; reference
BRIDGE_KUBEADMIN_PASSWORD, KUBEADMIN_PASSWORD_FILE, INSTALLER_DIR,
BRIDGE_BASE_ADDRESS and the oc get consoles.config.openshift.io call when
locating the lines to change.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 377bba5c-95b1-42b3-bcf9-a9d6a82af102

📥 Commits

Reviewing files that changed from the base of the PR and between 5846f6a and 4114813.

📒 Files selected for processing (2)
  • frontend/integration-tests/test-playwright-e2e.sh
  • test-prow-playwright-e2e.sh
📜 Review details
🧰 Additional context used
🪛 Shellcheck (0.11.0)
frontend/integration-tests/test-playwright-e2e.sh

[warning] 52-52: Declare and assign separately to avoid masking return values.

(SC2155)

test-prow-playwright-e2e.sh

[warning] 31-31: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 33-33: Declare and assign separately to avoid masking return values.

(SC2155)

🔇 Additional comments (6)
frontend/integration-tests/test-playwright-e2e.sh (4)

1-43: LGTM on script header and initialization.

The documentation is thorough, strict bash options (set -euo pipefail) are correctly applied, and the frontend/ working directory enforcement is a sensible guard. The NO_COLOR handling for CI environments aligns with the existing Cypress test patterns.


56-72: LGTM on BRIDGE_BASE_ADDRESS derivation.

Good defensive checks: verifying oc availability before use, validating the query result is non-empty, and providing actionable error messages. The JSONPath query for consoles.config.openshift.io/cluster is correct for fetching the console URL.


74-93: LGTM on argument parsing and dependency handling.

The getopts handling is clean, the usage message covers the expected interface, and the conditional yarn install guard avoids redundant installs. The create-user.sh invocation correctly uses REPO_ROOT for the absolute path.


95-120: LGTM on path validation and Playwright execution.

The directory traversal prevention (lines 102-105) is well-implemented: it resolves the path canonically before checking containment, handling both exact matches and subdirectories. The fallback to frontend/node_modules for the Playwright binary is a pragmatic approach for monorepo subdirectory packages. Using exec to replace the shell process is efficient.

test-prow-playwright-e2e.sh (2)

35-51: LGTM on user creation and scenario dispatch.

The create-user.sh invocation is safe since the script is idempotent (it checks for existing htpasswd secret). Scenario handling is clean with explicit error on unknown values. The e2e/tests/smoke path argument for the smoke scenario correctly passes to playwright test.


53-55: LGTM on CSP check and directory cleanup.

The NO_SANDBOX=true yarn test-puppeteer-csp follows the established pattern from Cypress Prow tests. The popd correctly balances the earlier pushd.

@vikram-raj
Copy link
Copy Markdown
Member Author

/cc @jhadvig

@openshift-ci openshift-ci Bot requested a review from jhadvig April 29, 2026 14:58
Comment thread frontend/integration-tests/test-playwright-e2e.sh Outdated
#
# Usage (always from repo frontend/):
# ./integration-tests/test-playwright-e2e.sh [playwright test arguments...]
# ./integration-tests/test-playwright-e2e.sh -d packages/my-plugin/e2e tests/smoke.spec.ts
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we're going to set up a Playwright project for each package, so we won't need this option. The script will pass --project=my-plugin to Playwright.

maybe we can replace this option with -n <project-name>

Comment thread frontend/integration-tests/test-playwright-e2e.sh Outdated
Comment thread frontend/integration-tests/test-playwright-e2e.sh Outdated
Comment thread frontend/integration-tests/test-playwright-e2e.sh Outdated
Comment thread frontend/integration-tests/test-playwright-e2e.sh
@vikram-raj vikram-raj force-pushed the prow-playwright-e2e branch 2 times, most recently from 2289d0f to 1fb3066 Compare May 4, 2026 12:13
@vikram-raj vikram-raj requested a review from stefanonardo May 4, 2026 12:14
Comment thread frontend/package.json Outdated
Comment on lines +26 to +27
ARTIFACT_DIR=${ARTIFACT_DIR:-/tmp/artifacts}
INSTALLER_DIR=${INSTALLER_DIR:=${ARTIFACT_DIR}/installer}
Copy link
Copy Markdown
Contributor

@stefanonardo stefanonardo May 5, 2026

Choose a reason for hiding this comment

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

should we export them and remove them from the other file?

@vikram-raj vikram-raj force-pushed the prow-playwright-e2e branch from 1fb3066 to b25bc59 Compare May 5, 2026 15:15
@vikram-raj vikram-raj requested a review from stefanonardo May 5, 2026 15:25
Comment thread frontend/integration-tests/test-playwright-e2e.sh Outdated
Comment thread frontend/integration-tests/test-playwright-e2e.sh Outdated
Comment thread frontend/integration-tests/test-playwright-e2e.sh Outdated
Add Playwright E2E testing infrastructure for OpenShift CI/Prow,
mirroring the existing Cypress test-prow-e2e.sh workflow.

**Files Added**:
- test-prow-playwright-e2e.sh: Prow/CI wrapper at repository root
- frontend/integration-tests/test-playwright-e2e.sh: Frontend test runner

**Prow Script (test-prow-playwright-e2e.sh)**:
- Mirrors test-prow-e2e.sh workflow (kubeadmin password, BRIDGE_BASE_ADDRESS, create-user)
- Supports e2e, release, and smoke scenarios
- Smoke scenario uses Playwright's native --project=smoke flag
- Includes same CSP validation (test-puppeteer-csp) as Cypress Prow script
- Delegates to frontend/integration-tests/test-playwright-e2e.sh for test execution

**Frontend Script (frontend/integration-tests/test-playwright-e2e.sh)**:
- Run from frontend/ directory, similar to test-cypress.sh
- Supports -c flag to run contrib/create-user.sh before tests
- Sets up environment variables: BRIDGE_BASE_ADDRESS, BRIDGE_BASE_PATH, WEB_CONSOLE_URL
- Validates running from correct directory and checks for oc availability
- Uses Playwright's native --project flag for test selection (e.g., --project=helm)
- Delegates all Playwright arguments directly to the Playwright CLI

**Usage Examples**:
  # Prow/CI (from repository root)
  ./test-prow-playwright-e2e.sh e2e
  ./test-prow-playwright-e2e.sh smoke

  # Frontend (from frontend/ directory)
  ./integration-tests/test-playwright-e2e.sh --project=helm
  ./integration-tests/test-playwright-e2e.sh --project=smoke
  ./integration-tests/test-playwright-e2e.sh -c --project=dev-console

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@vikram-raj vikram-raj force-pushed the prow-playwright-e2e branch from b25bc59 to 31d9209 Compare May 11, 2026 15:33
@vikram-raj vikram-raj requested a review from stefanonardo May 11, 2026 15:36
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 11, 2026

@vikram-raj: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants