Skip to content

WIP: CONSOLE-5280: Migrate cluster-settings Cypress tests to Playwright#16444

Draft
rhamilto wants to merge 1 commit into
openshift:mainfrom
rhamilto:CONSOLE-5280
Draft

WIP: CONSOLE-5280: Migrate cluster-settings Cypress tests to Playwright#16444
rhamilto wants to merge 1 commit into
openshift:mainfrom
rhamilto:CONSOLE-5280

Conversation

@rhamilto
Copy link
Copy Markdown
Member

@rhamilto rhamilto commented May 14, 2026

Summary

Migrates all 25 cluster-settings E2E tests from Cypress to Playwright, replacing legacy data-test-id selectors with modern data-test selectors while maintaining backward compatibility.

Changes

Test Migration (25 tests)

  • ✅ Migrated 10 cluster-settings test files from Cypress to Playwright
  • ✅ Created page objects: ClusterSettingsPage, OAuthPage, DetailsPage, OverviewPage
  • ✅ Self-contained tests with route mocking for ClusterVersion data
  • ✅ Moved shared mocks to e2e/mocks/

Selector Migration (backward compatible)

  • Added data-test alongside existing data-test-id in all cluster-settings components
  • Updated kebab menus, modals, IDP tables, navigation elements
  • All Playwright page objects use getByTestId() for modern selectors
  • Legacy data-test-id preserved for backward compatibility

Guided Tour Auto-Disable

  • Set navigator.userAgent = 'ConsoleIntegrationTestEnvironment' via fixtures/index.ts addInitScript()
  • Detect INTEGRATION_TEST flag in tour-context.ts to auto-complete guided tour
  • Works in all modes: headless, headed, and --ui
  • Removed all manual tour dismissal code from page objects
  • This completely eliminated test flakiness caused by tour modal interference

ESLint Configuration

  • Disabled testing-library/prefer-screen-queries rule for e2e/**/*.ts files
  • This rule is for React Testing Library (Jest), not Playwright E2E tests
  • Prevents false positives on valid Playwright page.getByTestId() usage

Test Results

✅ 25/25 tests passing (100% success rate)

All tests pass reliably in parallel execution:

  • ✅ cluster-settings.spec.ts (5 tests)
  • ✅ channel-modal.spec.ts (1 test)
  • ✅ managed-control-plane.spec.ts (1 test)
  • ✅ oauth.spec.ts (8 tests)
  • ✅ update-in-progress.spec.ts (1 test)
  • ✅ update-modal.spec.ts (1 test)
  • ✅ updates-graph.spec.ts (1 test)
  • ✅ upgradeable-false.spec.ts (1 test)
  • ✅ upstream-modal.spec.ts (1 test)
  • ✅ worker-mcp-paused.spec.ts (1 test)

Test execution time: 1.8 minutes for all 25 tests (7 workers in parallel)

Deleted Files

  • All Cypress test files in packages/integration-tests/tests/cluster-settings/
  • Cypress view files: cluster-settings.ts, oauth.ts

Related

  • Jira: CONSOLE-5280
  • Part of ongoing Cypress → Playwright migration effort

🤖 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 May 14, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

openshift-ci-robot commented May 14, 2026

@rhamilto: This pull request references CONSOLE-5280 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 all 25 cluster-settings E2E tests from Cypress to Playwright, replacing legacy data-test-id selectors with modern data-test selectors while maintaining backward compatibility.

Changes

Test Migration (25 tests)

  • ✅ Migrated 10 cluster-settings test files from Cypress to Playwright
  • ✅ Created page objects: ClusterSettingsPage, OAuthPage, DetailsPage, OverviewPage
  • ✅ Self-contained tests with route mocking for ClusterVersion data
  • ✅ Moved shared mocks to e2e/mocks/

Selector Migration (backward compatible)

  • Added data-test alongside existing data-test-id in all cluster-settings components
  • Updated kebab menus, modals, IDP tables, navigation elements
  • All Playwright page objects use getByTestId() for modern selectors
  • Legacy data-test-id preserved for backward compatibility

Guided Tour Auto-Disable

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

Test Results

21/25 tests passing (4 failures are test isolation/timing issues, not selector problems)

Passing:

  • managed-control-plane.spec.ts ✅
  • upgradeable-false.spec.ts ✅
  • upstream-modal.spec.ts ✅
  • worker-mcp-paused.spec.ts ✅
  • oauth.spec.ts (7/8 tests) ✅
  • cluster-settings.spec.ts (5/5 tests) ✅

Flaky (pass in isolation, fail in parallel):

  • channel-modal.spec.ts (timing)
  • oauth.spec.ts (1 test - timing)
  • update-in-progress.spec.ts (timing)
  • update-modal.spec.ts (timing)

Related

  • Jira: CONSOLE-5280
  • Part of ongoing Cypress → Playwright migration effort

🤖 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 14, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 14, 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 openshift-ci Bot added component/core Related to console core functionality component/shared Related to console-shared approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/cypress Related to Cypress e2e integration testing labels May 14, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 14, 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

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>
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/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