CONSOLE-5283: Migrate dashboard Cypress tests to Playwright#16669
CONSOLE-5283: Migrate dashboard Cypress tests to Playwright#16669rhamilto wants to merge 1 commit into
Conversation
Migrate cluster-dashboard.cy.ts (8 tests) and project-dashboard.cy.ts (8 tests) to Playwright, completing the CONSOLE-5283 story. - Add data-test attributes alongside existing data-test-id on dashboard card components (details, status, inventory, utilization, launcher, resource-quotas, duration-select) for both cluster and project dashboards - Create ProjectDashboardPage page object and extend ClusterDashboardPage with locators for all dashboard card elements - Add createResourceQuota/deleteResourceQuota to KubernetesClient and ResourceQuota cleanup handling to the cleanup fixture - Delete original Cypress test files (including previously migrated insights-popup.cy.ts) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@rhamilto: This pull request references CONSOLE-5283 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. DetailsIn response to this:
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. |
WalkthroughMigrates cluster and project dashboard e2e coverage from Cypress to Playwright by deleting three Cypress test files and adding two new Playwright specs. Introduces ChangesDashboard e2e Cypress → Playwright migration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 13 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (13 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@frontend/e2e/tests/console/dashboards/project-dashboard.spec.ts`:
- Line 5: The namespace constant is using only Date.now() for uniqueness, which
can result in collisions when tests run in parallel across multiple workers.
Enhance the uniqueness of the namespace variable by appending an additional
random identifier such as a random number or UUID to the existing
timestamp-based string, ensuring that concurrent test runs generate distinct
namespaces and avoid interference.
🪄 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: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 40c29520-233d-43d6-a219-57ce5fcc1f3a
📒 Files selected for processing (19)
frontend/e2e/clients/kubernetes-client.tsfrontend/e2e/fixtures/cleanup-fixture.tsfrontend/e2e/pages/cluster-dashboard-page.tsfrontend/e2e/pages/project-dashboard-page.tsfrontend/e2e/tests/console/dashboards/cluster-dashboard.spec.tsfrontend/e2e/tests/console/dashboards/project-dashboard.spec.tsfrontend/packages/console-shared/src/components/dashboard/utilization-card/UtilizationDurationDropdown.tsxfrontend/packages/console-shared/src/components/dashboard/utilization-card/UtilizationItem.tsxfrontend/packages/integration-tests/tests/dashboards/cluster-dashboard.cy.tsfrontend/packages/integration-tests/tests/dashboards/insights-popup.cy.tsfrontend/packages/integration-tests/tests/dashboards/project-dashboard.cy.tsfrontend/public/components/dashboard/dashboards-page/cluster-dashboard/details-card.tsxfrontend/public/components/dashboard/dashboards-page/cluster-dashboard/inventory-card.tsxfrontend/public/components/dashboard/dashboards-page/cluster-dashboard/status-card.tsxfrontend/public/components/dashboard/project-dashboard/details-card.tsxfrontend/public/components/dashboard/project-dashboard/inventory-card.tsxfrontend/public/components/dashboard/project-dashboard/launcher-card.tsxfrontend/public/components/dashboard/project-dashboard/resource-quota-card.tsxfrontend/public/components/dashboard/project-dashboard/status-card.tsx
💤 Files with no reviewable changes (3)
- frontend/packages/integration-tests/tests/dashboards/project-dashboard.cy.ts
- frontend/packages/integration-tests/tests/dashboards/insights-popup.cy.ts
- frontend/packages/integration-tests/tests/dashboards/cluster-dashboard.cy.ts
| import { warmupSPA } from '../../../pages/base-page'; | ||
| import { ProjectDashboardPage } from '../../../pages/project-dashboard-page'; | ||
|
|
||
| const namespace = `test-project-dashboard-${Date.now()}`; |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
Avoid namespace collisions across concurrent runs.
Line 5 uses only Date.now() for uniqueness. Parallel workers/projects can still collide and share the same namespace, which can cause flaky create/delete interference.
Suggested fix
-const namespace = `test-project-dashboard-${Date.now()}`;
+const namespace = `test-project-dashboard-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const namespace = `test-project-dashboard-${Date.now()}`; | |
| const namespace = `test-project-dashboard-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`; |
🤖 Prompt for 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.
In `@frontend/e2e/tests/console/dashboards/project-dashboard.spec.ts` at line 5,
The namespace constant is using only Date.now() for uniqueness, which can result
in collisions when tests run in parallel across multiple workers. Enhance the
uniqueness of the namespace variable by appending an additional random
identifier such as a random number or UUID to the existing timestamp-based
string, ensuring that concurrent test runs generate distinct namespaces and
avoid interference.
|
/retest |
|
@rhamilto: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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. |
|
/tech debt |
|
/verified by CI |
|
@rhamilto: This PR has been marked as verified by DetailsIn response to this:
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. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fsgreco, rhamilto The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Analysis / Root cause:
CONSOLE-5283 — Migrate console e2e dashboard tests from Cypress to Playwright.
Solution description:
Migrate
cluster-dashboard.cy.ts(8 tests) andproject-dashboard.cy.ts(8 tests) to Playwright.data-testattributes alongside existingdata-test-idon dashboard card components (details, status, inventory, utilization, launcher, resource-quotas, duration-select) for both cluster and project dashboardsProjectDashboardPagepage object and extendClusterDashboardPagewith locators for all dashboard card elementscreateResourceQuota/deleteResourceQuotatoKubernetesClientandResourceQuotacleanup handling to the cleanup fixtureinsights-popup.cy.ts)Screenshots / screen recording:
Test setup:
Requires a running OpenShift cluster with
e2e/.envconfigured.Test cases:
npx playwright test --project=console frontend/e2e/tests/console/dashboards/— all 16 tests should passBrowser conformance:
Additional info:
N/A
Summary by CodeRabbit
Tests
Chores