feat(e2e): align Playwright versions and optimize pipeline configuration - #1484
feat(e2e): align Playwright versions and optimize pipeline configuration#1484catastrophe-brandon wants to merge 9 commits into
Conversation
- 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>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
Summary by CodeRabbit
WalkthroughMigrate Playwright auth to shared globalSetup from ChangesPlaywright Test Authentication Refactor
🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
- 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>
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (7)
.gitignore.tekton/sources-ui-pull-request.yamlpackage.jsonplaywright.config.jsplaywright/README.mdplaywright/fixtures.jsplaywright/integrations.spec.js
💤 Files with no reviewable changes (1)
- playwright/fixtures.js
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>
This aligns with HCC best practices and prevents version mismatch errors and race conditions in CI.
Description
description text...
RHCLOUDXXXX
Screenshots
Before:
After:
Checklist ☑️