console icon indicating copy to clipboard operation
console copied to clipboard

CONSOLE-4916: add auto scenario about yaml sidebar

Open yanpzhan opened this issue 1 month ago โ€ข 14 comments

@yapei pls help to review, thanks! Tracked in https://issues.redhat.com/browse/CONSOLE-4916 This PR refactors and adds new automated test scenarios for the YAML editor sidebar feature. Key Changes:

  1. Refactored existing tests (yaml-editor-settings.cy.ts โ†’ yaml-editor.cy.ts)
  2. Added new test scenario: "Show possible enum values in yaml sidebar"
  3. Added helper functions in views/yaml-editor.ts

yanpzhan avatar Dec 02 '25 07:12 yanpzhan

@yanpzhan: This pull request references CONSOLE-4916 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 sub-task to target the "4.21.0" version, but no target version was set.

In response to this:

@yapei pls help to review, thanks! Tracked in https://issues.redhat.com/browse/CONSOLE-4916

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-robot avatar Dec 02 '25 07:12 openshift-ci-robot

Walkthrough

Adds a new Cypress YAML editor integration test, removes an older settings test file, and adds two view helper functions for sidebar and field-detail interactions; tests cover navigation, settings modal, theme/font adjustments, sidebar behavior, allowed-values checks, and persistence across navigation.

Changes

Cohort / File(s) Summary
New YAML Editor Test
frontend/packages/integration-tests-cypress/tests/app/yaml-editor.cy.ts
New Cypress integration test exercising YAML editor flows: navigation to import with sample YAML, settings modal open/close, theme and font-size adjustments, settings persistence after reopen and across page navigation, sidebar interactions, and allowed-values checks for spec/strategy.
Removed Settings Test
frontend/packages/integration-tests-cypress/tests/app/yaml-editor-settings.cy.ts
Deleted entire test file that previously contained Settings Modal, Theme, Font Size, and Settings Persistence suites including setup/teardown and related assertions.
YAML Editor View Helpers
frontend/packages/integration-tests-cypress/views/yaml-editor.ts
Added exported helpers: showYAMLSidebar() (clicks element with aria-label "Show sidebar") and clickFieldDetailsButton(fieldName: string) (finds an h5 with the field name, traverses to its list item, finds the "View details" button, and clicks it).

Estimated code review effort

๐ŸŽฏ 3 (Moderate) | โฑ๏ธ ~25 minutes

  • Review selector robustness in clickFieldDetailsButton (relies on h5 text and DOM traversal).
  • Validate timing/waits around sidebar open/close and cross-page navigation to reduce flakiness.
  • Confirm no unique assertions from the removed test were lost when consolidating into the new test.
โœจ Finishing touches
  • [ ] ๐Ÿ“ Generate docstrings
๐Ÿงช Generate unit tests (beta)
  • [ ] Create PR with unit tests
  • [ ] Post copyable unit tests in a comment

๐Ÿ“œ Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

๐Ÿ“ฅ Commits

Reviewing files that changed from the base of the PR and between ff97abfb4b857a33847912581cbe2008b6c6341e and bb8a848c35245f90d6c0353f2337e2141c9b63cd.

๐Ÿ“’ Files selected for processing (3)
  • frontend/packages/integration-tests-cypress/tests/app/yaml-editor-settings.cy.ts (0 hunks)
  • frontend/packages/integration-tests-cypress/tests/app/yaml-editor.cy.ts (1 hunks)
  • frontend/packages/integration-tests-cypress/views/yaml-editor.ts (1 hunks)
๐Ÿ’ค Files with no reviewable changes (1)
  • frontend/packages/integration-tests-cypress/tests/app/yaml-editor-settings.cy.ts
๐Ÿšง Files skipped from review as they are similar to previous changes (1)
  • frontend/packages/integration-tests-cypress/tests/app/yaml-editor.cy.ts
๐Ÿงฐ Additional context used
๐Ÿ““ Path-based instructions (1)
**

โš™๏ธ CodeRabbit configuration file

-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.

Files:

  • frontend/packages/integration-tests-cypress/views/yaml-editor.ts
๐Ÿ”‡ Additional comments (2)
frontend/packages/integration-tests-cypress/views/yaml-editor.ts (2)

98-98: LGTM! Clean helper for sidebar interaction.

The function correctly uses an accessible selector and follows the established patterns in the file.


99-105: LGTM! DOM traversal is appropriate for this test helper.

The function correctly navigates the DOM structure to locate and click the field details button. The selector chain is specific and follows Cypress conventions.


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

coderabbitai[bot] avatar Dec 02 '25 07:12 coderabbitai[bot]

@yanpzhan: This pull request references CONSOLE-4916 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 sub-task to target the "4.21.0" version, but no target version was set.

In response to this:

@yapei pls help to review, thanks! Tracked in https://issues.redhat.com/browse/CONSOLE-4916 This PR refactors and adds new automated test scenarios for the YAML editor sidebar feature. Key Changes:

  1. Refactored existing tests (yaml-editor-settings.cy.ts โ†’ yaml-editor.cy.ts)
  2. Added new test scenario: "Show possible enum values in yaml sidebar"
  3. Added helper functions in views/yaml-editor.ts

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-robot avatar Dec 04 '25 06:12 openshift-ci-robot

/test backend

yanpzhan avatar Dec 05 '25 06:12 yanpzhan

/test e2e-gcp-console

yanpzhan avatar Dec 05 '25 07:12 yanpzhan

@jhadvig Could you help to approve the pr? Thanks!

yanpzhan avatar Dec 12 '25 06:12 yanpzhan

/test okd-scos-images

yanpzhan avatar Dec 17 '25 08:12 yanpzhan

/verified by ci /label acknowledge-critical-fixes-only /label docs-approved /label px-approved /lgtm

yanpzhan avatar Dec 17 '25 09:12 yanpzhan

@yanpzhan: This PR has been marked as verified by ci.

In response to this:

/verified by ci /label acknowledge-critical-fixes-only /label docs-approved /label px-approved /lgtm

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-robot avatar Dec 17 '25 09:12 openshift-ci-robot

@yanpzhan: you cannot LGTM your own PR.

In response to this:

/verified by ci /label acknowledge-critical-fixes-only /label docs-approved /label px-approved /lgtm

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.

openshift-ci[bot] avatar Dec 17 '25 09:12 openshift-ci[bot]

/test okd-scos-images

yanpzhan avatar Dec 17 '25 09:12 yanpzhan

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jhadvig, logonoff, yanpzhan

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

The pull request process is described here

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[bot] avatar Dec 17 '25 16:12 openshift-ci[bot]

/retest-required

Remaining retests: 0 against base HEAD 9ac9e36e6bca30bd2b7f84752cc588f4cb842b44 and 2 for PR HEAD bb8a848c35245f90d6c0353f2337e2141c9b63cd in total

openshift-ci-robot avatar Dec 17 '25 16:12 openshift-ci-robot

/retest-required

Remaining retests: 0 against base HEAD d3b540a070b976f490eb3259f963703f4c33200d and 1 for PR HEAD bb8a848c35245f90d6c0353f2337e2141c9b63cd in total

openshift-ci-robot avatar Dec 18 '25 18:12 openshift-ci-robot

/retest-required

Remaining retests: 0 against base HEAD 99c3437a187d33c057466f99e6c2e3ef04f45422 and 0 for PR HEAD bb8a848c35245f90d6c0353f2337e2141c9b63cd in total

openshift-ci-robot avatar Dec 19 '25 19:12 openshift-ci-robot