Skip to content

CONSOLE-5241: Migrate knative-ci.feature Cypress tests to Playwright#16658

Open
mvinkler wants to merge 1 commit into
openshift:mainfrom
mvinkler:CONSOLE-5241
Open

CONSOLE-5241: Migrate knative-ci.feature Cypress tests to Playwright#16658
mvinkler wants to merge 1 commit into
openshift:mainfrom
mvinkler:CONSOLE-5241

Conversation

@mvinkler

@mvinkler mvinkler commented Jun 22, 2026

Copy link
Copy Markdown

Summary

Migrates the knative CI smoke test (knative-ci.feature) from Cypress Gherkin to Playwright and removes the original Cypress file. This is the per-PR CI test that runs via e2e-gcp-console — the remaining 30 knative feature files (nightly only) will follow in separate PRs.

Changes

Test Migration (16 tests)

  • Migrated 16 automatable scenarios from knative-ci.feature to knative-ci.spec.ts
  • 8 @manual / @broken-test scenarios dropped (not migrated)
  • Tests run in serial mode (test.describe.configure({ mode: 'serial' })) — matching the Cypress testIsolation: false sequential workflow
  • Created page objects: TopologyKnativePage, AddFlowPage, AdminEventingPage
  • Created knative.setup.ts — installs Serverless operator, creates KnativeServing/KnativeEventing CRs

Cypress Removal

  • Deleted features/e2e/knative-ci.feature
  • Removed test-cypress-knative-headless script from package.json and test-cypress.sh
  • Nightly scripts (test-cypress-headless-all, test-cypress-knative-nightly) and local dev runner kept for remaining 30 feature files

Selector Migration (backward compatible)

  • Added data-test alongside existing legacy attributes (data-test-action, data-test-id, data-test-dropdown-menu) in shared React components
  • Components updated: ActionMenuItem, ActionMenuContent, MultiTabListPage, list-page, actions-menu, kebab, AppSection, ImportSampleForm, FormFooter, ActionGroupWithIcons, ApplicationSelector, EditApplicationModal, TopologyPageToolbar, GitSection, filter-toolbar, labels-modal, tags, delete-modal
  • All Playwright page objects use getByTestId() with fallback to legacy selectors

Test Results

16/16 tests passing (serial mode, 4.6 min)

  • KN-05-TC04: Create knative workload from Git
  • KN-02-TC02: Edit labels modal details
  • KN-02-TC17: Edit Annotation modal details
  • KA-01-TC01: Create new Event Source via Ping Source
  • KA-01-TC02: Create new Channel via default channel type
  • KE-05-TC01: Create Broker using Form view
  • Add Subscription to channel
  • KN-02-TC08: Update service to new application group
  • KN-01-TC12: Delete Revision not possible for single revision
  • Create Revision for existing knative Service
  • KN-02-TC10: Set traffic distribution >100%
  • KN-02-TC11: Set traffic distribution <100%
  • KE-05-TC11: Delete Broker
  • KE-06-TC16: Delete Channel
  • KE-01-TC03: Delete event source
  • KN-02-TC16: Delete service

Screenshots / screen recording

Test setup

Requires OpenShift cluster with Serverless operator (installed automatically by knative.setup.ts).

Browser conformance

  • Chrome

Related

Summary by CodeRabbit

Release Notes

  • Tests

    • Added Playwright page objects and a Knative CI smoke-test suite covering imports, eventing flows, and topology interactions.
    • Improved automated UI selector coverage for more reliable test targeting across Knative and core UI components.
  • Chores

    • Updated Playwright configuration to include dedicated Knative setup provisioning.
    • Adjusted Cypress/headless test scripts and removed obsolete test scenarios/scripts.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jun 22, 2026
@openshift-ci-robot

openshift-ci-robot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

@mvinkler: This pull request references CONSOLE-5241 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 the knative CI smoke test (knative-ci.feature) from Cypress Gherkin to Playwright and removes the original Cypress file. This is the per-PR CI test that runs via e2e-gcp-console — the remaining 30 knative feature files (nightly only) will follow in separate PRs.

Changes

Test Migration (16 tests)

  • Migrated 16 automatable scenarios from knative-ci.feature to knative-ci.spec.ts
  • 8 @manual / @broken-test scenarios dropped (not migrated)
  • Tests run in serial mode (test.describe.configure({ mode: 'serial' })) — matching the Cypress testIsolation: false sequential workflow
  • Created page objects: TopologyKnativePage, AddFlowPage, AdminEventingPage
  • Created knative.setup.ts — installs Serverless operator, creates KnativeServing/KnativeEventing CRs

Cypress Removal

  • Deleted features/e2e/knative-ci.feature
  • Removed test-cypress-knative-headless script from package.json and test-cypress.sh
  • Nightly scripts (test-cypress-headless-all, test-cypress-knative-nightly) and local dev runner kept for remaining 30 feature files

Selector Migration (backward compatible)

  • Added data-test alongside existing legacy attributes (data-test-action, data-test-id, data-test-dropdown-menu) in shared React components
  • Components updated: ActionMenuItem, ActionMenuContent, MultiTabListPage, list-page, actions-menu, kebab, AppSection, ImportSampleForm, FormFooter, ActionGroupWithIcons, ApplicationSelector, EditApplicationModal, TopologyPageToolbar, GitSection, filter-toolbar, labels-modal, tags, delete-modal
  • All Playwright page objects use getByTestId() with fallback to legacy selectors

Test Results

16/16 tests passing (serial mode, 4.6 min)

  • KN-05-TC04: Create knative workload from Git
  • KN-02-TC02: Edit labels modal details
  • KN-02-TC17: Edit Annotation modal details
  • KA-01-TC01: Create new Event Source via Ping Source
  • KA-01-TC02: Create new Channel via default channel type
  • KE-05-TC01: Create Broker using Form view
  • Add Subscription to channel
  • KN-02-TC08: Update service to new application group
  • KN-01-TC12: Delete Revision not possible for single revision
  • Create Revision for existing knative Service
  • KN-02-TC10: Set traffic distribution >100%
  • KN-02-TC11: Set traffic distribution <100%
  • KE-05-TC11: Delete Broker
  • KE-06-TC16: Delete Channel
  • KE-01-TC03: Delete event source
  • KN-02-TC16: Delete service

Screenshots / screen recording

Test setup

Requires OpenShift cluster with Serverless operator (installed automatically by knative.setup.ts).

Browser conformance

  • Chrome

Related

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 requested review from fsgreco and spadgett June 22, 2026 09:32
@openshift-ci openshift-ci Bot added the component/core Related to console core functionality label Jun 22, 2026
@openshift-ci

openshift-ci Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mvinkler
Once this PR has been reviewed and has the lgtm label, please assign vojtechszocs for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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 the component/dev-console Related to dev-console label Jun 22, 2026
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 58dc8e45-7e68-41d5-9015-5f3e2d99725f

📥 Commits

Reviewing files that changed from the base of the PR and between 2210b8c and f39cfac.

📒 Files selected for processing (28)
  • frontend/e2e/pages/knative/add-flow-page.ts
  • frontend/e2e/pages/knative/admin-eventing-page.ts
  • frontend/e2e/pages/knative/topology-knative-page.ts
  • frontend/e2e/setup/knative.setup.ts
  • frontend/e2e/tests/knative/serverless/knative-ci.spec.ts
  • frontend/integration-tests/test-cypress.sh
  • frontend/package.json
  • frontend/packages/console-shared/src/components/actions/menu/ActionMenuContent.tsx
  • frontend/packages/console-shared/src/components/actions/menu/ActionMenuItem.tsx
  • frontend/packages/console-shared/src/components/form-utils/ActionGroupWithIcons.tsx
  • frontend/packages/console-shared/src/components/form-utils/FormFooter.tsx
  • frontend/packages/console-shared/src/components/multi-tab-list/MultiTabListPage.tsx
  • frontend/packages/dev-console/src/components/import/ImportSampleForm.tsx
  • frontend/packages/dev-console/src/components/import/app/AppSection.tsx
  • frontend/packages/dev-console/src/components/import/git/GitSection.tsx
  • frontend/packages/knative-plugin/integration-tests/features/e2e/knative-ci.feature
  • frontend/packages/knative-plugin/integration-tests/package.json
  • frontend/packages/topology/src/components/dropdowns/ApplicationSelector.tsx
  • frontend/packages/topology/src/components/modals/EditApplicationModal.tsx
  • frontend/packages/topology/src/components/page/TopologyPageToolbar.tsx
  • frontend/playwright.config.ts
  • frontend/public/components/factory/list-page.tsx
  • frontend/public/components/filter-toolbar.tsx
  • frontend/public/components/modals/delete-modal.tsx
  • frontend/public/components/modals/labels-modal.tsx
  • frontend/public/components/modals/tags.tsx
  • frontend/public/components/utils/actions-menu.tsx
  • frontend/public/components/utils/kebab.tsx
💤 Files with no reviewable changes (4)
  • frontend/packages/knative-plugin/integration-tests/package.json
  • frontend/packages/knative-plugin/integration-tests/features/e2e/knative-ci.feature
  • frontend/integration-tests/test-cypress.sh
  • frontend/package.json
✅ Files skipped from review due to trivial changes (16)
  • frontend/packages/console-shared/src/components/form-utils/ActionGroupWithIcons.tsx
  • frontend/packages/dev-console/src/components/import/git/GitSection.tsx
  • frontend/packages/dev-console/src/components/import/app/AppSection.tsx
  • frontend/public/components/utils/actions-menu.tsx
  • frontend/packages/topology/src/components/page/TopologyPageToolbar.tsx
  • frontend/packages/topology/src/components/dropdowns/ApplicationSelector.tsx
  • frontend/public/components/factory/list-page.tsx
  • frontend/public/components/filter-toolbar.tsx
  • frontend/packages/dev-console/src/components/import/ImportSampleForm.tsx
  • frontend/packages/console-shared/src/components/actions/menu/ActionMenuContent.tsx
  • frontend/public/components/utils/kebab.tsx
  • frontend/packages/console-shared/src/components/form-utils/FormFooter.tsx
  • frontend/public/components/modals/tags.tsx
  • frontend/packages/console-shared/src/components/actions/menu/ActionMenuItem.tsx
  • frontend/public/components/modals/delete-modal.tsx
  • frontend/packages/topology/src/components/modals/EditApplicationModal.tsx
🚧 Files skipped from review as they are similar to previous changes (8)
  • frontend/playwright.config.ts
  • frontend/packages/console-shared/src/components/multi-tab-list/MultiTabListPage.tsx
  • frontend/public/components/modals/labels-modal.tsx
  • frontend/e2e/setup/knative.setup.ts
  • frontend/e2e/pages/knative/admin-eventing-page.ts
  • frontend/e2e/pages/knative/add-flow-page.ts
  • frontend/e2e/pages/knative/topology-knative-page.ts
  • frontend/e2e/tests/knative/serverless/knative-ci.spec.ts

Walkthrough

Migrates Knative CI smoke tests from Cypress/Gherkin to Playwright. Adds data-test attributes to shared UI components for test targeting, introduces three Playwright page-object classes (AddFlowPage, AdminEventingPage, TopologyKnativePage), implements a knative.setup.ts fixture that provisions the Serverless operator and Knative custom resources, registers the setup in playwright.config.ts, implements a comprehensive Playwright CI spec covering Git import, eventing resources, topology interactions, and deletion flows, and removes the legacy Cypress feature file and related test scripts.

Changes

Knative Playwright E2E Migration

Layer / File(s) Summary
Test selector attributes for E2E targeting
frontend/packages/dev-console/src/components/import/git/GitSection.tsx, frontend/packages/dev-console/src/components/import/app/AppSection.tsx, frontend/packages/dev-console/src/components/import/ImportSampleForm.tsx, frontend/packages/topology/src/components/dropdowns/ApplicationSelector.tsx, frontend/packages/topology/src/components/modals/EditApplicationModal.tsx, frontend/packages/topology/src/components/page/TopologyPageToolbar.tsx, frontend/public/components/modals/delete-modal.tsx, frontend/public/components/modals/labels-modal.tsx, frontend/public/components/modals/tags.tsx, frontend/public/components/utils/actions-menu.tsx, frontend/public/components/utils/kebab.tsx, frontend/public/components/factory/list-page.tsx, frontend/public/components/filter-toolbar.tsx, frontend/packages/console-shared/src/components/actions/menu/ActionMenuContent.tsx, frontend/packages/console-shared/src/components/actions/menu/ActionMenuItem.tsx, frontend/packages/console-shared/src/components/form-utils/ActionGroupWithIcons.tsx, frontend/packages/console-shared/src/components/form-utils/FormFooter.tsx, frontend/packages/console-shared/src/components/multi-tab-list/MultiTabListPage.tsx
Adds data-test attributes alongside existing data-test-id attributes on modal headers and cancel buttons, menu items (kebab, action menu, submenu), form fields (git URL, app name, component name input), and toolbar controls (view switcher, filter dropdown, create dropdown entries, reset/check icon buttons).
Knative page-object models for UI interaction
frontend/e2e/pages/knative/add-flow-page.ts, frontend/e2e/pages/knative/admin-eventing-page.ts, frontend/e2e/pages/knative/topology-knative-page.ts
Defines AddFlowPage with Git import, container image, serverless deployment, and Dockerfile strategy helpers including rate-limit fallback for builder image detection; AdminEventingPage with tab navigation and eventing UI locators; TopologyKnativePage with graph view, search, right-click context menus, side pane interaction, and sidebar actions menu.
Knative cluster provisioning and test project wiring
frontend/e2e/setup/knative.setup.ts, frontend/playwright.config.ts
knative.setup.ts installs OpenShift Serverless operator via subscription YAML (polling CSV status for Succeeded), applies KnativeServing and KnativeEventing manifests, and polls custom resources for Ready=True status. playwright.config.ts adds a knative-setup project depending on cluster-setup and wires the knative test project to depend on knative-setup.
Knative E2E test implementation
frontend/e2e/tests/knative/serverless/knative-ci.spec.ts
Comprehensive test suite covering Git import with optional builder image fallback, Edit labels/annotations modals, Eventing resource creation (Ping Source, Channel, Broker), Subscription wiring, application grouping updates, revision deletion guard, traffic distribution validation (>100 and <100), and deletion flows for all resource types with modal confirmation and topology verification.
Removal of legacy Cypress/Gherkin test infrastructure
frontend/packages/knative-plugin/integration-tests/features/e2e/knative-ci.feature, frontend/packages/knative-plugin/integration-tests/package.json, frontend/package.json, frontend/integration-tests/test-cypress.sh
Removes the legacy Gherkin feature file containing all Cypress scenarios, eliminates the test-cypress-knative-headless script from package.json files, and removes the headless execution path from the Cypress test runner script.

Sequence Diagram(s)

sequenceDiagram
  rect rgba(70, 130, 180, 0.5)
    Note over PlaywrightRunner,K8sAPI: Cluster Setup Phase
    PlaywrightRunner->>knative.setup.ts: execute knative-setup project
    knative.setup.ts->>K8sAPI: check ClusterServiceVersion<br/>in openshift-serverless
    alt CSV not at Succeeded phase
      knative.setup.ts->>K8sAPI: apply Serverless subscription YAML
      knative.setup.ts->>K8sAPI: poll CSV every 10s for Succeeded<br/>(5 min timeout)
    end
    knative.setup.ts->>K8sAPI: apply KnativeServing manifest
    knative.setup.ts->>K8sAPI: apply KnativeEventing manifest
    knative.setup.ts->>K8sAPI: poll KnativeServing<br/>status.conditions for Ready=True
    knative.setup.ts->>K8sAPI: poll KnativeEventing<br/>status.conditions for Ready=True
    knative.setup.ts-->>PlaywrightRunner: setup complete
  end
  rect rgba(60, 179, 113, 0.5)
    Note over Test,AdminEventingPage: Test Execution Phase
    Test->>AddFlowPage: navigateToAddPage(namespace)
    AddFlowPage->>AddFlowPage: clickImportFromGitCard()
    AddFlowPage->>AddFlowPage: enterGitUrl() + fallback logic
    AddFlowPage->>AddFlowPage: selectServerlessDeployment()
    AddFlowPage->>AddFlowPage: clickCreate()
    AddFlowPage-->>Test: redirected to topology URL
    Test->>TopologyKnativePage: navigateToTopology(namespace)
    TopologyKnativePage->>TopologyKnativePage: verifyWorkloadVisible(serviceName)
    Test->>TopologyKnativePage: rightClickOnKnativeService(name)
    TopologyKnativePage->>TopologyKnativePage: selectContextMenuAction(action)
    Test->>AdminEventingPage: navigateToEventing(namespace)
    AdminEventingPage->>AdminEventingPage: clickTab('Event Sources')
    AdminEventingPage-->>Test: eventing tab loaded
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

🚥 Pre-merge checks | ✅ 14 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Test Structure And Quality ❓ Inconclusive Custom check requests review of Ginkgo test code, but PR contains Playwright tests (TypeScript) in a completely different framework and language. Check is not applicable. Clarify whether to review Playwright test quality instead, or if check was intended for a different PR with Go/Ginkgo tests.
✅ Passed checks (14 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly and concisely describes the main change: migrating knative CI tests from Cypress to Playwright, matching the primary objective.
Description check ✅ Passed The PR description is comprehensive and well-structured, covering test migration details, Cypress removal, selector updates, test results, and setup requirements, but lacks visual evidence (screenshots/recordings).
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.
Stable And Deterministic Test Names ✅ Passed All 16 test names are stable and deterministic. They use static, descriptive identifiers (test case codes and action descriptions) without dynamic values. The namespace is created dynamically with...
Microshift Test Compatibility ✅ Passed Custom check is inapplicable. The check assesses Ginkgo e2e tests for MicroShift compatibility. This PR adds Playwright frontend tests (TypeScript), not Ginkgo tests (Go). No Ginkgo tests are added.
Single Node Openshift (Sno) Test Compatibility ✅ Passed This PR adds Playwright UI tests, not Ginkgo e2e tests. The custom check for SNO compatibility applies only to Ginkgo tests (openshift/origin), not to Playwright frontend tests (openshift/console).
Topology-Aware Scheduling Compatibility ✅ Passed This PR is a Cypress-to-Playwright test migration with no deployment manifests, operator code, or controllers introducing topology-unfriendly scheduling constraints. The knative.setup.ts file reads...
Ote Binary Stdout Contract ✅ Passed PR contains only frontend Playwright TypeScript code, not Go binaries. OTE Binary Stdout Contract applies only to Go binaries. PR is not subject to this check.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed This PR adds Playwright tests, not Ginkgo tests. The custom check specifically applies to "Ginkgo e2e tests" with patterns like It(), Describe(). This PR contains only TypeScript/JavaScript Playwri...
No-Weak-Crypto ✅ Passed No weak cryptographic patterns (MD5, SHA1, DES, RC4, 3DES, Blowfish, ECB, or custom implementations) found in PR changes; code is test automation only.
Container-Privileges ✅ Passed PR contains only test code and configuration files; no Kubernetes manifests with privileged settings (privileged: true, hostPID, hostNetwork, hostIPC, SYS_ADMIN, allowPrivilegeEscalation) were intr...
No-Sensitive-Data-In-Logs ✅ Passed No sensitive data (passwords, tokens, API keys, PII, session IDs, hostnames) is logged in the PR. All console.log statements log only generic status messages and Kubernetes resource names. Sensitiv...

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

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

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@openshift-ci openshift-ci Bot added component/knative Related to knative-plugin component/shared Related to console-shared component/topology Related to topology labels Jun 22, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (3)
frontend/e2e/pages/knative/add-flow-page.ts (1)

56-69: 🧹 Nitpick | 🔵 Trivial | ⚖️ Poor tradeoff

Consider consolidating rate-limit fallback logic.

The page object's conditional rate-limit fallback (lines 56-69) duplicates similar logic in the test file (knative-ci.spec.ts lines 35-43). The test always forces Builder Image strategy, while the page object only applies it when rate-limited.

Consider centralizing this logic:

  • If the fallback is a general UI concern (GitHub rate limits affect any test), keep it only in enterGitUrl() and remove the duplicate from the test.
  • If the test needs explicit control, document why both are necessary.

This will reduce maintenance burden and ensure consistent behavior across tests.

🤖 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/pages/knative/add-flow-page.ts` around lines 56 - 69, The
rate-limit fallback logic that selects Builder Image strategy and Node.js is
duplicated between the enterGitUrl() method in the page object
(add-flow-page.ts) and similar logic in the test file (knative-ci.spec.ts).
Consolidate this logic by keeping it only in the enterGitUrl() method as a
general UI concern for handling GitHub rate limits, then remove the duplicate
fallback logic from the test file. This ensures consistent behavior across all
tests that use enterGitUrl() and reduces maintenance burden.
frontend/e2e/pages/knative/topology-knative-page.ts (1)

167-175: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Use robustClick for sidebar action interactions.

Line 171 and Line 175 use direct clicks in a dynamic pane; this is more prone to transient visibility/intercept failures than the rest of this page object.

Suggested update
   async selectSidebarAction(actionName: string): Promise<void> {
     const actionsButton = this.sidePane.locator(
       '[data-test="actions-menu-button"], [data-test-id="actions-menu-button"]',
     );
-    await actionsButton.first().click({ timeout: 10_000 });
+    await this.robustClick(actionsButton.first(), { timeout: 10_000 });
     const actionItem = this.page.locator(
       `[data-test="${actionName}"], [data-test-action="${actionName}"]`,
     );
-    await actionItem.first().click({ timeout: 10_000 });
+    await this.robustClick(actionItem.first(), { timeout: 10_000 });
+    await this.waitForLoadingComplete();
   }

As per coding guidelines, frontend/e2e/pages/**/*.ts should use robustClick() and waitForLoadingComplete() in page-object actions.

🤖 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/pages/knative/topology-knative-page.ts` around lines 167 - 175,
In the selectSidebarAction method, replace the two direct click() calls on the
actionsButton and actionItem locators with robustClick() calls instead. The
first click() call that selects the actions menu button (using the actionsButton
locator) and the second click() call that selects the action item (using the
actionItem locator) should both be changed to robustClick() to ensure better
reliability when interacting with the dynamic sidebar pane, following the page
object coding guidelines.

Source: Coding guidelines

frontend/e2e/tests/knative/serverless/knative-ci.spec.ts (1)

29-444: 🧹 Nitpick | 🔵 Trivial | 🏗️ Heavy lift

Refactor repeated scenario blocks into test-table driven cases.

This spec duplicates the same setup/action/assert scaffolding across many cases. Converting the repeated flows to table entries (scenario metadata + executor) would reduce maintenance churn and align with the repo’s spec-test convention.

As per coding guidelines, **/*.spec.{ts,tsx} tests should follow a test-tables convention similar to Go.

🤖 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/knative/serverless/knative-ci.spec.ts` around lines 29 -
444, The knative-ci.spec.ts file contains many test cases with duplicated
scaffolding patterns, such as repeated navigation steps, similar action
sequences, and comparable assertion structures. Refactor this into a
table-driven test pattern by defining a test data interface that captures the
test parameters (test name, test identifier, actions to perform, and expected
outcomes), then create an array of test case objects containing these
parameters. Implement a single parameterized test function that iterates through
this test table and executes the common test flow using the data from each row,
similar to Go's table-driven testing convention. This approach will eliminate
the repetitive test.step blocks and setup/teardown logic that appear across
cases like the KN-02-TC02, KN-02-TC17, KA-01-TC01, and KE-05-TC01 tests, making
the test suite more maintainable and easier to extend with new cases.

Source: Coding guidelines

🤖 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/setup/knative.setup.ts`:
- Around line 101-125: The while loop that waits for the Serverless operator CSV
to reach the Succeeded phase exits silently after the csvTimeout (300_000
milliseconds) without verifying that the CSV actually succeeded. Add a check
after the while loop completes to throw an error if the CSV never reached the
Succeeded phase. Track whether the CSV succeeded (for example, using a boolean
flag inside the try block when csv.status?.phase === 'Succeeded' is found) and
after the loop, verify this flag was set to true; if not, throw an error with a
descriptive message so that the setup fails immediately rather than allowing the
test to continue and fail later.

---

Nitpick comments:
In `@frontend/e2e/pages/knative/add-flow-page.ts`:
- Around line 56-69: The rate-limit fallback logic that selects Builder Image
strategy and Node.js is duplicated between the enterGitUrl() method in the page
object (add-flow-page.ts) and similar logic in the test file
(knative-ci.spec.ts). Consolidate this logic by keeping it only in the
enterGitUrl() method as a general UI concern for handling GitHub rate limits,
then remove the duplicate fallback logic from the test file. This ensures
consistent behavior across all tests that use enterGitUrl() and reduces
maintenance burden.

In `@frontend/e2e/pages/knative/topology-knative-page.ts`:
- Around line 167-175: In the selectSidebarAction method, replace the two direct
click() calls on the actionsButton and actionItem locators with robustClick()
calls instead. The first click() call that selects the actions menu button
(using the actionsButton locator) and the second click() call that selects the
action item (using the actionItem locator) should both be changed to
robustClick() to ensure better reliability when interacting with the dynamic
sidebar pane, following the page object coding guidelines.

In `@frontend/e2e/tests/knative/serverless/knative-ci.spec.ts`:
- Around line 29-444: The knative-ci.spec.ts file contains many test cases with
duplicated scaffolding patterns, such as repeated navigation steps, similar
action sequences, and comparable assertion structures. Refactor this into a
table-driven test pattern by defining a test data interface that captures the
test parameters (test name, test identifier, actions to perform, and expected
outcomes), then create an array of test case objects containing these
parameters. Implement a single parameterized test function that iterates through
this test table and executes the common test flow using the data from each row,
similar to Go's table-driven testing convention. This approach will eliminate
the repetitive test.step blocks and setup/teardown logic that appear across
cases like the KN-02-TC02, KN-02-TC17, KA-01-TC01, and KE-05-TC01 tests, making
the test suite more maintainable and easier to extend with new cases.
🪄 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: c4d14c8b-4d6f-492c-8fc5-fac234f8fdb3

📥 Commits

Reviewing files that changed from the base of the PR and between f01f965 and 2210b8c.

📒 Files selected for processing (28)
  • frontend/e2e/pages/knative/add-flow-page.ts
  • frontend/e2e/pages/knative/admin-eventing-page.ts
  • frontend/e2e/pages/knative/topology-knative-page.ts
  • frontend/e2e/setup/knative.setup.ts
  • frontend/e2e/tests/knative/serverless/knative-ci.spec.ts
  • frontend/integration-tests/test-cypress.sh
  • frontend/package.json
  • frontend/packages/console-shared/src/components/actions/menu/ActionMenuContent.tsx
  • frontend/packages/console-shared/src/components/actions/menu/ActionMenuItem.tsx
  • frontend/packages/console-shared/src/components/form-utils/ActionGroupWithIcons.tsx
  • frontend/packages/console-shared/src/components/form-utils/FormFooter.tsx
  • frontend/packages/console-shared/src/components/multi-tab-list/MultiTabListPage.tsx
  • frontend/packages/dev-console/src/components/import/ImportSampleForm.tsx
  • frontend/packages/dev-console/src/components/import/app/AppSection.tsx
  • frontend/packages/dev-console/src/components/import/git/GitSection.tsx
  • frontend/packages/knative-plugin/integration-tests/features/e2e/knative-ci.feature
  • frontend/packages/knative-plugin/integration-tests/package.json
  • frontend/packages/topology/src/components/dropdowns/ApplicationSelector.tsx
  • frontend/packages/topology/src/components/modals/EditApplicationModal.tsx
  • frontend/packages/topology/src/components/page/TopologyPageToolbar.tsx
  • frontend/playwright.config.ts
  • frontend/public/components/factory/list-page.tsx
  • frontend/public/components/filter-toolbar.tsx
  • frontend/public/components/modals/delete-modal.tsx
  • frontend/public/components/modals/labels-modal.tsx
  • frontend/public/components/modals/tags.tsx
  • frontend/public/components/utils/actions-menu.tsx
  • frontend/public/components/utils/kebab.tsx
💤 Files with no reviewable changes (4)
  • frontend/packages/knative-plugin/integration-tests/package.json
  • frontend/integration-tests/test-cypress.sh
  • frontend/packages/knative-plugin/integration-tests/features/e2e/knative-ci.feature
  • frontend/package.json

Comment on lines +101 to +125
// Wait for the CSV to reach Succeeded phase
// eslint-disable-next-line no-console
console.log('Waiting for Serverless operator CSV to succeed...');
const startTime = Date.now();
const csvTimeout = 300_000;
while (Date.now() - startTime < csvTimeout) {
try {
const csvList = await k8sClient.customObjectsApi.listNamespacedCustomObject({
group: 'operators.coreos.com',
version: 'v1alpha1',
namespace: 'openshift-serverless',
plural: 'clusterserviceversions',
});
const items = (csvList as { items?: Array<{ status?: { phase?: string } }> }).items || [];
if (items.some((csv) => csv.status?.phase === 'Succeeded')) {
// eslint-disable-next-line no-console
console.log('Serverless operator installed successfully');
break;
}
} catch {
// CSV not ready yet
}
await new Promise((r) => setTimeout(r, 10_000));
}
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Fail setup when CSV never reaches Succeeded.

The loop at Line 106 stops after csvTimeout, but the setup does not throw when readiness is never reached. That allows the setup test to pass and pushes failure into later specs.

Suggested fix
   const startTime = Date.now();
   const csvTimeout = 300_000;
+  let csvReady = false;
   while (Date.now() - startTime < csvTimeout) {
     try {
       const csvList = await k8sClient.customObjectsApi.listNamespacedCustomObject({
         group: 'operators.coreos.com',
         version: 'v1alpha1',
         namespace: 'openshift-serverless',
         plural: 'clusterserviceversions',
       });
       const items = (csvList as { items?: Array<{ status?: { phase?: string } }> }).items || [];
       if (items.some((csv) => csv.status?.phase === 'Succeeded')) {
         // eslint-disable-next-line no-console
         console.log('Serverless operator installed successfully');
+        csvReady = true;
         break;
       }
     } catch {
       // CSV not ready yet
     }
     await new Promise((r) => setTimeout(r, 10_000));
   }
+  if (!csvReady) {
+    throw new Error(
+      `Serverless operator CSV did not reach Succeeded within ${csvTimeout}ms`,
+    );
+  }
🤖 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/setup/knative.setup.ts` around lines 101 - 125, The while loop
that waits for the Serverless operator CSV to reach the Succeeded phase exits
silently after the csvTimeout (300_000 milliseconds) without verifying that the
CSV actually succeeded. Add a check after the while loop completes to throw an
error if the CSV never reached the Succeeded phase. Track whether the CSV
succeeded (for example, using a boolean flag inside the try block when
csv.status?.phase === 'Succeeded' is found) and after the loop, verify this flag
was set to true; if not, throw an error with a descriptive message so that the
setup fails immediately rather than allowing the test to continue and fail
later.

Migrate the knative CI smoke test (knative-ci.feature) from Cypress
Gherkin to Playwright and remove the original Cypress file.

16 automatable scenarios migrated using serial test mode. 8 manual/
broken-test scenarios dropped (not migrated).

New files:
- e2e/tests/knative/serverless/knative-ci.spec.ts (16 serial tests)
- e2e/pages/knative/topology-knative-page.ts (topology interactions)
- e2e/pages/knative/add-flow-page.ts (git import flow)
- e2e/pages/knative/admin-eventing-page.ts (admin eventing page)
- e2e/setup/knative.setup.ts (Serverless operator install + CR setup)

Removed:
- features/e2e/knative-ci.feature (replaced by Playwright spec)
- test-cypress-knative-headless script and CI references

React components modified to add data-test attributes alongside
existing legacy test attributes (data-test-id, data-test-action,
data-test-dropdown-menu) for Playwright getByTestId() usage.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Michal Vinkler <mvinkler@redhat.com>
@openshift-ci

openshift-ci Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

@mvinkler: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-playwright f39cfac link false /test e2e-playwright

Full PR test history. Your PR dashboard.

Details

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/core Related to console core functionality component/dev-console Related to dev-console component/knative Related to knative-plugin component/shared Related to console-shared component/topology Related to topology jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants