Skip to content

feat(e2e): align Playwright versions and optimize pipeline configuration - #1484

Open
catastrophe-brandon wants to merge 9 commits into
RedHatInsights:masterfrom
catastrophe-brandon:master
Open

feat(e2e): align Playwright versions and optimize pipeline configuration#1484
catastrophe-brandon wants to merge 9 commits into
RedHatInsights:masterfrom
catastrophe-brandon:master

Conversation

@catastrophe-brandon

Copy link
Copy Markdown
  • Update @playwright/test and playwright to 1.58.2 to match pipeline image
  • Configure sequential test execution (fullyParallel: false, workers: 1)
  • Add baseURL and ignoreHTTPSErrors to playwright config
  • Add workspace-setup-script for dependency installation
  • Simplify e2e-tests-script to focus on test execution only

This aligns with HCC best practices and prevents version mismatch errors and race conditions in CI.

Description

description text...

RHCLOUDXXXX


Screenshots

Before:

After:


Checklist ☑️

  • PR only fixes one issue or story
  • Change reviewed for extraneous code
  • UI best practices adhered to
  • Commits squashed and meaningfully named
  • All PR checks pass locally (build, lint, test, E2E)

  • (Optional) QE: Needs QE attention (OUIA changed, perceived impact to tests, no test coverage)
  • (Optional) QE: Has been mentioned
  • (Optional) UX: Needs UX attention (end user UX modified, missing designs)
  • (Optional) UX: Has been mentioned

- Update @playwright/test and playwright to 1.58.2 to match pipeline image
- Configure sequential test execution (fullyParallel: false, workers: 1)
- Add baseURL and ignoreHTTPSErrors to playwright config
- Add workspace-setup-script for dependency installation
- Simplify e2e-tests-script to focus on test execution only

This aligns with HCC best practices and prevents version mismatch errors
and race conditions in CI.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 11a0b7dc-6254-4ac2-a1f1-96a2da0a68e5

📥 Commits

Reviewing files that changed from the base of the PR and between 3127a89 and c28bc75.

📒 Files selected for processing (1)
  • .tekton/sources-ui-pull-request.yaml
💤 Files with no reviewable changes (1)
  • .tekton/sources-ui-pull-request.yaml

Summary by CodeRabbit

  • Tests
    • Upgraded Playwright to v1.60.0, moved to the standard test runner, added centralized authenticated test setup with a shared session, and constrained tests to a single worker for stability
  • Documentation
    • Updated Playwright docs and examples to use the new authentication utilities and the PLAYWRIGHT_BASE_URL env var
  • Chores
    • CI/test pipeline streamlined (prep step added) and local Playwright auth files are now ignored in .gitignore

Walkthrough

Migrate Playwright auth to shared globalSetup from @redhat-cloud-services/playwright-test-auth, upgrade Playwright to v1.60.0, move install/setup to Tekton workspace step, force single-worker execution, add storageState and baseURL, and update tests/docs to use standard test API and auth utilities.

Changes

Playwright Test Authentication Refactor

Layer / File(s) Summary
Dependency updates and CI workspace setup
.gitignore, package.json, .tekton/sources-ui-pull-request.yaml
Added playwright/.auth to .gitignore; bumped @playwright/test and playwright to ^1.60.0 and added @redhat-cloud-services/playwright-test-auth; Tekton pipeline runs npm ci in a workspace-setup-script, updates the Playwright image to mcr.microsoft.com/playwright:v1.60.0-jammy, and removes the in-task Playwright install command.
Playwright runner and globalSetup
playwright.config.js
Set fullyParallel: false and workers: 1; added globalSetup: require.resolve('@redhat-cloud-services/playwright-test-auth/global-setup'); configured use with baseURL (from PLAYWRIGHT_BASE_URL), ignoreHTTPSErrors: true, and storageState: 'playwright/.auth/user.json'.
Test migration and docs updates
playwright/integrations.spec.js, playwright/README.md
Replaced local authTest fixture usage with { test, expect } from @playwright/test, call disableCookiePrompt(page) before navigation, rely on globalSetup for auth; README updated to use PLAYWRIGHT_BASE_URL, remove fixtures.js examples, and document auth utilities and certificate troubleshooting changes.

🎯 4 (Complex) | ⏱️ ~45 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description lacks required sections. The author-provided content precedes the template and omits issue tracking links, screenshots, and most checklist items, leaving the template largely unfilled. Fill out the required Description section with impacted UI links and RHCLOUDXXXX issue reference; complete the Checklist items and optional QE/UX notifications.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: aligning Playwright versions and optimizing the pipeline configuration for E2E testing.
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.

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

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

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

catastrophe-brandon and others added 6 commits June 5, 2026 13:25
- Install @redhat-cloud-services/playwright-test-auth for global authentication
- Configure globalSetup to authenticate once before all tests
- Add storageState to reuse authenticated session across tests
- Simplify test files to use standard test fixture instead of custom authTest
- Remove ~70 lines of custom authentication logic from fixtures.js
- Add playwright/.auth to .gitignore to protect session files

Benefits:
- Faster test execution (authenticate once vs per-test)
- Consistency with other HCC frontend repos
- Session sharing across all tests
- Reduced maintenance burden

The shared package handles authentication automatically using E2E_USER
and E2E_PASSWORD environment variables (already configured in Konflux).

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Updated playwright package from ^1.58.2 to ^1.60.0 to match @playwright/test version, resolving version mismatch.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Updated globalSetup to use require.resolve() for proper module resolution from node_modules.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Update E2E pipeline Docker image from v1.58.2 to v1.60.0 to match the Playwright packages installed in package.json.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Use disableCookiePrompt from @redhat-cloud-services/playwright-test-auth package instead of maintaining a duplicate implementation. The shared package already provides the same functionality.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Remove fixtures.js wrapper and import disableCookiePrompt directly from @redhat-cloud-services/playwright-test-auth in test files. Update documentation to reflect the simplified import pattern.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@catastrophe-brandon
catastrophe-brandon marked this pull request as ready for review June 5, 2026 18:56
@catastrophe-brandon
catastrophe-brandon requested a review from a team as a code owner June 5, 2026 18:56

@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 `@playwright/integrations.spec.js`:
- Line 1: The import members are out of ESLint's configured sort order; swap the
named imports so the exported identifiers are alphabetically ordered (change the
import of test and expect from '`@playwright/test`' to have expect before test) to
satisfy the linter rule for import member order.

In `@playwright/README.md`:
- Around line 61-64: The README still references legacy env and auth patterns:
replace all occurrences of APP_TEST_HOST_PORT with PLAYWRIGHT_BASE_URL and
update any example/test snippets using the old authTest.use() pattern to show
the new globalSetup-based auth flow (importing shared auth helpers like
disableCookiePrompt from `@redhat-cloud-services/playwright-test-auth` and relying
on globalSetup to set authenticated state), and ensure examples at the
previously mentioned locations reflect PLAYWRIGHT_BASE_URL and the globalSetup
usage instead of authTest.use().
🪄 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: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: fd05a6ec-7bc5-417a-af2b-87187aac526b

📥 Commits

Reviewing files that changed from the base of the PR and between 17bc543 and 18673aa.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (7)
  • .gitignore
  • .tekton/sources-ui-pull-request.yaml
  • package.json
  • playwright.config.js
  • playwright/README.md
  • playwright/fixtures.js
  • playwright/integrations.spec.js
💤 Files with no reviewable changes (1)
  • playwright/fixtures.js

Comment thread playwright/integrations.spec.js Outdated
Comment thread playwright/README.md
Replace legacy APP_TEST_HOST_PORT references with PLAYWRIGHT_BASE_URL and update outdated authTest.use() pattern to reflect current globalSetup approach. Fix import member order in integrations.spec.js to satisfy ESLint sort rule.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Comment thread playwright.config.js
Comment thread .tekton/sources-ui-pull-request.yaml Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants