Skip to content

WIP: CONSOLE-5281: Migrate Cypress E2E tests to Playwright (batch 2)#16454

Draft
rhamilto wants to merge 2 commits into
openshift:mainfrom
rhamilto:CONSOLE-5281
Draft

WIP: CONSOLE-5281: Migrate Cypress E2E tests to Playwright (batch 2)#16454
rhamilto wants to merge 2 commits into
openshift:mainfrom
rhamilto:CONSOLE-5281

Conversation

@rhamilto
Copy link
Copy Markdown
Member

@rhamilto rhamilto commented May 15, 2026

Includes changes from #16444

Summary

  • Migrates CRD extensions, events, favorites, i18n pseudolocalization, alertmanager, and OLM create-namespace Cypress tests to Playwright
  • Adds data-test attributes alongside existing data-test-id attributes on utilization cards, text filter, and console select items to enable getByTestId usage
  • Adds createPod and deletePod methods to KubernetesClient
  • Adds AlertmanagerPage page object and navigation helpers

Tests migrated (19 Cypress → 19 Playwright)

Cypress source Playwright output
integration-tests/tests/crd-extensions/console-cli-download.cy.ts e2e/tests/console/crd-extensions/console-cli-download.spec.ts
integration-tests/tests/crd-extensions/console-external-log-link.cy.ts e2e/tests/console/crd-extensions/console-external-log-link.spec.ts
integration-tests/tests/crd-extensions/console-link.cy.ts e2e/tests/console/crd-extensions/console-link.spec.ts
integration-tests/tests/crd-extensions/console-notification.cy.ts e2e/tests/console/crd-extensions/console-notification.spec.ts
integration-tests/tests/crd-extensions/console-yaml-sample.cy.ts e2e/tests/console/crd-extensions/console-yaml-sample.spec.ts
integration-tests/tests/events/events.cy.ts e2e/tests/console/events/events.spec.ts
integration-tests/tests/favorite/favorite-option.cy.ts e2e/tests/console/favorites/favorites.spec.ts
integration-tests/tests/i18n/pseudolocalization.cy.ts e2e/tests/console/i18n/pseudolocalization.spec.ts
olm/integration-tests/tests/create-namespace.cy.ts e2e/tests/olm/create-namespace.spec.ts
integration-tests/tests/alertmanager/alertmanager.cy.ts e2e/tests/console/cluster-settings/alertmanager/alertmanager.spec.ts
integration-tests/tests/alertmanager/receivers/email.cy.ts e2e/tests/console/cluster-settings/alertmanager/receivers/email.spec.ts
integration-tests/tests/alertmanager/receivers/pagerduty.cy.ts e2e/tests/console/cluster-settings/alertmanager/receivers/pagerduty.spec.ts
integration-tests/tests/alertmanager/receivers/slack.cy.ts e2e/tests/console/cluster-settings/alertmanager/receivers/slack.spec.ts
integration-tests/tests/alertmanager/receivers/webhook.cy.ts e2e/tests/console/cluster-settings/alertmanager/receivers/webhook.spec.ts

Source component changes

  • text-filter.tsx: Added data-test="item-filter" alongside data-test-id
  • console-select.tsx: Changed shared data-test="console-select-item" to unique data-test={console-select-item-${itemKey}}
  • utilization-card.tsx (3 files): Added data-test="utilization-card" alongside data-test-id
  • useCRDAdditionalPrinterColumns.ts: Fixed react-hooks/exhaustive-deps lint warning
  • ExternalLink.tsx: Added data-test attribute

Test plan

  • All migrated Playwright tests pass locally
  • CI passes
  • No orphaned resources after test runs

🤖 Generated with Claude Code

rhamilto and others added 2 commits May 15, 2026 08:17
Migrates all 25 cluster-settings E2E tests from Cypress to Playwright,
replacing legacy data-test-id selectors with modern data-test selectors.

Test Migration:
- Migrated 10 cluster-settings test files to Playwright
- Created page objects: ClusterSettingsPage, OAuthPage, DetailsPage, OverviewPage
- Moved mocks to e2e/mocks/
- Self-contained tests with route mocking for ClusterVersion data
- Added unique data-test attributes for dynamic elements

Selector Updates (backward compatible):
- Added data-test alongside data-test-id in all components
- Updated kebab menus, modal components, IDP tables, and navigation elements
- All page objects use getByTestId() for modern selectors

Guided Tour Auto-Disable:
- Set navigator.userAgent via fixtures/index.ts addInitScript()
- Detect INTEGRATION_TEST flag in tour-context.ts to auto-complete tour
- Works in all modes: headless, headed, and --ui
- Removed all manual tour dismissal code from page objects

Test Results: 21/25 passing (4 failures are test isolation issues)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
… tests to Playwright

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label May 15, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

openshift-ci-robot commented May 15, 2026

@rhamilto: This pull request references CONSOLE-5281 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:

Summary

  • Migrates CRD extensions, events, favorites, i18n pseudolocalization, alertmanager, and OLM create-namespace Cypress tests to Playwright
  • Adds data-test attributes alongside existing data-test-id attributes on utilization cards, text filter, and console select items to enable getByTestId usage
  • Adds createPod and deletePod methods to KubernetesClient
  • Adds AlertmanagerPage page object and navigation helpers

Tests migrated (19 Cypress → 19 Playwright)

Cypress source Playwright output
integration-tests/tests/crd-extensions/console-cli-download.cy.ts e2e/tests/console/crd-extensions/console-cli-download.spec.ts
integration-tests/tests/crd-extensions/console-external-log-link.cy.ts e2e/tests/console/crd-extensions/console-external-log-link.spec.ts
integration-tests/tests/crd-extensions/console-link.cy.ts e2e/tests/console/crd-extensions/console-link.spec.ts
integration-tests/tests/crd-extensions/console-notification.cy.ts e2e/tests/console/crd-extensions/console-notification.spec.ts
integration-tests/tests/crd-extensions/console-yaml-sample.cy.ts e2e/tests/console/crd-extensions/console-yaml-sample.spec.ts
integration-tests/tests/events/events.cy.ts e2e/tests/console/events/events.spec.ts
integration-tests/tests/favorite/favorite-option.cy.ts e2e/tests/console/favorites/favorites.spec.ts
integration-tests/tests/i18n/pseudolocalization.cy.ts e2e/tests/console/i18n/pseudolocalization.spec.ts
olm/integration-tests/tests/create-namespace.cy.ts e2e/tests/olm/create-namespace.spec.ts
integration-tests/tests/alertmanager/alertmanager.cy.ts e2e/tests/console/cluster-settings/alertmanager/alertmanager.spec.ts
integration-tests/tests/alertmanager/receivers/email.cy.ts e2e/tests/console/cluster-settings/alertmanager/receivers/email.spec.ts
integration-tests/tests/alertmanager/receivers/pagerduty.cy.ts e2e/tests/console/cluster-settings/alertmanager/receivers/pagerduty.spec.ts
integration-tests/tests/alertmanager/receivers/slack.cy.ts e2e/tests/console/cluster-settings/alertmanager/receivers/slack.spec.ts
integration-tests/tests/alertmanager/receivers/webhook.cy.ts e2e/tests/console/cluster-settings/alertmanager/receivers/webhook.spec.ts

Source component changes

  • text-filter.tsx: Added data-test="item-filter" alongside data-test-id
  • console-select.tsx: Changed shared data-test="console-select-item" to unique data-test={console-select-item-${itemKey}}
  • utilization-card.tsx (3 files): Added data-test="utilization-card" alongside data-test-id
  • useCRDAdditionalPrinterColumns.ts: Fixed react-hooks/exhaustive-deps lint warning
  • ExternalLink.tsx: Added data-test attribute

Test plan

  • All migrated Playwright tests pass locally
  • CI passes
  • No orphaned resources after test runs

🤖 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 added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 15, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 15, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 15, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rhamilto

The full list of commands accepted by this bot can be found here.

The pull request process is described 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

@openshift-ci openshift-ci Bot added component/core Related to console core functionality component/dashboard Related to dashboard approved Indicates a PR has been approved by an approver from all required OWNERS files. component/olm Related to OLM component/shared Related to console-shared kind/cypress Related to Cypress e2e integration testing labels May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. component/core Related to console core functionality component/dashboard Related to dashboard component/olm Related to OLM component/shared Related to console-shared do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. kind/cypress Related to Cypress e2e integration testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants