Skip to content

CONSOLE-5235: Migrate basic app Cypress e2e tests to Playwright#16431

Open
stefanonardo wants to merge 1 commit into
openshift:mainfrom
stefanonardo:CONSOLE-5235
Open

CONSOLE-5235: Migrate basic app Cypress e2e tests to Playwright#16431
stefanonardo wants to merge 1 commit into
openshift:mainfrom
stefanonardo:CONSOLE-5235

Conversation

@stefanonardo
Copy link
Copy Markdown
Contributor

@stefanonardo stefanonardo commented May 12, 2026

Analysis / Root cause:
CONSOLE-5235 — Migrate 6 Cypress test files (21 tests) from packages/integration-tests/tests/app/ to Playwright as part of the OCP 5.0 Playwright migration effort (CONSOLE-5196).

Solution description:
Migrated all 6 basic app Cypress test files to idiomatic Playwright:

Cypress file Playwright spec Tests
masthead.cy.ts masthead.spec.ts 6
overview.cy.ts overview.spec.ts 2
node-terminal.cy.ts node-terminal.spec.ts 1
resource-log.cy.ts resource-log.spec.ts 3
template.cy.ts template.spec.ts 1
filtering-and-searching.cy.ts filtering-and-searching.spec.ts 8

New page objects (reusable across future migrations):

  • ListPage — DataView table, filtering by name, row assertions
  • DetailsPage — resource details loading, tab navigation, kebab actions (merged with upstream additions)
  • LogsPage — log viewer options, wrap toggle, container select, search
  • CatalogPage — catalog filtering, item/icon assertions
  • MastheadPage — logo, quick create, user dropdown
  • OverviewPage — cluster overview + topology list view, sidebar (merged with upstream additions)

KubernetesClient extensions: createPod, deletePod, waitForPodReady (with container readiness check), createDeployment, waitForDeploymentReady

Key translation decisions:

  • Replaced all cy.exec('oc ...') with KubernetesClient API calls
  • Replaced cy.login()/cy.initAdmin() with storageState auth
  • Replaced cy.wait(ms) with condition-based assertions
  • Each test is self-contained with proper cleanup via cleanup.trackNamespace()
  • All selectors verified against live cluster UI via Playwright MCP
  • Used Partial<V1Pod> / Partial<V1Deployment> types to avoid unsafe as any casts
  • Template test uses unique name (Date.now()) to prevent collisions

Fixes to existing cluster-settings tests:

Tests that use page.route() to mock Kubernetes API responses (e.g. ClusterVersion, MachineConfigPool) were failing because the console's watchK8sObject makes two requests per watched resource: an HTTP GET (intercepted by page.route()) and a WebSocket watch (not intercepted). The WebSocket delivered real cluster data that overwrote the mocked GET response in the Redux store.

Fix: Added page.routeWebSocket(pattern, () => {}) calls alongside the existing page.route() mocks. When the handler doesn't call connectToServer(), Playwright creates a mock WebSocket that appears open to the page but never delivers server messages. The URL patterns are specific (e.g. /apis\/config\.openshift\.io\/v1\/clusterversions/), so only matching WebSocket connections are intercepted — all other WebSockets pass through normally.

In update-modal.spec.ts, the previous 45-line stubMachineConfigPoolWebSocket() function used page.addInitScript() to monkey-patch the global WebSocket constructor. This was replaced with two idiomatic one-liners using page.routeWebSocket() (available since Playwright 1.48; project uses 1.59+), which provides the same selective interception behavior without modifying global browser state.

Affected files: channel-modal.spec.ts, update-in-progress.spec.ts, upgradeable-false.spec.ts, updates-graph.spec.ts, update-modal.spec.ts, worker-mcp-paused.spec.ts.

Additional page object fixes:

  • overview-page.ts: Fixed labelCell() — the .odc-topology-list-view__label-cell element contains both the kind badge prefix (e.g. "DaemonSetD") and the resource name, so the regex ^name$ never matched. Changed to substring match.
  • catalog-page.ts: Fixed catalogItemIcon() — PatternFly's CatalogTile renders <img alt="">, which per ARIA spec has role="presentation", so getByRole('img') correctly skips it. Changed to CSS selector img.catalog-tile-pf-icon.

Screenshots / screen recording:

Test setup:
Requires a running OpenShift cluster. Configure frontend/e2e/.env with cluster credentials, then run:

cd frontend
npx playwright test --project=console tests/console/app/

Test cases:

  • All 21 migrated tests pass against a live cluster with --retries=0
  • Tests verified stable across 3 consecutive runs
  • Original Cypress test files deleted after validation
  • Exclusive Cypress dependencies deleted (views/logs.ts, views/catalogs.ts, views/overview.ts, fixture YAMLs)
  • TypeScript type check passes (npx tsc --noEmit)
  • ESLint passes on all files including eslint-plugin-playwright rules

Browser conformance:

  • Chrome (Playwright Chromium)
  • Firefox
  • Safari (or Epiphany on Linux)

Additional info:

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

openshift-ci-robot commented May 12, 2026

@stefanonardo: This pull request references CONSOLE-5235 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:

Analysis / Root cause:
CONSOLE-5235 — Migrate 6 Cypress test files (21 tests) from packages/integration-tests/tests/app/ to Playwright as part of the OCP 5.0 Playwright migration effort (CONSOLE-5196).

Solution description:
Migrated all 6 basic app Cypress test files to idiomatic Playwright:

Cypress file Playwright spec Tests
masthead.cy.ts masthead.spec.ts 6
overview.cy.ts overview.spec.ts 2
node-terminal.cy.ts node-terminal.spec.ts 1
resource-log.cy.ts resource-log.spec.ts 3
template.cy.ts template.spec.ts 1
filtering-and-searching.cy.ts filtering-and-searching.spec.ts 8

New page objects (reusable across future migrations):

  • ListPage — DataView table, filtering by name, row assertions
  • DetailsPage — resource details loading, tab navigation
  • LogsPage — log viewer options, wrap toggle, container select, search
  • CatalogPage — catalog filtering, item/icon assertions
  • MastheadPage — logo, quick create, user dropdown
  • OverviewPage — topology list view, sidebar

KubernetesClient extensions: createPod, deletePod, waitForPodReady, createDeployment, waitForDeploymentReady

Key translation decisions:

  • Replaced all cy.exec('oc ...') with KubernetesClient API calls
  • Replaced cy.login()/cy.initAdmin() with storageState auth
  • Replaced cy.wait(ms) with condition-based assertions
  • Each test is self-contained with proper cleanup via cleanup.trackNamespace()
  • All selectors verified against live cluster UI via Playwright MCP

Screenshots / screen recording:

Test setup:
Requires a running OpenShift cluster. Configure frontend/e2e/.env with cluster credentials, then run:

cd frontend
npx playwright test --project=console tests/console/app/

Test cases:

  • All 21 migrated tests pass against a live cluster with --retries=0
  • Original Cypress test files deleted after validation
  • Exclusive Cypress dependencies deleted (views/logs.ts, views/catalogs.ts, views/overview.ts, fixture YAMLs)
  • TypeScript type check passes (npx tsc --noEmit)
  • ESLint passes on all new/modified files

Browser conformance:

  • Chrome (Playwright Chromium)
  • Firefox
  • Safari (or Epiphany on Linux)

Additional info:

🤖 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 requested review from TheRealJon and jhadvig May 12, 2026 07:24
@openshift-ci openshift-ci Bot added the kind/cypress Related to Cypress e2e integration testing label May 12, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 12, 2026

📝 Walkthrough

Walkthrough

This PR migrates E2E tests from Cypress to Playwright: it adds KubernetesClient pod/deployment lifecycle helpers, a BasePage retry helper, six Playwright page-objects (Catalog, Details, List, Logs, Masthead, Overview), and multiple new Playwright specs (filtering/searching, masthead, node terminal, overview, resource logs, template). It also adds WebSocket interceptions in cluster-settings tests, adjusts Playwright config and test selector attributes, removes legacy Cypress fixtures/helpers, and updates migration/docs and the debug-e2e skill metadata.

Suggested reviewers

  • jhadvig
  • TheRealJon

Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error, 1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Stable And Deterministic Test Names ❌ Error Test names use dynamic template literals in loops: masthead.spec.ts with ${heading} and overview.spec.ts with ${model.kind}, violating the stable test names principle. Replace template literals in test names with static titles. Move dynamic values into test bodies. Use single static describe/test names for parameterized suites instead of loop-generated names.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Test Structure And Quality ❓ Inconclusive Custom check specifies "Ginkgo test code" review, but PR contains only Playwright E2E tests (TypeScript .spec.ts files), not Go Ginkgo tests. Check instructions are not applicable. Clarify if check applies to Playwright tests. Ginkgo-specific patterns (Describe/It/BeforeEach/AfterEach) don't exist in this PR; Playwright uses test.describe/test/test.beforeAll patterns instead.
✅ Passed checks (9 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: migrating Cypress e2e tests to Playwright for the CONSOLE-5235 ticket.
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.
Microshift Test Compatibility ✅ Passed Custom check is not applicable: this PR adds Playwright TypeScript frontend e2e tests, not Ginkgo Go e2e tests. Check specifically targets Ginkgo patterns not present here.
Single Node Openshift (Sno) Test Compatibility ✅ Passed Custom check targets Ginkgo e2e tests (Go, It/Describe/Context syntax), but this PR only adds Playwright e2e tests (TypeScript, test.describe/test syntax) in frontend/e2e/. Check is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed PR migrates Cypress→Playwright tests only. No production operators/manifests added; no scheduling constraints introduced. Topology-aware check does not apply.
Ote Binary Stdout Contract ✅ Passed PR contains only frontend TypeScript/Playwright E2E tests and page objects—zero Go code. OTE Binary Stdout Contract applies only to Go binaries with main()/process-level code, not frontend E2E tests.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PR adds 6 TypeScript Playwright tests, not Ginkgo tests. Custom check targets Go/Ginkgo e2e tests only. No Ginkgo tests found in PR.
Description check ✅ Passed PR description is comprehensive and well-structured, covering analysis, solution, test setup, and validation. Follows template structure with detailed migration context and key translation decisions.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 6

🧹 Nitpick comments (6)
frontend/e2e/pages/catalog-page.ts (1)

6-8: ⚡ Quick win

Use the stable data-test attribute for the keyword filter input.

The underlying SearchInput component (CatalogToolbar.tsx) provides data-test="search-catalog". Update the selector from 'input[placeholder*="Filter by keyword"]' to this.page.getByTestId('search-catalog') to avoid brittleness from placeholder text changes and i18n updates. Aligns with the existing pattern used in catalogItem(testId) on line 19.

🤖 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/catalog-page.ts` around lines 6 - 8, Replace the brittle
placeholder-based locator for the keyword filter by updating the private field
filterInput (type Locator) to use the stable test id selector: use
this.page.getByTestId('search-catalog') instead of 'input[placeholder*="Filter
by keyword"]' so the CatalogToolbar's data-test="search-catalog" is targeted
like catalogItem(testId) does.
frontend/e2e/tests/console/app/masthead.spec.ts (1)

58-67: ⚡ Quick win

Add a post-logout assertion to avoid false positives.

The test currently validates only clicks. Please assert an observable logout outcome (URL/login screen/auth redirect) after Line 67.

🤖 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/app/masthead.spec.ts` around lines 58 - 67, The
test only performs clicks and can falsely pass; after calling
MastheadPage.clickLogOut() add a concrete post-logout assertion: if using
URL-based redirect, await page.waitForURL(...) or expect(page).toHaveURL(...)
for the login or landing path; alternatively assert a login-related UI element
via MastheadPage (e.g., expect(masthead.loginButton).toBeVisible() or
expect(masthead.isAuthenticated()).resolves.toBe(false)). Use the existing
MastheadPage helpers (isAuthDisabled, openUserDropdown, clickLogOut) and add the
appropriate await/expect to verify the app reached the logged-out state.
frontend/e2e/tests/console/app/filtering-and-searching.spec.ts (1)

27-55: ⚡ Quick win

Drop as any for the deployment body.

Line 54 removes compile-time guarantees for your setup manifest. Prefer a typed value using satisfies against createDeployment input.

Suggested fix
-    await client.createDeployment(ns, {
+    const deployment = {
       apiVersion: 'apps/v1',
       kind: 'Deployment',
       metadata: {
         name: workloadName,
         labels: { 'lbl-filter': ns, app: 'name' },
       },
       spec: {
         replicas: 3,
         selector: { matchLabels: { app: 'name' } },
         template: {
           metadata: { labels: { app: 'name' } },
           spec: {
             securityContext: { runAsNonRoot: true, seccompProfile: { type: 'RuntimeDefault' } },
             containers: [
               {
                 name: 'httpd',
                 image: 'image-registry.openshift-image-registry.svc:5000/openshift/httpd:latest',
                 securityContext: {
                   allowPrivilegeEscalation: false,
                   capabilities: { drop: ['ALL'] },
                 },
               },
             ],
           },
         },
       },
-    } as any);
+    } satisfies Parameters<KubernetesClient['createDeployment']>[1];
+    await client.createDeployment(ns, deployment);

As per coding guidelines: “Avoid using any type; flag use of any type and suggest proper type definitions”.

🤖 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/app/filtering-and-searching.spec.ts` around lines
27 - 55, Remove the unsafe "as any" cast on the deployment manifest and instead
satisfy the actual parameter type expected by client.createDeployment; replace
the trailing "as any" with "satisfies Parameters<typeof
client.createDeployment>[1]" (or the concrete input type for createDeployment)
so the manifest literal (the object passed to client.createDeployment in the
test) is type-checked, keeping the rest of the call to
client.waitForDeploymentReady(workloadName, ns) unchanged.
frontend/e2e/pages/masthead-page.ts (1)

33-35: ⚡ Quick win

Replace any in isAuthDisabled with a narrow window type.

Line 34 can be fully typed without any, keeping strict checks intact.

Suggested fix
 async isAuthDisabled(): Promise<boolean> {
-  return this.page.evaluate(() => !!(window as any).SERVER_FLAGS?.authDisabled);
+  return this.page.evaluate(() => {
+    const flags = (window as Window & { SERVER_FLAGS?: { authDisabled?: boolean } }).SERVER_FLAGS;
+    return Boolean(flags?.authDisabled);
+  });
 }

As per coding guidelines: “Avoid using any type; flag use of any type and suggest proper type definitions”.

🤖 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/masthead-page.ts` around lines 33 - 35, The isAuthDisabled
method uses (window as any) which bypasses typings; replace it with a narrow
Window interface that includes optional SERVER_FLAGS with authDisabled and use
that type in the page.evaluate callback. Add a local type or interface like
interface WindowWithServerFlags { SERVER_FLAGS?: { authDisabled?: boolean } }
and then change the evaluate body to cast window to WindowWithServerFlags (or
declare it in the callback signature) so the expression becomes
!!(windowAsTyped.SERVER_FLAGS?.authDisabled) while removing any usage; update
the function isAuthDisabled to use that typed window reference.
frontend/e2e/pages/logs-page.ts (1)

16-18: ⚡ Quick win

Use stable test IDs instead of placeholder/class-based locators

Line 16-18 rely on a localized placeholder and CSS classes, which are brittle for long-term e2e stability. Prefer data-test-backed locators for these elements as well.

As per coding guidelines: **/*.{tsx,ts}: Prefer data-test attributes for Cypress selectors ... over brittle CSS or ARIA selectors.

🤖 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/logs-page.ts` around lines 16 - 18, Replace brittle
locators in logs-page.ts with data-test-backed selectors: update the Locator
definitions searchInput, searchMatches, and logText to use stable data-test
attributes (e.g., page.locator('[data-test="logs-search"]'),
page.locator('[data-test="logs-match"]'),
page.locator('[data-test="log-text"]')) instead of the placeholder or
class-based selectors, and ensure the corresponding components/templates include
those data-test attributes so the tests can target them reliably.
frontend/e2e/tests/console/app/resource-log.spec.ts (1)

92-92: ⚡ Quick win

Drop as any for Pod specs to preserve type safety

Line 92, 126, and 127 cast Pod specs to any, which hides schema mistakes in test fixtures. Please use a concrete k8s resource type for these objects.

As per coding guidelines: **/*.{ts,tsx}: Avoid using any type; flag use of any type and suggest proper type definitions.

Also applies to: 126-127

🤖 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/app/resource-log.spec.ts` at line 92, The test is
casting Pod fixtures to any (examplePodSpec) before calling k8sClient.createPod
which loses type safety; replace the `as any` casts by typing the fixture
objects with the concrete Kubernetes Pod type used by your k8s client (e.g.,
V1Pod or the client's PodManifest type), import that type at the top, update
examplePodSpec (and the other pod spec variables used around createPod) to match
that interface, and pass them directly to k8sClient.createPod so the compiler
validates the Pod schema instead of using `any`.
🤖 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 @.claude/skills/migrate-cypress/SKILL.md:
- Around line 79-81: Update the selector examples to match the Selector
Unification rule by replacing occurrences of the legacy attribute `data-test-id`
with the unified `data-test` in the SKILL.md examples; specifically change the
locator initialization referenced by the symbol detailsTab (the
this.page.locator('[data-test-id="horizontal-link-Details"]')) and the other
example block around the second occurrence (lines shown in the review) so both
examples use '[data-test="horizontal-link-Details"]' and analogous selectors to
keep the documentation consistent.
- Around line 24-28: Update the fenced code blocks in SKILL.md so they declare a
language (e.g., add "text" after the opening ```), specifically for the
migration command block containing the lines starting with "/migrate-cypress
..." and the corresponding output block showing "Migration complete:
<source-file> → <output-file>" (also apply the same change to the second
occurrence around lines 106-113); open each triple-backtick fence and change ```
to ```text so markdownlint MD040 warnings are resolved.

In `@frontend/e2e/clients/kubernetes-client.ts`:
- Around line 489-495: The waitForPodReady function currently only checks
pod.status.phase === 'Running' and can return before containers are actually
ready; update the poll predicate in waitForPodReady to fetch the pod via
this.k8sApi.readNamespacedPod and then verify readiness by (a) confirming
status.phase === 'Running' and (b) ensuring either all status.containerStatuses
exist and every containerStatus.ready === true OR that pod.status.conditions
contains a condition with type === 'Ready' and status === 'True'; handle missing
fields defensively (treat absent containerStatuses/conditions as not ready) and
keep the existing timeout/polling behavior so callers of waitForPodReady get a
true only when the pod is actually ready.

In `@frontend/e2e/pages/list-page.ts`:
- Around line 54-60: The clickFirstRowLinkMatching method can misbehave if
callers pass a RegExp with global or sticky flags because RegExp.lastIndex is
stateful; defensively create a fresh RegExp without the g or y flags from the
incoming pattern before the loop (use pattern.source and pattern.flags filtered
to remove 'g' and 'y') and then use that new RegExp for matching inside the
loop, keeping the rest of the logic (including robustClick) unchanged.

In `@frontend/e2e/tests/console/app/resource-log.spec.ts`:
- Line 65: The test uses absolute paths in page.goto (e.g.
page.goto('/k8s/ns/openshift-kube-apiserver/core~v1~Pod')) which breaks behind
non-root proxy; replace these calls with the base-path-safe routing helper used
elsewhere (for example a getConsoleRoute or buildConsoleUrl helper) so the path
is prefixed by the app's base path, and update each occurrence of
page.goto('/k8s/...') in resource-log.spec.ts to call that helper (e.g. await
page.goto(getConsoleRoute('k8s/ns/openshift-kube-apiserver/core~v1~Pod'))) so
tests work when Console is hosted under a non-root path.

In `@frontend/e2e/tests/console/app/template.spec.ts`:
- Line 4: The test uses a fixed constant TEMPLATE_NAME ('httpd-example-test')
causing collisions; update the spec (template.spec.ts) to generate a unique
template name at runtime (e.g., append a timestamp or UUID) and replace the
constant TEMPLATE_NAME with that dynamic value so each run uses a distinct name;
ensure the generated name is used wherever TEMPLATE_NAME is referenced in the
test so creation calls no longer clash with existing resources.

---

Nitpick comments:
In `@frontend/e2e/pages/catalog-page.ts`:
- Around line 6-8: Replace the brittle placeholder-based locator for the keyword
filter by updating the private field filterInput (type Locator) to use the
stable test id selector: use this.page.getByTestId('search-catalog') instead of
'input[placeholder*="Filter by keyword"]' so the CatalogToolbar's
data-test="search-catalog" is targeted like catalogItem(testId) does.

In `@frontend/e2e/pages/logs-page.ts`:
- Around line 16-18: Replace brittle locators in logs-page.ts with
data-test-backed selectors: update the Locator definitions searchInput,
searchMatches, and logText to use stable data-test attributes (e.g.,
page.locator('[data-test="logs-search"]'),
page.locator('[data-test="logs-match"]'),
page.locator('[data-test="log-text"]')) instead of the placeholder or
class-based selectors, and ensure the corresponding components/templates include
those data-test attributes so the tests can target them reliably.

In `@frontend/e2e/pages/masthead-page.ts`:
- Around line 33-35: The isAuthDisabled method uses (window as any) which
bypasses typings; replace it with a narrow Window interface that includes
optional SERVER_FLAGS with authDisabled and use that type in the page.evaluate
callback. Add a local type or interface like interface WindowWithServerFlags {
SERVER_FLAGS?: { authDisabled?: boolean } } and then change the evaluate body to
cast window to WindowWithServerFlags (or declare it in the callback signature)
so the expression becomes !!(windowAsTyped.SERVER_FLAGS?.authDisabled) while
removing any usage; update the function isAuthDisabled to use that typed window
reference.

In `@frontend/e2e/tests/console/app/filtering-and-searching.spec.ts`:
- Around line 27-55: Remove the unsafe "as any" cast on the deployment manifest
and instead satisfy the actual parameter type expected by
client.createDeployment; replace the trailing "as any" with "satisfies
Parameters<typeof client.createDeployment>[1]" (or the concrete input type for
createDeployment) so the manifest literal (the object passed to
client.createDeployment in the test) is type-checked, keeping the rest of the
call to client.waitForDeploymentReady(workloadName, ns) unchanged.

In `@frontend/e2e/tests/console/app/masthead.spec.ts`:
- Around line 58-67: The test only performs clicks and can falsely pass; after
calling MastheadPage.clickLogOut() add a concrete post-logout assertion: if
using URL-based redirect, await page.waitForURL(...) or
expect(page).toHaveURL(...) for the login or landing path; alternatively assert
a login-related UI element via MastheadPage (e.g.,
expect(masthead.loginButton).toBeVisible() or
expect(masthead.isAuthenticated()).resolves.toBe(false)). Use the existing
MastheadPage helpers (isAuthDisabled, openUserDropdown, clickLogOut) and add the
appropriate await/expect to verify the app reached the logged-out state.

In `@frontend/e2e/tests/console/app/resource-log.spec.ts`:
- Line 92: The test is casting Pod fixtures to any (examplePodSpec) before
calling k8sClient.createPod which loses type safety; replace the `as any` casts
by typing the fixture objects with the concrete Kubernetes Pod type used by your
k8s client (e.g., V1Pod or the client's PodManifest type), import that type at
the top, update examplePodSpec (and the other pod spec variables used around
createPod) to match that interface, and pass them directly to
k8sClient.createPod so the compiler validates the Pod schema instead of using
`any`.
🪄 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 YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 863a79dc-002d-49da-ba01-806f799f3415

📥 Commits

Reviewing files that changed from the base of the PR and between cd0749d and 06b20a5.

📒 Files selected for processing (30)
  • .claude/migration-context.md
  • .claude/skills/debug-test/SKILL.md
  • .claude/skills/migrate-cypress/SKILL.md
  • .gitignore
  • AGENTS.md
  • frontend/e2e/clients/kubernetes-client.ts
  • frontend/e2e/pages/catalog-page.ts
  • frontend/e2e/pages/details-page.ts
  • frontend/e2e/pages/list-page.ts
  • frontend/e2e/pages/logs-page.ts
  • frontend/e2e/pages/masthead-page.ts
  • frontend/e2e/pages/overview-page.ts
  • frontend/e2e/tests/console/app/filtering-and-searching.spec.ts
  • frontend/e2e/tests/console/app/masthead.spec.ts
  • frontend/e2e/tests/console/app/node-terminal.spec.ts
  • frontend/e2e/tests/console/app/overview.spec.ts
  • frontend/e2e/tests/console/app/resource-log.spec.ts
  • frontend/e2e/tests/console/app/template.spec.ts
  • frontend/packages/integration-tests/fixtures/httpd-example-template.yaml
  • frontend/packages/integration-tests/fixtures/pod-with-space.yaml
  • frontend/packages/integration-tests/fixtures/pod-with-wrap-annotation.yaml
  • frontend/packages/integration-tests/tests/app/filtering-and-searching.cy.ts
  • frontend/packages/integration-tests/tests/app/masthead.cy.ts
  • frontend/packages/integration-tests/tests/app/node-terminal.cy.ts
  • frontend/packages/integration-tests/tests/app/overview.cy.ts
  • frontend/packages/integration-tests/tests/app/resource-log.cy.ts
  • frontend/packages/integration-tests/tests/app/template.cy.ts
  • frontend/packages/integration-tests/views/catalogs.ts
  • frontend/packages/integration-tests/views/logs.ts
  • frontend/packages/integration-tests/views/overview.ts
💤 Files with no reviewable changes (12)
  • frontend/packages/integration-tests/tests/app/resource-log.cy.ts
  • frontend/packages/integration-tests/fixtures/pod-with-space.yaml
  • frontend/packages/integration-tests/fixtures/pod-with-wrap-annotation.yaml
  • frontend/packages/integration-tests/tests/app/overview.cy.ts
  • frontend/packages/integration-tests/views/overview.ts
  • frontend/packages/integration-tests/tests/app/node-terminal.cy.ts
  • frontend/packages/integration-tests/tests/app/template.cy.ts
  • frontend/packages/integration-tests/fixtures/httpd-example-template.yaml
  • frontend/packages/integration-tests/tests/app/filtering-and-searching.cy.ts
  • frontend/packages/integration-tests/views/catalogs.ts
  • frontend/packages/integration-tests/views/logs.ts
  • frontend/packages/integration-tests/tests/app/masthead.cy.ts
📜 Review details
🧰 Additional context used
📓 Path-based instructions (10)
**/*.{tsx,ts}

📄 CodeRabbit inference engine (TESTING.md)

Prefer data-test attributes for Cypress selectors (e.g., cy.get('[data-test="create-deployment"]')) over brittle CSS or ARIA selectors

Files:

  • frontend/e2e/tests/console/app/template.spec.ts
  • frontend/e2e/tests/console/app/node-terminal.spec.ts
  • frontend/e2e/tests/console/app/masthead.spec.ts
  • frontend/e2e/pages/catalog-page.ts
  • frontend/e2e/pages/list-page.ts
  • frontend/e2e/tests/console/app/overview.spec.ts
  • frontend/e2e/pages/logs-page.ts
  • frontend/e2e/pages/details-page.ts
  • frontend/e2e/pages/overview-page.ts
  • frontend/e2e/pages/masthead-page.ts
  • frontend/e2e/clients/kubernetes-client.ts
  • frontend/e2e/tests/console/app/filtering-and-searching.spec.ts
  • frontend/e2e/tests/console/app/resource-log.spec.ts
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (STYLEGUIDE.md)

Use lowercase dash-separated names for all files (to avoid git issues with case-insensitive file systems)

Files:

  • frontend/e2e/tests/console/app/template.spec.ts
  • frontend/e2e/tests/console/app/node-terminal.spec.ts
  • frontend/e2e/tests/console/app/masthead.spec.ts
  • frontend/e2e/pages/catalog-page.ts
  • frontend/e2e/pages/list-page.ts
  • frontend/e2e/tests/console/app/overview.spec.ts
  • frontend/e2e/pages/logs-page.ts
  • frontend/e2e/pages/details-page.ts
  • frontend/e2e/pages/overview-page.ts
  • frontend/e2e/pages/masthead-page.ts
  • frontend/e2e/clients/kubernetes-client.ts
  • frontend/e2e/tests/console/app/filtering-and-searching.spec.ts
  • frontend/e2e/tests/console/app/resource-log.spec.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (STYLEGUIDE.md)

**/*.{ts,tsx}: Prefer functional programming patterns and immutable data structures
Run the linter and follow all rules defined in .eslintrc
Use React hooks and Context API for state management, migrating away from legacy Redux/Immutable.js
Use existing hooks from console-shared when possible (useK8sWatchResource, useUserSettings, etc.)
Use k8s resource hooks for data fetching, consoleFetchJSON for HTTP requests
Use console extension points for plugin integration
Check existing types in console-shared before creating new types
Use useTranslation('namespace') hook with key format for translation keys
Use useCallback to memoize callbacks and prevent unnecessary re-renders
Use useMemo for expensive filtering and computations to prevent re-renders
Avoid using any type; flag use of any type and suggest proper type definitions
Verify null/undefined are properly handled in type definitions (use string | undefined format)
Verify exported types for reusable components are properly defined
Use usePluginInfo hook for plugin data access
Avoid importing from deprecated component paths (check for /deprecated in import paths and @deprecated JSDoc tags)
Use direct imports to specific files instead of barrel exports from index.ts to avoid circular dependencies and improve build performance
Use import type for type-only imports to improve tree-shaking and build performance

Files:

  • frontend/e2e/tests/console/app/template.spec.ts
  • frontend/e2e/tests/console/app/node-terminal.spec.ts
  • frontend/e2e/tests/console/app/masthead.spec.ts
  • frontend/e2e/pages/catalog-page.ts
  • frontend/e2e/pages/list-page.ts
  • frontend/e2e/tests/console/app/overview.spec.ts
  • frontend/e2e/pages/logs-page.ts
  • frontend/e2e/pages/details-page.ts
  • frontend/e2e/pages/overview-page.ts
  • frontend/e2e/pages/masthead-page.ts
  • frontend/e2e/clients/kubernetes-client.ts
  • frontend/e2e/tests/console/app/filtering-and-searching.spec.ts
  • frontend/e2e/tests/console/app/resource-log.spec.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (STYLEGUIDE.md)

Never use absolute paths in code; the app must be able to run behind a proxy under an arbitrary path

**/*.{ts,tsx,js,jsx}: Use i18next's TFunction inside functions or components, not in module scope
Don't use backticks inside of a TFunction call; use single quotes instead for template strings
For dynamic keys that cannot be interpolated by i18next-parser, specify possible static values in comments (e.g., // t('key_1')) to aid key generation

Files:

  • frontend/e2e/tests/console/app/template.spec.ts
  • frontend/e2e/tests/console/app/node-terminal.spec.ts
  • frontend/e2e/tests/console/app/masthead.spec.ts
  • frontend/e2e/pages/catalog-page.ts
  • frontend/e2e/pages/list-page.ts
  • frontend/e2e/tests/console/app/overview.spec.ts
  • frontend/e2e/pages/logs-page.ts
  • frontend/e2e/pages/details-page.ts
  • frontend/e2e/pages/overview-page.ts
  • frontend/e2e/pages/masthead-page.ts
  • frontend/e2e/clients/kubernetes-client.ts
  • frontend/e2e/tests/console/app/filtering-and-searching.spec.ts
  • frontend/e2e/tests/console/app/resource-log.spec.ts
**/*.spec.{ts,tsx}

📄 CodeRabbit inference engine (STYLEGUIDE.md)

Tests should follow a table-driven tests convention similar to Go where applicable

Files:

  • frontend/e2e/tests/console/app/template.spec.ts
  • frontend/e2e/tests/console/app/node-terminal.spec.ts
  • frontend/e2e/tests/console/app/masthead.spec.ts
  • frontend/e2e/tests/console/app/overview.spec.ts
  • frontend/e2e/tests/console/app/filtering-and-searching.spec.ts
  • frontend/e2e/tests/console/app/resource-log.spec.ts
**/*.ts

📄 CodeRabbit inference engine (STYLEGUIDE.md)

Updates to console-dynamic-plugin-sdk should maintain backward compatibility as it's a public API; use the plugin-api-review skill to vet changes for public API impact

Files:

  • frontend/e2e/tests/console/app/template.spec.ts
  • frontend/e2e/tests/console/app/node-terminal.spec.ts
  • frontend/e2e/tests/console/app/masthead.spec.ts
  • frontend/e2e/pages/catalog-page.ts
  • frontend/e2e/pages/list-page.ts
  • frontend/e2e/tests/console/app/overview.spec.ts
  • frontend/e2e/pages/logs-page.ts
  • frontend/e2e/pages/details-page.ts
  • frontend/e2e/pages/overview-page.ts
  • frontend/e2e/pages/masthead-page.ts
  • frontend/e2e/clients/kubernetes-client.ts
  • frontend/e2e/tests/console/app/filtering-and-searching.spec.ts
  • frontend/e2e/tests/console/app/resource-log.spec.ts
**/*

📄 CodeRabbit inference engine (STYLEGUIDE.md)

Use lowercase dash-separated names for all files and directories, with exceptions for files with their own naming conventions (Dockerfile, Makefile, README, etc.)

Files:

  • frontend/e2e/tests/console/app/template.spec.ts
  • frontend/e2e/tests/console/app/node-terminal.spec.ts
  • frontend/e2e/tests/console/app/masthead.spec.ts
  • frontend/e2e/pages/catalog-page.ts
  • frontend/e2e/pages/list-page.ts
  • frontend/e2e/tests/console/app/overview.spec.ts
  • AGENTS.md
  • frontend/e2e/pages/logs-page.ts
  • frontend/e2e/pages/details-page.ts
  • frontend/e2e/pages/overview-page.ts
  • frontend/e2e/pages/masthead-page.ts
  • frontend/e2e/clients/kubernetes-client.ts
  • frontend/e2e/tests/console/app/filtering-and-searching.spec.ts
  • frontend/e2e/tests/console/app/resource-log.spec.ts
**/*.{ts,tsx,jsx}

📄 CodeRabbit inference engine (INTERNATIONALIZATION.md)

**/*.{ts,tsx,jsx}: Internationalize aria-label, aria-placeholder, aria-roledescription, and aria-valuetext attributes
When displaying a resource kind, use the predefined model.labelPluralKey wrapped in TFunction if available, otherwise fall back to model.labelPlural
Use the i18nKey property on react-i18next Trans component only as a last resort when the parser generates incorrect keys with HTML tags

Files:

  • frontend/e2e/tests/console/app/template.spec.ts
  • frontend/e2e/tests/console/app/node-terminal.spec.ts
  • frontend/e2e/tests/console/app/masthead.spec.ts
  • frontend/e2e/pages/catalog-page.ts
  • frontend/e2e/pages/list-page.ts
  • frontend/e2e/tests/console/app/overview.spec.ts
  • frontend/e2e/pages/logs-page.ts
  • frontend/e2e/pages/details-page.ts
  • frontend/e2e/pages/overview-page.ts
  • frontend/e2e/pages/masthead-page.ts
  • frontend/e2e/clients/kubernetes-client.ts
  • frontend/e2e/tests/console/app/filtering-and-searching.spec.ts
  • frontend/e2e/tests/console/app/resource-log.spec.ts
**/*.ts?(x)

📄 CodeRabbit inference engine (AGENTS.md)

Never import from package index files (e.g., @console/shared) in new code; import from specific file paths instead to avoid circular dependencies and slow builds

Ensure all $codeRef in extension points ALWAYS reference the corresponding extension type from the dynamic plugin SDK package (@console/dynamic-plugin-sdk/src/extensions/) for type safety

Never use template literals (backticks) in t() i18n calls; use single or double quotes instead as the i18n parser cannot extract keys from template literals

Never import from or use code with the @deprecated TSdoc tag in new code

Never use absolute URLs or paths; the console runs behind a proxy under an arbitrary path

After adding or modifying user-facing strings, run yarn i18n to update i18n keys and commit updated keys alongside code changes that affect i18n

Files:

  • frontend/e2e/tests/console/app/template.spec.ts
  • frontend/e2e/tests/console/app/node-terminal.spec.ts
  • frontend/e2e/tests/console/app/masthead.spec.ts
  • frontend/e2e/pages/catalog-page.ts
  • frontend/e2e/pages/list-page.ts
  • frontend/e2e/tests/console/app/overview.spec.ts
  • frontend/e2e/pages/logs-page.ts
  • frontend/e2e/pages/details-page.ts
  • frontend/e2e/pages/overview-page.ts
  • frontend/e2e/pages/masthead-page.ts
  • frontend/e2e/clients/kubernetes-client.ts
  • frontend/e2e/tests/console/app/filtering-and-searching.spec.ts
  • frontend/e2e/tests/console/app/resource-log.spec.ts
AGENTS.md

📄 CodeRabbit inference engine (CLAUDE.md)

Document agent capabilities and behavior in AGENTS.md

Files:

  • AGENTS.md
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
Repo: openshift/console

Timestamp: 2026-05-12T07:24:22.768Z
Learning: Before starting ANY changes to the dynamic plugin SDK, ensure changes do not impact the public API by checking `frontend/packages/console-dynamic-plugin-sdk/src/api/internal-*.ts` files to avoid breakage of external plugins
Learnt from: CR
Repo: openshift/console

Timestamp: 2026-05-12T07:24:22.768Z
Learning: Always consider impact on external plugin developers when making changes to the dynamic plugin SDK, maintain backward compatibility, provide comprehensive documentation for all public APIs, and ensure changes to extension schemas include migration paths
Learnt from: CR
Repo: openshift/console

Timestamp: 2026-05-12T07:24:22.768Z
Learning: Use the `plugin-api-review` skill for all changes to the dynamic plugin SDK public API to ensure proper vetting and prevent breaking changes
Learnt from: CR
Repo: openshift/console

Timestamp: 2026-05-12T07:24:22.768Z
Learning: Backend dependency updates should be in separate commits from core logic changes to isolate vendor folder changes
Learnt from: CR
Repo: openshift/console

Timestamp: 2026-05-12T07:24:22.768Z
Learning: Bug fix commits should be prefixed with bug number or Jira key (e.g., `OCPBUGS-1234: Fix ...`); commit subject line answers 'what changed' and body answers 'why'
Learnt from: CR
Repo: openshift/console

Timestamp: 2026-05-12T07:24:22.768Z
Learning: When opening a PR, fill out the PR template located in `docs/pull_request_template.md` with all required sections and always link to the relevant JIRA issue in the PR title and description
Learnt from: CR
Repo: openshift/console

Timestamp: 2026-05-12T07:24:22.768Z
Learning: Feature work branches should be named with `CONSOLE-####` (Jira story number); bug fix branches should be named with `OCPBUGS-####` (Jira bug number); use `main` as base branch
Learnt from: CR
Repo: openshift/console

Timestamp: 2026-05-12T07:24:22.768Z
Learning: Use `/migrate-cypress` to convert Cypress e2e tests to Playwright and `/debug-test` to fix failing tests during the Cypress to Playwright migration
🪛 LanguageTool
.claude/skills/debug-test/SKILL.md

[style] ~100-~100: The adverb ‘sometimes’ is usually put before the verb ‘passes’.
Context: ...structure setup first. ### Flaky test (passes sometimes, fails sometimes) If a test passes on r...

(ADVERB_WORD_ORDER)


[style] ~100-~100: The adverb ‘sometimes’ is usually put before the verb ‘fails’.
Context: ...rst. ### Flaky test (passes sometimes, fails sometimes) If a test passes on re-run without any...

(ADVERB_WORD_ORDER)

🪛 markdownlint-cli2 (0.22.1)
.claude/skills/migrate-cypress/SKILL.md

[warning] 24-24: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


[warning] 106-106: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (1)
frontend/e2e/tests/console/app/resource-log.spec.ts (1)

58-157: Solid migration test flow and cleanup discipline

Good use of test.step, namespace isolation, readiness waits, and cleanup tracking. This is a strong Playwright translation pattern for cluster-backed e2e coverage.

Comment thread .claude/skills/migrate-cypress/SKILL.md
Comment thread .claude/skills/migrate-cypress/SKILL.md
Comment thread frontend/e2e/clients/kubernetes-client.ts
Comment thread frontend/e2e/pages/list-page.ts
Comment thread frontend/e2e/tests/console/app/resource-log.spec.ts
Comment thread frontend/e2e/tests/console/app/template.spec.ts Outdated
@stefanonardo stefanonardo force-pushed the CONSOLE-5235 branch 4 times, most recently from 42ef523 to 8810a34 Compare May 14, 2026 10:31
@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 17, 2026
@openshift-ci openshift-ci Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 18, 2026
@openshift-ci openshift-ci Bot added the component/core Related to console core functionality label May 18, 2026
@stefanonardo stefanonardo force-pushed the CONSOLE-5235 branch 4 times, most recently from fddfc04 to b2d42e0 Compare May 19, 2026 09:49
@stefanonardo
Copy link
Copy Markdown
Contributor Author

@CodeRabbit review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 19, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
frontend/e2e/pages/masthead-page.ts (1)

19-24: ⚡ Quick win

Use robustClick() consistently for masthead interactions.

Line 22, Line 33, Line 38, and Line 53 use direct .click(). In these menu/dropdown flows, using robustClick() consistently will better absorb transient overlays/re-renders and reduce flake.

As per coding guidelines frontend/e2e/pages/**/*.ts: Extend BasePage in Playwright page objects which provides robustClick(), waitForLoadingComplete(), and goTo().

Also applies to: 26-35, 37-39, 48-54

🤖 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/masthead-page.ts` around lines 19 - 24, The page object
should extend BasePage and use its robustClick helper rather than direct
.click() for masthead interactions: update the class declaration to extend
BasePage, replace direct .click() calls (e.g. in async openQuickCreate() using
quickCreateToggle and any other masthead locators referenced) with
this.robustClick(locator), and ensure you rely on BasePage methods like
waitForLoadingComplete() and goTo() where appropriate to follow the project e2e
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 @.claude/skills/debug-e2e/SKILL.md:
- Around line 2-10: Update the markdown heading to match the renamed skill by
replacing the existing "# Debug Test" heading with a heading that matches the
skill name "debug-e2e" (for example "# debug-e2e" or a more descriptive "# Debug
E2E (debug-e2e)") so the top-level heading aligns with the name: debug-e2e
declared in the file; locate the heading in the SKILL.md content and edit it
accordingly.

In `@frontend/e2e/pages/list-page.ts`:
- Around line 8-15: Replace the brittle class/OUIA locators with test-id-based
Playwright selectors: update dataViewCells, dataViewFilters, nameFilterInput,
and singleFilterGroup to use page.getByTestId('...') querying [data-test="..."]
(choose meaningful test ids like "data-view-cell", "data-view-filters",
"name-filter-input", "single-filter-group"); if any target element lacks a
data-test attribute, add data-test in the UI component (keep existing
legacy/class/OUIA attributes), and update any other similar locators in the file
(e.g., the ones noted around the rest of the file) to follow the same
page.getByTestId convention.

---

Nitpick comments:
In `@frontend/e2e/pages/masthead-page.ts`:
- Around line 19-24: The page object should extend BasePage and use its
robustClick helper rather than direct .click() for masthead interactions: update
the class declaration to extend BasePage, replace direct .click() calls (e.g. in
async openQuickCreate() using quickCreateToggle and any other masthead locators
referenced) with this.robustClick(locator), and ensure you rely on BasePage
methods like waitForLoadingComplete() and goTo() where appropriate to follow the
project e2e guidelines.
🪄 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 YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: e705fb20-6f31-4e42-939b-49c9a13120d5

📥 Commits

Reviewing files that changed from the base of the PR and between 06b20a5 and b2d42e0.

📒 Files selected for processing (15)
  • .claude/skills/debug-e2e/SKILL.md
  • frontend/e2e/clients/kubernetes-client.ts
  • frontend/e2e/pages/base-page.ts
  • frontend/e2e/pages/catalog-page.ts
  • frontend/e2e/pages/details-page.ts
  • frontend/e2e/pages/list-page.ts
  • frontend/e2e/pages/logs-page.ts
  • frontend/e2e/pages/masthead-page.ts
  • frontend/e2e/pages/overview-page.ts
  • frontend/e2e/tests/console/app/filtering-and-searching.spec.ts
  • frontend/e2e/tests/console/app/masthead.spec.ts
  • frontend/e2e/tests/console/app/node-terminal.spec.ts
  • frontend/e2e/tests/console/app/overview.spec.ts
  • frontend/e2e/tests/console/app/resource-log.spec.ts
  • frontend/e2e/tests/console/app/template.spec.ts
🚧 Files skipped from review as they are similar to previous changes (11)
  • frontend/e2e/tests/console/app/overview.spec.ts
  • frontend/e2e/pages/overview-page.ts
  • frontend/e2e/tests/console/app/node-terminal.spec.ts
  • frontend/e2e/clients/kubernetes-client.ts
  • frontend/e2e/pages/details-page.ts
  • frontend/e2e/tests/console/app/masthead.spec.ts
  • frontend/e2e/pages/logs-page.ts
  • frontend/e2e/tests/console/app/filtering-and-searching.spec.ts
  • frontend/e2e/tests/console/app/resource-log.spec.ts
  • frontend/e2e/pages/catalog-page.ts
  • frontend/e2e/tests/console/app/template.spec.ts
📜 Review details
🧰 Additional context used
📓 Path-based instructions (11)
frontend/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

frontend/**/*.{ts,tsx,js,jsx}: Never import from package index files (e.g., @console/shared) in new code, as they can create circular dependencies and slow builds. Import from specific file paths instead.
Do not use backticks in t() calls for i18n strings, as the i18n parser cannot extract keys from template literals. Use single or double quotes instead.

Files:

  • frontend/e2e/pages/base-page.ts
  • frontend/e2e/pages/masthead-page.ts
  • frontend/e2e/pages/list-page.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Never import from deprecated packages or use code with the @deprecated TSdoc tag in new code.

**/*.{ts,tsx}: Use React functional components with hooks instead of class components
State Management: Use React hooks and Context API (migrating away from legacy Redux/Immutable.js)
Hooks: Use existing hooks from console-shared when possible (useK8sWatchResource, useUserSettings, etc.)
API calls: Use k8s resource hooks for data fetching, consoleFetchJSON for HTTP requests
Extensions: Use console extension points for plugin integration
Types: Check existing types in console-shared before creating new ones
Dynamic Plugins: Use console extension points for plugin integration
Styling: Use SCSS modules co-located with components, PatternFly design system components, avoid any SCSS/CSS if possible
Accessibility: Follow WCAG 2.1 AA standards, use semantic HTML, ARIA labels where needed, ensure keyboard navigation, test with screen readers
i18n: Use useTranslation('namespace') hook with key format for translation keys
Error Handling: Use ErrorBoundary components and graceful degradation patterns
Optimize re-renders: Use useCallback for memoized callbacks to avoid function recreation every render
Optimize re-renders: Use useMemo for expensive computations to avoid recalculating on every render
Lazy loading: Use React.lazy() to lazy load heavy components
TypeScript type safety: Avoid using any type; suggest proper type definitions and verify null/undefined are handled properly
Type component props properly: Reuse existing component prop types instead of duplicating type definitions
Use proper hooks: Use specialized hooks like usePluginInfo for plugin data instead of generic data fetching patterns
Avoid deprecated components: Check for JSDoc @deprecated tags, import paths containing /deprecated, and DEPRECATED_ file name prefix before using components
Importing from barrel files and circular dependencies: Import directly from specific files instead...

Files:

  • frontend/e2e/pages/base-page.ts
  • frontend/e2e/pages/masthead-page.ts
  • frontend/e2e/pages/list-page.ts
frontend/**/*.{ts,tsx,js,jsx,json}

📄 CodeRabbit inference engine (AGENTS.md)

Never use absolute URLs or paths in the console code. The console runs behind a proxy under an arbitrary path.

Files:

  • frontend/e2e/pages/base-page.ts
  • frontend/e2e/pages/masthead-page.ts
  • frontend/e2e/pages/list-page.ts
frontend/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

When writing code for static plugins, ensure that all $codeRef reference the corresponding extension type from the @console/dynamic-plugin-sdk package.

Files:

  • frontend/e2e/pages/base-page.ts
  • frontend/e2e/pages/masthead-page.ts
  • frontend/e2e/pages/list-page.ts
**/*.{tsx,ts}

📄 CodeRabbit inference engine (TESTING.md)

**/*.{tsx,ts}: Always use page.getByTestId('x') for Playwright selectors which queries [data-test="x"]. If a React element only has a legacy test attribute, add data-test to the element. Never remove legacy attributes
Prefer data-test attributes in Cypress selectors (e.g., cy.get('[data-test="create-deployment"]')) over brittle CSS/ARIA selectors

File Naming: PascalCase for components, kebab-case for utilities, *.spec.ts(x) for tests

Files:

  • frontend/e2e/pages/base-page.ts
  • frontend/e2e/pages/masthead-page.ts
  • frontend/e2e/pages/list-page.ts
frontend/e2e/pages/**/*.ts

📄 CodeRabbit inference engine (TESTING.md)

Extend BasePage in Playwright page objects which provides robustClick(), waitForLoadingComplete(), and goTo(). Locators are private readonly properties; actions are async methods

Files:

  • frontend/e2e/pages/base-page.ts
  • frontend/e2e/pages/masthead-page.ts
  • frontend/e2e/pages/list-page.ts
**/*.{go,ts,tsx,js,jsx}

📄 CodeRabbit inference engine (STYLEGUIDE.md)

Use lowercase dash-separated names for all files to avoid git issues with case-insensitive file systems

Files:

  • frontend/e2e/pages/base-page.ts
  • frontend/e2e/pages/masthead-page.ts
  • frontend/e2e/pages/list-page.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (STYLEGUIDE.md)

**/*.{ts,tsx,js,jsx}: New code MUST be written in TypeScript, not JavaScript
Prefer functional programming patterns and immutable data structures
Run the linter and follow all rules defined in .eslintrc
Never use absolute paths in code - the app should be able to run behind a proxy under an arbitrary path

Files:

  • frontend/e2e/pages/base-page.ts
  • frontend/e2e/pages/masthead-page.ts
  • frontend/e2e/pages/list-page.ts
**/*.ts

📄 CodeRabbit inference engine (STYLEGUIDE.md)

Plugin SDK Changes: Any updates to console-dynamic-plugin-sdk should aim to maintain backward compatibility as it's a public API - use the plugin-api-review skill to vet changes for public API impact and ensure proper documentation updates

Files:

  • frontend/e2e/pages/base-page.ts
  • frontend/e2e/pages/masthead-page.ts
  • frontend/e2e/pages/list-page.ts
frontend/**/*.{js,ts,tsx}

📄 CodeRabbit inference engine (README.md)

frontend/**/*.{js,ts,tsx}: Support only the latest versions of Edge, Chrome, Safari, and Firefox browsers; IE 11 and earlier are not supported
CSP violations should be automatically reported to telemetry by parsing dynamic plugin names from securitypolicyviolation events, with throttling to prevent duplicate reports within a day

Files:

  • frontend/e2e/pages/base-page.ts
  • frontend/e2e/pages/masthead-page.ts
  • frontend/e2e/pages/list-page.ts
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (INTERNATIONALIZATION.md)

For dynamic translation keys that cannot be parsed by i18next-parser (t(key), t('key' + id), t(key${id})), specify possible static values in comments for the parser to extract

Files:

  • frontend/e2e/pages/base-page.ts
  • frontend/e2e/pages/masthead-page.ts
  • frontend/e2e/pages/list-page.ts
🪛 ast-grep (0.42.2)
frontend/e2e/pages/list-page.ts

[warning] 64-64: Regular expression constructed from variable input detected. This can lead to Regular Expression Denial of Service (ReDoS) attacks if the variable contains malicious patterns. Use libraries like 'recheck' to validate regex safety or use static patterns.
Context: new RegExp(pattern.source, safeFlags)
Note: [CWE-1333] Inefficient Regular Expression Complexity [REFERENCES]
- https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS
- https://cwe.mitre.org/data/definitions/1333.html

(regexp-from-variable)

🪛 LanguageTool
.claude/skills/debug-e2e/SKILL.md

[style] ~105-~105: The adverb ‘sometimes’ is usually put before the verb ‘passes’.
Context: ...structure setup first. ### Flaky test (passes sometimes, fails sometimes) If a test passes on ...

(ADVERB_WORD_ORDER)

🔇 Additional comments (3)
frontend/e2e/pages/base-page.ts (1)

36-39: LGTM!

frontend/e2e/pages/masthead-page.ts (1)

5-18: LGTM!

Also applies to: 41-47, 56-59

frontend/e2e/pages/list-page.ts (1)

63-76: LGTM!

Comment thread .claude/skills/debug-e2e/SKILL.md
Comment thread frontend/e2e/pages/list-page.ts
@stefanonardo
Copy link
Copy Markdown
Contributor Author

/retest

@stefanonardo stefanonardo force-pushed the CONSOLE-5235 branch 2 times, most recently from a4685f9 to 926c556 Compare May 19, 2026 14:23
@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 19, 2026
@openshift-ci openshift-ci Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 20, 2026
Comment on lines -61 to -62
expect: {
timeout: 40_000,
Copy link
Copy Markdown
Contributor Author

@stefanonardo stefanonardo May 20, 2026

Choose a reason for hiding this comment

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

I think we should keep the default value to speed up the (failing) tests and increase it only when needed

@stefanonardo
Copy link
Copy Markdown
Contributor Author

@CodeRabbit help

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 20, 2026

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

CodeRabbit commands

These commands are invoked using PR/Issue comments.

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai rate limit to show your current review rate limit status.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai evaluate custom pre-merge check --instructions <custom-checks-instructions> --name <custom-checks-title> [--mode <error|warning>] to validate the custom pre-merge checks instructions. Defaults to error when --mode is omitted.
  • @coderabbitai ignore pre-merge checks to override pre-merge checks and get an approval on PR.
  • @coderabbitai run pre-merge checks to run pre-merge checks on the pull request.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve merge conflict to automatically resolve merge conflicts.
  • @coderabbitai autofix to automatically fix issues identified in unresolved review comments.
  • @coderabbitai resolve to resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai generate configuration to create a PR that adds the current resolved configuration as .coderabbit.yaml (or show it if already present).
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, support, documentation and community

  • Visit our status page to check the current availability of CodeRabbit.
  • Create a ticket on our support page for assistance with any issues or questions.
  • Visit our documentation site for detailed information on how to use CodeRabbit.
  • Join our Discord community to connect with other users and get help from the community.
  • Follow us on X/Twitter for updates and announcements.

@stefanonardo
Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 20, 2026

✅ Actions performed

Full review triggered.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (3)
frontend/e2e/pages/logs-page.ts (1)

7-15: ⚡ Quick win

Keep page-object locators private and expose intent methods/assertion helpers instead.

lineCount, searchMatches, and logText are public locators. Please keep locators private readonly and expose dedicated methods for assertions/actions to preserve page-object boundaries.

As per coding guidelines: “frontend/e2e/pages/**/*.ts: … Locators are private readonly properties; actions are async methods.”

🤖 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/logs-page.ts` around lines 7 - 15, Change the public
locators lineCount, searchMatches, and logText to private readonly properties
and replace external access with intent-focused methods on the page object: add
an async getLineCount() or assertLineCount(expected) to read/validate lineCount,
add async getSearchMatchesCount() or assertHasSearchMatches(count) to
interact/assert searchMatches, and add async getLogText() or
assertLogContains(text) to read/assert logText; update any tests to call these
new methods instead of referencing the locators directly so the page-object
keeps locators private (refer to the existing properties lineCount,
searchMatches, logText and the page class where they are declared to locate and
modify them).
frontend/e2e/tests/console/app/masthead.spec.ts (1)

52-55: ⚡ Quick win

Use a narrower assertion target than body for token-page verification.

Line 54 can pass on unrelated page content. Prefer asserting a specific element (ideally getByTestId(...)) on the token display page to reduce false positives.

🤖 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/app/masthead.spec.ts` around lines 52 - 55, The
token display page verification is using a broad `body` text assertion that can
match unrelated content. Update the `Verify token display page` step in
`masthead.spec.ts` to assert against a more specific element on the token page,
preferably via `page.getByTestId(...)` (or another unique locator) instead of
`page.locator('body')`, so the check is tied to the actual token display UI.
frontend/e2e/pages/details-page.ts (1)

9-13: ⚡ Quick win

Keep page-object locators private and expose intent via methods/getters only.

nodeTerminalError and xtermViewport are currently public locator fields. For consistency with the page-object contract, make locators private readonly and expose access through explicit getters/actions.

As per coding guidelines: “frontend/e2e/pages/**/*.ts: Locators are private readonly properties; actions are async methods”.

🤖 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/details-page.ts` around lines 9 - 13, Change the public
locator fields nodeTerminalError and xtermViewport to private readonly
properties and replace any direct usage with public getters or async action
methods that return or act on these locators; update their declarations in the
class (e.g., change "nodeTerminalError: Locator" and "xtermViewport: Locator" to
"private readonly nodeTerminalError" and "private readonly xtermViewport") and
add explicit getters/actions (e.g., getNodeTerminalError() or async
hasNodeTerminalError(), getXtermViewport(), etc.) so callers use the
intent-based API instead of accessing locators directly (ensure existing usages
of resourceTitle remain consistent with the getter pattern).
🤖 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/pages/catalog-page.ts`:
- Around line 6-23: Replace brittle selectors by switching the filterInput and
catalogItemIcon locators to use getByTestId backed by data-test attributes:
update the private filterInput (used in navigateToCatalog and filterByKeyword)
to this.page.getByTestId('your-filter-testid') and change catalogItemIcon (used
by catalogItemIcon(testId)) to return
this.catalogItem(testId).getByTestId('catalog-icon-testid') (or a per-item
data-test attribute). Ensure the page elements have corresponding data-test
attributes in the app, and keep the existing waitFor/timeout logic in
navigateToCatalog and fill logic in filterByKeyword untouched.

In `@frontend/e2e/pages/logs-page.ts`:
- Around line 13-15: Replace fragile placeholder/class selectors in the LogsPage
by switching the SearchLogs selectors to stable data-test hooks: change usages
of this.page.getByPlaceholder('Search logs') to
this.page.getByTestId('search-logs') for the searchInput, replace
this.page.locator('.pf-m-match') with this.page.getByTestId('log-match') for
searchMatches, and replace
this.page.locator('span[class$="c-log-viewer__text"]') with
this.page.getByTestId('log-text') for logText; if the corresponding React
elements lack data-test attributes add data-test="search-logs",
data-test="log-match", and data-test="log-text" to those elements so the
Playwright selectors are stable.

In `@frontend/e2e/pages/overview-page.ts`:
- Around line 52-67: labelCell currently uses a substring hasText match which
can return multiple rows; update labelCell(name) to perform an exact-text match
(e.g., use getByText(name, { exact: true }) or a hasText regex anchored to
^name$) so it only selects the intended cell, and update clickListItem(name) to
call .first() or assert there is exactly one match before .click() to avoid
flakiness; target the labelCell and clickListItem functions for this change.

In `@frontend/e2e/tests/console/app/filtering-and-searching.spec.ts`:
- Around line 20-62: The test suite currently creates shared resources in
test.beforeAll (ns, workloadName, createClient, waitForDeploymentReady) and
deletes them in test.afterAll; change this to per-test lifecycle by moving
namespace/deployment creation into each test or test.beforeEach and register
cleanup with the cleanup fixture so each test gets its own ns/workloadName and
the cleanup fixture deletes them automatically; replace usages of
test.beforeAll/test.afterAll that create/delete the namespace and deployment
with per-test creation (using createClient, createNamespace, createDeployment,
waitForDeploymentReady) and call cleanup.add or the appropriate cleanup fixture
method to delete the namespace/workload after each test.

---

Nitpick comments:
In `@frontend/e2e/pages/details-page.ts`:
- Around line 9-13: Change the public locator fields nodeTerminalError and
xtermViewport to private readonly properties and replace any direct usage with
public getters or async action methods that return or act on these locators;
update their declarations in the class (e.g., change "nodeTerminalError:
Locator" and "xtermViewport: Locator" to "private readonly nodeTerminalError"
and "private readonly xtermViewport") and add explicit getters/actions (e.g.,
getNodeTerminalError() or async hasNodeTerminalError(), getXtermViewport(),
etc.) so callers use the intent-based API instead of accessing locators directly
(ensure existing usages of resourceTitle remain consistent with the getter
pattern).

In `@frontend/e2e/pages/logs-page.ts`:
- Around line 7-15: Change the public locators lineCount, searchMatches, and
logText to private readonly properties and replace external access with
intent-focused methods on the page object: add an async getLineCount() or
assertLineCount(expected) to read/validate lineCount, add async
getSearchMatchesCount() or assertHasSearchMatches(count) to interact/assert
searchMatches, and add async getLogText() or assertLogContains(text) to
read/assert logText; update any tests to call these new methods instead of
referencing the locators directly so the page-object keeps locators private
(refer to the existing properties lineCount, searchMatches, logText and the page
class where they are declared to locate and modify them).

In `@frontend/e2e/tests/console/app/masthead.spec.ts`:
- Around line 52-55: The token display page verification is using a broad `body`
text assertion that can match unrelated content. Update the `Verify token
display page` step in `masthead.spec.ts` to assert against a more specific
element on the token page, preferably via `page.getByTestId(...)` (or another
unique locator) instead of `page.locator('body')`, so the check is tied to the
actual token display UI.
🪄 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 YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 4c164179-698f-4b3c-bd45-289be55dd674

📥 Commits

Reviewing files that changed from the base of the PR and between 226ddf9 and 19e532c.

📒 Files selected for processing (37)
  • .claude/migration-context.md
  • .claude/skills/debug-e2e/SKILL.md
  • frontend/e2e/clients/kubernetes-client.ts
  • frontend/e2e/pages/base-page.ts
  • frontend/e2e/pages/catalog-page.ts
  • frontend/e2e/pages/details-page.ts
  • frontend/e2e/pages/list-page.ts
  • frontend/e2e/pages/logs-page.ts
  • frontend/e2e/pages/masthead-page.ts
  • frontend/e2e/pages/overview-page.ts
  • frontend/e2e/tests/console/app/filtering-and-searching.spec.ts
  • frontend/e2e/tests/console/app/masthead.spec.ts
  • frontend/e2e/tests/console/app/node-terminal.spec.ts
  • frontend/e2e/tests/console/app/overview.spec.ts
  • frontend/e2e/tests/console/app/resource-log.spec.ts
  • frontend/e2e/tests/console/app/template.spec.ts
  • frontend/e2e/tests/console/cluster-settings/channel-modal.spec.ts
  • frontend/e2e/tests/console/cluster-settings/update-in-progress.spec.ts
  • frontend/e2e/tests/console/cluster-settings/update-modal.spec.ts
  • frontend/e2e/tests/console/cluster-settings/updates-graph.spec.ts
  • frontend/e2e/tests/console/cluster-settings/upgradeable-false.spec.ts
  • frontend/e2e/tests/console/cluster-settings/worker-mcp-paused.spec.ts
  • frontend/packages/integration-tests/fixtures/httpd-example-template.yaml
  • frontend/packages/integration-tests/fixtures/pod-with-space.yaml
  • frontend/packages/integration-tests/fixtures/pod-with-wrap-annotation.yaml
  • frontend/packages/integration-tests/tests/app/filtering-and-searching.cy.ts
  • frontend/packages/integration-tests/tests/app/masthead.cy.ts
  • frontend/packages/integration-tests/tests/app/node-terminal.cy.ts
  • frontend/packages/integration-tests/tests/app/overview.cy.ts
  • frontend/packages/integration-tests/tests/app/resource-log.cy.ts
  • frontend/packages/integration-tests/tests/app/template.cy.ts
  • frontend/packages/integration-tests/views/catalogs.ts
  • frontend/packages/integration-tests/views/logs.ts
  • frontend/packages/integration-tests/views/overview.ts
  • frontend/playwright.config.ts
  • frontend/public/components/utils/container-select.tsx
  • frontend/public/components/utils/resource-log.tsx
💤 Files with no reviewable changes (13)
  • frontend/packages/integration-tests/views/overview.ts
  • frontend/packages/integration-tests/tests/app/masthead.cy.ts
  • frontend/packages/integration-tests/tests/app/filtering-and-searching.cy.ts
  • frontend/packages/integration-tests/tests/app/node-terminal.cy.ts
  • frontend/playwright.config.ts
  • frontend/packages/integration-tests/tests/app/overview.cy.ts
  • frontend/packages/integration-tests/views/catalogs.ts
  • frontend/packages/integration-tests/tests/app/resource-log.cy.ts
  • frontend/packages/integration-tests/views/logs.ts
  • frontend/packages/integration-tests/fixtures/pod-with-wrap-annotation.yaml
  • frontend/packages/integration-tests/tests/app/template.cy.ts
  • frontend/packages/integration-tests/fixtures/httpd-example-template.yaml
  • frontend/packages/integration-tests/fixtures/pod-with-space.yaml
📜 Review details
🧰 Additional context used
📓 Path-based instructions (13)
frontend/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

frontend/**/*.{ts,tsx,js,jsx}: Never import from package index files (e.g., @console/shared) in new code, as they can create circular dependencies and slow builds. Import from specific file paths instead.
Do not use backticks in t() calls for i18n strings, as the i18n parser cannot extract keys from template literals. Use single or double quotes instead.

Files:

  • frontend/e2e/tests/console/cluster-settings/update-in-progress.spec.ts
  • frontend/e2e/tests/console/cluster-settings/updates-graph.spec.ts
  • frontend/e2e/tests/console/app/template.spec.ts
  • frontend/public/components/utils/container-select.tsx
  • frontend/e2e/tests/console/cluster-settings/channel-modal.spec.ts
  • frontend/e2e/tests/console/cluster-settings/worker-mcp-paused.spec.ts
  • frontend/e2e/tests/console/app/overview.spec.ts
  • frontend/e2e/tests/console/app/node-terminal.spec.ts
  • frontend/e2e/pages/base-page.ts
  • frontend/e2e/pages/catalog-page.ts
  • frontend/e2e/pages/logs-page.ts
  • frontend/e2e/tests/console/cluster-settings/upgradeable-false.spec.ts
  • frontend/e2e/tests/console/app/masthead.spec.ts
  • frontend/e2e/tests/console/app/resource-log.spec.ts
  • frontend/e2e/tests/console/cluster-settings/update-modal.spec.ts
  • frontend/public/components/utils/resource-log.tsx
  • frontend/e2e/tests/console/app/filtering-and-searching.spec.ts
  • frontend/e2e/pages/details-page.ts
  • frontend/e2e/clients/kubernetes-client.ts
  • frontend/e2e/pages/masthead-page.ts
  • frontend/e2e/pages/overview-page.ts
  • frontend/e2e/pages/list-page.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Never import from deprecated packages or use code with the @deprecated TSdoc tag in new code.

**/*.{ts,tsx}: Use React functional components with hooks instead of class components
State Management: Use React hooks and Context API (migrating away from legacy Redux/Immutable.js)
Hooks: Use existing hooks from console-shared when possible (useK8sWatchResource, useUserSettings, etc.)
API calls: Use k8s resource hooks for data fetching, consoleFetchJSON for HTTP requests
Extensions: Use console extension points for plugin integration
Types: Check existing types in console-shared before creating new ones
Dynamic Plugins: Use console extension points for plugin integration
Styling: Use SCSS modules co-located with components, PatternFly design system components, avoid any SCSS/CSS if possible
Accessibility: Follow WCAG 2.1 AA standards, use semantic HTML, ARIA labels where needed, ensure keyboard navigation, test with screen readers
i18n: Use useTranslation('namespace') hook with key format for translation keys
Error Handling: Use ErrorBoundary components and graceful degradation patterns
Optimize re-renders: Use useCallback for memoized callbacks to avoid function recreation every render
Optimize re-renders: Use useMemo for expensive computations to avoid recalculating on every render
Lazy loading: Use React.lazy() to lazy load heavy components
TypeScript type safety: Avoid using any type; suggest proper type definitions and verify null/undefined are handled properly
Type component props properly: Reuse existing component prop types instead of duplicating type definitions
Use proper hooks: Use specialized hooks like usePluginInfo for plugin data instead of generic data fetching patterns
Avoid deprecated components: Check for JSDoc @deprecated tags, import paths containing /deprecated, and DEPRECATED_ file name prefix before using components
Importing from barrel files and circular dependencies: Import directly from specific files instead...

Files:

  • frontend/e2e/tests/console/cluster-settings/update-in-progress.spec.ts
  • frontend/e2e/tests/console/cluster-settings/updates-graph.spec.ts
  • frontend/e2e/tests/console/app/template.spec.ts
  • frontend/public/components/utils/container-select.tsx
  • frontend/e2e/tests/console/cluster-settings/channel-modal.spec.ts
  • frontend/e2e/tests/console/cluster-settings/worker-mcp-paused.spec.ts
  • frontend/e2e/tests/console/app/overview.spec.ts
  • frontend/e2e/tests/console/app/node-terminal.spec.ts
  • frontend/e2e/pages/base-page.ts
  • frontend/e2e/pages/catalog-page.ts
  • frontend/e2e/pages/logs-page.ts
  • frontend/e2e/tests/console/cluster-settings/upgradeable-false.spec.ts
  • frontend/e2e/tests/console/app/masthead.spec.ts
  • frontend/e2e/tests/console/app/resource-log.spec.ts
  • frontend/e2e/tests/console/cluster-settings/update-modal.spec.ts
  • frontend/public/components/utils/resource-log.tsx
  • frontend/e2e/tests/console/app/filtering-and-searching.spec.ts
  • frontend/e2e/pages/details-page.ts
  • frontend/e2e/clients/kubernetes-client.ts
  • frontend/e2e/pages/masthead-page.ts
  • frontend/e2e/pages/overview-page.ts
  • frontend/e2e/pages/list-page.ts
frontend/**/*.{ts,tsx,js,jsx,json}

📄 CodeRabbit inference engine (AGENTS.md)

Never use absolute URLs or paths in the console code. The console runs behind a proxy under an arbitrary path.

Files:

  • frontend/e2e/tests/console/cluster-settings/update-in-progress.spec.ts
  • frontend/e2e/tests/console/cluster-settings/updates-graph.spec.ts
  • frontend/e2e/tests/console/app/template.spec.ts
  • frontend/public/components/utils/container-select.tsx
  • frontend/e2e/tests/console/cluster-settings/channel-modal.spec.ts
  • frontend/e2e/tests/console/cluster-settings/worker-mcp-paused.spec.ts
  • frontend/e2e/tests/console/app/overview.spec.ts
  • frontend/e2e/tests/console/app/node-terminal.spec.ts
  • frontend/e2e/pages/base-page.ts
  • frontend/e2e/pages/catalog-page.ts
  • frontend/e2e/pages/logs-page.ts
  • frontend/e2e/tests/console/cluster-settings/upgradeable-false.spec.ts
  • frontend/e2e/tests/console/app/masthead.spec.ts
  • frontend/e2e/tests/console/app/resource-log.spec.ts
  • frontend/e2e/tests/console/cluster-settings/update-modal.spec.ts
  • frontend/public/components/utils/resource-log.tsx
  • frontend/e2e/tests/console/app/filtering-and-searching.spec.ts
  • frontend/e2e/pages/details-page.ts
  • frontend/e2e/clients/kubernetes-client.ts
  • frontend/e2e/pages/masthead-page.ts
  • frontend/e2e/pages/overview-page.ts
  • frontend/e2e/pages/list-page.ts
frontend/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

When writing code for static plugins, ensure that all $codeRef reference the corresponding extension type from the @console/dynamic-plugin-sdk package.

Files:

  • frontend/e2e/tests/console/cluster-settings/update-in-progress.spec.ts
  • frontend/e2e/tests/console/cluster-settings/updates-graph.spec.ts
  • frontend/e2e/tests/console/app/template.spec.ts
  • frontend/public/components/utils/container-select.tsx
  • frontend/e2e/tests/console/cluster-settings/channel-modal.spec.ts
  • frontend/e2e/tests/console/cluster-settings/worker-mcp-paused.spec.ts
  • frontend/e2e/tests/console/app/overview.spec.ts
  • frontend/e2e/tests/console/app/node-terminal.spec.ts
  • frontend/e2e/pages/base-page.ts
  • frontend/e2e/pages/catalog-page.ts
  • frontend/e2e/pages/logs-page.ts
  • frontend/e2e/tests/console/cluster-settings/upgradeable-false.spec.ts
  • frontend/e2e/tests/console/app/masthead.spec.ts
  • frontend/e2e/tests/console/app/resource-log.spec.ts
  • frontend/e2e/tests/console/cluster-settings/update-modal.spec.ts
  • frontend/public/components/utils/resource-log.tsx
  • frontend/e2e/tests/console/app/filtering-and-searching.spec.ts
  • frontend/e2e/pages/details-page.ts
  • frontend/e2e/clients/kubernetes-client.ts
  • frontend/e2e/pages/masthead-page.ts
  • frontend/e2e/pages/overview-page.ts
  • frontend/e2e/pages/list-page.ts
frontend/e2e/tests/**/*.spec.ts

📄 CodeRabbit inference engine (TESTING.md)

frontend/e2e/tests/**/*.spec.ts: E2E tests must validate full user workflows against a real OpenShift cluster using Playwright, located in frontend/e2e/tests/<package>/
Each Playwright E2E test block must create its own resources, assert independently, and clean up via the cleanup fixture
Use KubernetesClient for cluster interactions in Playwright tests - never use shell commands in tests
Import test and expect from e2e/fixtures, not from @playwright/test. Custom fixtures provide cleanup, testConfig, and k8sClient

Files:

  • frontend/e2e/tests/console/cluster-settings/update-in-progress.spec.ts
  • frontend/e2e/tests/console/cluster-settings/updates-graph.spec.ts
  • frontend/e2e/tests/console/app/template.spec.ts
  • frontend/e2e/tests/console/cluster-settings/channel-modal.spec.ts
  • frontend/e2e/tests/console/cluster-settings/worker-mcp-paused.spec.ts
  • frontend/e2e/tests/console/app/overview.spec.ts
  • frontend/e2e/tests/console/app/node-terminal.spec.ts
  • frontend/e2e/tests/console/cluster-settings/upgradeable-false.spec.ts
  • frontend/e2e/tests/console/app/masthead.spec.ts
  • frontend/e2e/tests/console/app/resource-log.spec.ts
  • frontend/e2e/tests/console/cluster-settings/update-modal.spec.ts
  • frontend/e2e/tests/console/app/filtering-and-searching.spec.ts
**/*.{tsx,ts}

📄 CodeRabbit inference engine (TESTING.md)

**/*.{tsx,ts}: Always use page.getByTestId('x') for Playwright selectors which queries [data-test="x"]. If a React element only has a legacy test attribute, add data-test to the element. Never remove legacy attributes
Prefer data-test attributes in Cypress selectors (e.g., cy.get('[data-test="create-deployment"]')) over brittle CSS/ARIA selectors

File Naming: PascalCase for components, kebab-case for utilities, *.spec.ts(x) for tests

Files:

  • frontend/e2e/tests/console/cluster-settings/update-in-progress.spec.ts
  • frontend/e2e/tests/console/cluster-settings/updates-graph.spec.ts
  • frontend/e2e/tests/console/app/template.spec.ts
  • frontend/public/components/utils/container-select.tsx
  • frontend/e2e/tests/console/cluster-settings/channel-modal.spec.ts
  • frontend/e2e/tests/console/cluster-settings/worker-mcp-paused.spec.ts
  • frontend/e2e/tests/console/app/overview.spec.ts
  • frontend/e2e/tests/console/app/node-terminal.spec.ts
  • frontend/e2e/pages/base-page.ts
  • frontend/e2e/pages/catalog-page.ts
  • frontend/e2e/pages/logs-page.ts
  • frontend/e2e/tests/console/cluster-settings/upgradeable-false.spec.ts
  • frontend/e2e/tests/console/app/masthead.spec.ts
  • frontend/e2e/tests/console/app/resource-log.spec.ts
  • frontend/e2e/tests/console/cluster-settings/update-modal.spec.ts
  • frontend/public/components/utils/resource-log.tsx
  • frontend/e2e/tests/console/app/filtering-and-searching.spec.ts
  • frontend/e2e/pages/details-page.ts
  • frontend/e2e/clients/kubernetes-client.ts
  • frontend/e2e/pages/masthead-page.ts
  • frontend/e2e/pages/overview-page.ts
  • frontend/e2e/pages/list-page.ts
**/*.{go,ts,tsx,js,jsx}

📄 CodeRabbit inference engine (STYLEGUIDE.md)

Use lowercase dash-separated names for all files to avoid git issues with case-insensitive file systems

Files:

  • frontend/e2e/tests/console/cluster-settings/update-in-progress.spec.ts
  • frontend/e2e/tests/console/cluster-settings/updates-graph.spec.ts
  • frontend/e2e/tests/console/app/template.spec.ts
  • frontend/public/components/utils/container-select.tsx
  • frontend/e2e/tests/console/cluster-settings/channel-modal.spec.ts
  • frontend/e2e/tests/console/cluster-settings/worker-mcp-paused.spec.ts
  • frontend/e2e/tests/console/app/overview.spec.ts
  • frontend/e2e/tests/console/app/node-terminal.spec.ts
  • frontend/e2e/pages/base-page.ts
  • frontend/e2e/pages/catalog-page.ts
  • frontend/e2e/pages/logs-page.ts
  • frontend/e2e/tests/console/cluster-settings/upgradeable-false.spec.ts
  • frontend/e2e/tests/console/app/masthead.spec.ts
  • frontend/e2e/tests/console/app/resource-log.spec.ts
  • frontend/e2e/tests/console/cluster-settings/update-modal.spec.ts
  • frontend/public/components/utils/resource-log.tsx
  • frontend/e2e/tests/console/app/filtering-and-searching.spec.ts
  • frontend/e2e/pages/details-page.ts
  • frontend/e2e/clients/kubernetes-client.ts
  • frontend/e2e/pages/masthead-page.ts
  • frontend/e2e/pages/overview-page.ts
  • frontend/e2e/pages/list-page.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (STYLEGUIDE.md)

**/*.{ts,tsx,js,jsx}: New code MUST be written in TypeScript, not JavaScript
Prefer functional programming patterns and immutable data structures
Run the linter and follow all rules defined in .eslintrc
Never use absolute paths in code - the app should be able to run behind a proxy under an arbitrary path

Files:

  • frontend/e2e/tests/console/cluster-settings/update-in-progress.spec.ts
  • frontend/e2e/tests/console/cluster-settings/updates-graph.spec.ts
  • frontend/e2e/tests/console/app/template.spec.ts
  • frontend/public/components/utils/container-select.tsx
  • frontend/e2e/tests/console/cluster-settings/channel-modal.spec.ts
  • frontend/e2e/tests/console/cluster-settings/worker-mcp-paused.spec.ts
  • frontend/e2e/tests/console/app/overview.spec.ts
  • frontend/e2e/tests/console/app/node-terminal.spec.ts
  • frontend/e2e/pages/base-page.ts
  • frontend/e2e/pages/catalog-page.ts
  • frontend/e2e/pages/logs-page.ts
  • frontend/e2e/tests/console/cluster-settings/upgradeable-false.spec.ts
  • frontend/e2e/tests/console/app/masthead.spec.ts
  • frontend/e2e/tests/console/app/resource-log.spec.ts
  • frontend/e2e/tests/console/cluster-settings/update-modal.spec.ts
  • frontend/public/components/utils/resource-log.tsx
  • frontend/e2e/tests/console/app/filtering-and-searching.spec.ts
  • frontend/e2e/pages/details-page.ts
  • frontend/e2e/clients/kubernetes-client.ts
  • frontend/e2e/pages/masthead-page.ts
  • frontend/e2e/pages/overview-page.ts
  • frontend/e2e/pages/list-page.ts
**/*.spec.{ts,tsx}

📄 CodeRabbit inference engine (STYLEGUIDE.md)

Tests should follow a similar 'test tables' convention as used in Go where applicable

Files:

  • frontend/e2e/tests/console/cluster-settings/update-in-progress.spec.ts
  • frontend/e2e/tests/console/cluster-settings/updates-graph.spec.ts
  • frontend/e2e/tests/console/app/template.spec.ts
  • frontend/e2e/tests/console/cluster-settings/channel-modal.spec.ts
  • frontend/e2e/tests/console/cluster-settings/worker-mcp-paused.spec.ts
  • frontend/e2e/tests/console/app/overview.spec.ts
  • frontend/e2e/tests/console/app/node-terminal.spec.ts
  • frontend/e2e/tests/console/cluster-settings/upgradeable-false.spec.ts
  • frontend/e2e/tests/console/app/masthead.spec.ts
  • frontend/e2e/tests/console/app/resource-log.spec.ts
  • frontend/e2e/tests/console/cluster-settings/update-modal.spec.ts
  • frontend/e2e/tests/console/app/filtering-and-searching.spec.ts
**/*.ts

📄 CodeRabbit inference engine (STYLEGUIDE.md)

Plugin SDK Changes: Any updates to console-dynamic-plugin-sdk should aim to maintain backward compatibility as it's a public API - use the plugin-api-review skill to vet changes for public API impact and ensure proper documentation updates

Files:

  • frontend/e2e/tests/console/cluster-settings/update-in-progress.spec.ts
  • frontend/e2e/tests/console/cluster-settings/updates-graph.spec.ts
  • frontend/e2e/tests/console/app/template.spec.ts
  • frontend/e2e/tests/console/cluster-settings/channel-modal.spec.ts
  • frontend/e2e/tests/console/cluster-settings/worker-mcp-paused.spec.ts
  • frontend/e2e/tests/console/app/overview.spec.ts
  • frontend/e2e/tests/console/app/node-terminal.spec.ts
  • frontend/e2e/pages/base-page.ts
  • frontend/e2e/pages/catalog-page.ts
  • frontend/e2e/pages/logs-page.ts
  • frontend/e2e/tests/console/cluster-settings/upgradeable-false.spec.ts
  • frontend/e2e/tests/console/app/masthead.spec.ts
  • frontend/e2e/tests/console/app/resource-log.spec.ts
  • frontend/e2e/tests/console/cluster-settings/update-modal.spec.ts
  • frontend/e2e/tests/console/app/filtering-and-searching.spec.ts
  • frontend/e2e/pages/details-page.ts
  • frontend/e2e/clients/kubernetes-client.ts
  • frontend/e2e/pages/masthead-page.ts
  • frontend/e2e/pages/overview-page.ts
  • frontend/e2e/pages/list-page.ts
frontend/**/*.{js,ts,tsx}

📄 CodeRabbit inference engine (README.md)

frontend/**/*.{js,ts,tsx}: Support only the latest versions of Edge, Chrome, Safari, and Firefox browsers; IE 11 and earlier are not supported
CSP violations should be automatically reported to telemetry by parsing dynamic plugin names from securitypolicyviolation events, with throttling to prevent duplicate reports within a day

Files:

  • frontend/e2e/tests/console/cluster-settings/update-in-progress.spec.ts
  • frontend/e2e/tests/console/cluster-settings/updates-graph.spec.ts
  • frontend/e2e/tests/console/app/template.spec.ts
  • frontend/public/components/utils/container-select.tsx
  • frontend/e2e/tests/console/cluster-settings/channel-modal.spec.ts
  • frontend/e2e/tests/console/cluster-settings/worker-mcp-paused.spec.ts
  • frontend/e2e/tests/console/app/overview.spec.ts
  • frontend/e2e/tests/console/app/node-terminal.spec.ts
  • frontend/e2e/pages/base-page.ts
  • frontend/e2e/pages/catalog-page.ts
  • frontend/e2e/pages/logs-page.ts
  • frontend/e2e/tests/console/cluster-settings/upgradeable-false.spec.ts
  • frontend/e2e/tests/console/app/masthead.spec.ts
  • frontend/e2e/tests/console/app/resource-log.spec.ts
  • frontend/e2e/tests/console/cluster-settings/update-modal.spec.ts
  • frontend/public/components/utils/resource-log.tsx
  • frontend/e2e/tests/console/app/filtering-and-searching.spec.ts
  • frontend/e2e/pages/details-page.ts
  • frontend/e2e/clients/kubernetes-client.ts
  • frontend/e2e/pages/masthead-page.ts
  • frontend/e2e/pages/overview-page.ts
  • frontend/e2e/pages/list-page.ts
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (INTERNATIONALIZATION.md)

For dynamic translation keys that cannot be parsed by i18next-parser (t(key), t('key' + id), t(key${id})), specify possible static values in comments for the parser to extract

Files:

  • frontend/e2e/tests/console/cluster-settings/update-in-progress.spec.ts
  • frontend/e2e/tests/console/cluster-settings/updates-graph.spec.ts
  • frontend/e2e/tests/console/app/template.spec.ts
  • frontend/public/components/utils/container-select.tsx
  • frontend/e2e/tests/console/cluster-settings/channel-modal.spec.ts
  • frontend/e2e/tests/console/cluster-settings/worker-mcp-paused.spec.ts
  • frontend/e2e/tests/console/app/overview.spec.ts
  • frontend/e2e/tests/console/app/node-terminal.spec.ts
  • frontend/e2e/pages/base-page.ts
  • frontend/e2e/pages/catalog-page.ts
  • frontend/e2e/pages/logs-page.ts
  • frontend/e2e/tests/console/cluster-settings/upgradeable-false.spec.ts
  • frontend/e2e/tests/console/app/masthead.spec.ts
  • frontend/e2e/tests/console/app/resource-log.spec.ts
  • frontend/e2e/tests/console/cluster-settings/update-modal.spec.ts
  • frontend/public/components/utils/resource-log.tsx
  • frontend/e2e/tests/console/app/filtering-and-searching.spec.ts
  • frontend/e2e/pages/details-page.ts
  • frontend/e2e/clients/kubernetes-client.ts
  • frontend/e2e/pages/masthead-page.ts
  • frontend/e2e/pages/overview-page.ts
  • frontend/e2e/pages/list-page.ts
frontend/e2e/pages/**/*.ts

📄 CodeRabbit inference engine (TESTING.md)

Extend BasePage in Playwright page objects which provides robustClick(), waitForLoadingComplete(), and goTo(). Locators are private readonly properties; actions are async methods

Files:

  • frontend/e2e/pages/base-page.ts
  • frontend/e2e/pages/catalog-page.ts
  • frontend/e2e/pages/logs-page.ts
  • frontend/e2e/pages/details-page.ts
  • frontend/e2e/pages/masthead-page.ts
  • frontend/e2e/pages/overview-page.ts
  • frontend/e2e/pages/list-page.ts
🧠 Learnings (4)
📚 Learning: 2026-05-18T11:35:14.316Z
Learnt from: stefanonardo
Repo: openshift/console PR: 16431
File: frontend/e2e/tests/console/app/resource-log.spec.ts:65-65
Timestamp: 2026-05-18T11:35:14.316Z
Learning: In OpenShift Console Playwright e2e tests, when navigating to in-console routes use `page.goto('/k8s/...')` with a leading-slash absolute path (e.g., `/k8s/...`). `WEB_CONSOLE_URL` (default `http://localhost:9000`) must be treated as an origin only (no path component), so Playwright’s `baseURL` correctly resolves absolute paths. This convention should be followed consistently in console e2e specs when calling `page.goto()`, rather than passing full URLs or including path segments in `WEB_CONSOLE_URL`.

Applied to files:

  • frontend/e2e/tests/console/cluster-settings/update-in-progress.spec.ts
  • frontend/e2e/tests/console/cluster-settings/updates-graph.spec.ts
  • frontend/e2e/tests/console/app/template.spec.ts
  • frontend/e2e/tests/console/cluster-settings/channel-modal.spec.ts
  • frontend/e2e/tests/console/cluster-settings/worker-mcp-paused.spec.ts
  • frontend/e2e/tests/console/app/overview.spec.ts
  • frontend/e2e/tests/console/app/node-terminal.spec.ts
  • frontend/e2e/tests/console/cluster-settings/upgradeable-false.spec.ts
  • frontend/e2e/tests/console/app/masthead.spec.ts
  • frontend/e2e/tests/console/app/resource-log.spec.ts
  • frontend/e2e/tests/console/cluster-settings/update-modal.spec.ts
  • frontend/e2e/tests/console/app/filtering-and-searching.spec.ts
📚 Learning: 2026-05-19T17:15:42.558Z
Learnt from: fsgreco
Repo: openshift/console PR: 16461
File: frontend/e2e/pages/web-terminal-config-page.ts:18-18
Timestamp: 2026-05-19T17:15:42.558Z
Learning: In the openshift/console repo, the guideline “Never use absolute URLs or paths in the console code” should be treated as an application-source-only rule. Do not flag absolute-root paths/URLs (e.g., strings starting with `/` like `/k8s/cluster/...`) in Playwright E2E code under `frontend/e2e/`, including page objects (e.g., `page.goto()` / `goTo()` calls). These absolute paths are considered correct and intentional because Playwright resolves them against the `baseURL` configured in `frontend/e2e/playwright.config.ts`. Only enforce the no-absolute-paths rule in application code under `frontend/public` and `frontend/packages`.

Applied to files:

  • frontend/e2e/tests/console/cluster-settings/update-in-progress.spec.ts
  • frontend/e2e/tests/console/cluster-settings/updates-graph.spec.ts
  • frontend/e2e/tests/console/app/template.spec.ts
  • frontend/e2e/tests/console/cluster-settings/channel-modal.spec.ts
  • frontend/e2e/tests/console/cluster-settings/worker-mcp-paused.spec.ts
  • frontend/e2e/tests/console/app/overview.spec.ts
  • frontend/e2e/tests/console/app/node-terminal.spec.ts
  • frontend/e2e/pages/base-page.ts
  • frontend/e2e/pages/catalog-page.ts
  • frontend/e2e/pages/logs-page.ts
  • frontend/e2e/tests/console/cluster-settings/upgradeable-false.spec.ts
  • frontend/e2e/tests/console/app/masthead.spec.ts
  • frontend/e2e/tests/console/app/resource-log.spec.ts
  • frontend/e2e/tests/console/cluster-settings/update-modal.spec.ts
  • frontend/e2e/tests/console/app/filtering-and-searching.spec.ts
  • frontend/e2e/pages/details-page.ts
  • frontend/e2e/clients/kubernetes-client.ts
  • frontend/e2e/pages/masthead-page.ts
  • frontend/e2e/pages/overview-page.ts
  • frontend/e2e/pages/list-page.ts
📚 Learning: 2026-05-20T13:09:57.325Z
Learnt from: fsgreco
Repo: openshift/console PR: 16461
File: frontend/e2e/pages/web-terminal-page.ts:59-59
Timestamp: 2026-05-20T13:09:57.325Z
Learning: In page object files under `frontend/e2e/pages/`, do not treat `.catch(() => {})` (or other empty/ignored catches) chained to `waitFor(...)` as a bug when the wait is intended to be best-effort. These catches indicate the element may or may not appear, so the page object should not fail the test; real expectations should be asserted in the spec files (e.g., `expect(...).toBeVisible()`). This is consistent with the `waitForLoadingComplete` behavior in `BasePage`—reviewers should allow the empty catches when they match this pattern.

Applied to files:

  • frontend/e2e/pages/base-page.ts
  • frontend/e2e/pages/catalog-page.ts
  • frontend/e2e/pages/logs-page.ts
  • frontend/e2e/pages/details-page.ts
  • frontend/e2e/pages/masthead-page.ts
  • frontend/e2e/pages/overview-page.ts
  • frontend/e2e/pages/list-page.ts
📚 Learning: 2026-05-20T13:21:50.712Z
Learnt from: fsgreco
Repo: openshift/console PR: 16461
File: frontend/e2e/pages/web-terminal-page.ts:11-26
Timestamp: 2026-05-20T13:21:50.712Z
Learning: In Playwright page objects under `frontend/e2e/pages/`, treat locators that intentionally use dual CSS selectors like `.locator('[data-test="X"], [data-test-id="X"]')` as a backwards-compatibility shim. The legacy `data-test-id` is required because newly added `data-test` attributes may not exist on yet-to-be-upgraded deployed clusters. Do not flag these dual-selector locators as a code smell and do not suggest replacing them with a single `getByTestId('X')` until the new `data-test` attributes have propagated to all target clusters.

Applied to files:

  • frontend/e2e/pages/base-page.ts
  • frontend/e2e/pages/catalog-page.ts
  • frontend/e2e/pages/logs-page.ts
  • frontend/e2e/pages/details-page.ts
  • frontend/e2e/pages/masthead-page.ts
  • frontend/e2e/pages/overview-page.ts
  • frontend/e2e/pages/list-page.ts
🪛 ast-grep (0.42.2)
frontend/e2e/pages/list-page.ts

[warning] 64-64: Regular expression constructed from variable input detected. This can lead to Regular Expression Denial of Service (ReDoS) attacks if the variable contains malicious patterns. Use libraries like 'recheck' to validate regex safety or use static patterns.
Context: new RegExp(pattern.source, safeFlags)
Note: [CWE-1333] Inefficient Regular Expression Complexity [REFERENCES]
- https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS
- https://cwe.mitre.org/data/definitions/1333.html

(regexp-from-variable)

🪛 LanguageTool
.claude/skills/debug-e2e/SKILL.md

[style] ~105-~105: The adverb ‘sometimes’ is usually put before the verb ‘passes’.
Context: ...structure setup first. ### Flaky test (passes sometimes, fails sometimes) If a test passes on ...

(ADVERB_WORD_ORDER)

🔇 Additional comments (13)
frontend/e2e/tests/console/cluster-settings/update-in-progress.spec.ts (1)

6-6: LGTM!

Also applies to: 12-15

frontend/e2e/tests/console/cluster-settings/updates-graph.spec.ts (1)

5-5: LGTM!

Also applies to: 98-101

frontend/e2e/tests/console/app/template.spec.ts (1)

1-61: LGTM!

frontend/public/components/utils/container-select.tsx (1)

26-26: LGTM!

frontend/e2e/tests/console/cluster-settings/channel-modal.spec.ts (1)

9-9: LGTM!

Also applies to: 15-18

frontend/e2e/tests/console/cluster-settings/worker-mcp-paused.spec.ts (1)

6-6: LGTM!

Also applies to: 15-18

frontend/e2e/tests/console/app/overview.spec.ts (1)

1-155: LGTM!

frontend/e2e/tests/console/app/node-terminal.spec.ts (1)

1-32: LGTM!

frontend/e2e/pages/base-page.ts (1)

36-39: LGTM!

.claude/migration-context.md (1)

265-274: LGTM!

.claude/skills/debug-e2e/SKILL.md (1)

2-10: LGTM!

Also applies to: 19-31, 93-107

frontend/e2e/tests/console/cluster-settings/upgradeable-false.spec.ts (1)

6-6: LGTM!

Also applies to: 12-15

frontend/e2e/tests/console/app/resource-log.spec.ts (1)

85-157: LGTM!

Comment on lines +6 to +23
private readonly filterInput: Locator = this.page.getByPlaceholder('Filter by keyword');

async navigateToCatalog(): Promise<void> {
await this.goTo('/catalog/all-namespaces');
await this.filterInput.waitFor({ state: 'visible', timeout: 60_000 });
}

async filterByKeyword(keyword: string): Promise<void> {
await this.filterInput.fill(keyword);
}

catalogItem(testId: string): Locator {
return this.page.getByTestId(testId);
}

catalogItemIcon(testId: string): Locator {
return this.catalogItem(testId).locator('img.catalog-tile-pf-icon');
}
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot May 20, 2026

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Prefer getByTestId/data-test selectors for new catalog locators.

Line 6 (getByPlaceholder) and Line 22 (CSS class selector) make this page object more brittle than necessary. Please switch these to getByTestId(...) backed by stable data-test attributes.

As per coding guidelines: “Always use page.getByTestId('x') for Playwright selectors… If a React element only has a legacy test attribute, add data-test to the element.”

🤖 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/catalog-page.ts` around lines 6 - 23, Replace brittle
selectors by switching the filterInput and catalogItemIcon locators to use
getByTestId backed by data-test attributes: update the private filterInput (used
in navigateToCatalog and filterByKeyword) to
this.page.getByTestId('your-filter-testid') and change catalogItemIcon (used by
catalogItemIcon(testId)) to return
this.catalogItem(testId).getByTestId('catalog-icon-testid') (or a per-item
data-test attribute). Ensure the page elements have corresponding data-test
attributes in the app, and keep the existing waitFor/timeout logic in
navigateToCatalog and fill logic in filterByKeyword untouched.

Copy link
Copy Markdown
Contributor

@fsgreco fsgreco May 21, 2026

Choose a reason for hiding this comment

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

still better @stefanonardo here you could use getByRole('img') if there's only one image in the tile. Minor improvement though, non blocker.

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.

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@fsgreco the icon <img> has alt="" so it won't appear in the accessibility tree. Setting a non-empty value requires too many changes which I think are out of scope for this PR

Comment thread frontend/e2e/pages/logs-page.ts Outdated
Comment on lines +13 to +15
private readonly searchInput: Locator = this.page.getByPlaceholder('Search logs');
readonly searchMatches: Locator = this.page.locator('.pf-m-match');
readonly logText: Locator = this.page.locator('span[class$="c-log-viewer__text"]');
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.

🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Replace placeholder/class selectors with stable data-test selectors.

Line 13 and Lines 14-15 rely on placeholder/CSS-class selectors, which are fragile for long-term e2e stability. Prefer getByTestId(...) with explicit data-test hooks.

As per coding guidelines: “Always use page.getByTestId('x') for Playwright selectors… If a React element only has a legacy test attribute, add data-test to the element.”

🤖 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/logs-page.ts` around lines 13 - 15, Replace fragile
placeholder/class selectors in the LogsPage by switching the SearchLogs
selectors to stable data-test hooks: change usages of
this.page.getByPlaceholder('Search logs') to
this.page.getByTestId('search-logs') for the searchInput, replace
this.page.locator('.pf-m-match') with this.page.getByTestId('log-match') for
searchMatches, and replace
this.page.locator('span[class$="c-log-viewer__text"]') with
this.page.getByTestId('log-text') for logText; if the corresponding React
elements lack data-test attributes add data-test="search-logs",
data-test="log-match", and data-test="log-text" to those elements so the
Playwright selectors are stable.

Comment thread frontend/e2e/pages/overview-page.ts
Comment thread frontend/e2e/tests/console/app/filtering-and-searching.spec.ts
@stefanonardo stefanonardo force-pushed the CONSOLE-5235 branch 3 times, most recently from 6999b55 to f7a5e3c Compare May 21, 2026 08:37
Copy link
Copy Markdown
Member

@logonoff logonoff left a comment

Choose a reason for hiding this comment

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

/label px-approved
/label docs-approved

@openshift-ci openshift-ci Bot added px-approved Signifies that Product Support has signed off on this PR docs-approved Signifies that Docs has signed off on this PR labels May 21, 2026
Comment thread frontend/e2e/tests/console/app/masthead.spec.ts Outdated
Migrate 6 Cypress test files (21 tests) from
packages/integration-tests/tests/app/ to Playwright:
- masthead (6 tests)
- overview (2 tests)
- node-terminal (1 test)
- resource-log (3 tests)
- template (1 test)
- filtering-and-searching (8 tests)

New page objects: list-page, details-page, logs-page,
catalog-page, masthead-page, overview-page.

Extended KubernetesClient with createPod, deletePod,
waitForPodReady, createDeployment, waitForDeploymentReady.

Deleted Cypress files and their exclusive dependencies
(views/logs.ts, views/catalogs.ts, views/overview.ts,
fixture YAMLs) after validation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@fsgreco
Copy link
Copy Markdown
Contributor

fsgreco commented May 21, 2026

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label May 21, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 21, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: fsgreco, logonoff, stefanonardo
Once this PR has been reviewed and has the lgtm label, please assign therealjon 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
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 21, 2026

@stefanonardo: all tests passed!

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 docs-approved Signifies that Docs has signed off on this PR jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. kind/cypress Related to Cypress e2e integration testing lgtm Indicates that a PR is ready to be merged. px-approved Signifies that Product Support has signed off on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants