CONSOLE-4916: add auto scenario about yaml sidebar
@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:
- Refactored existing tests (yaml-editor-settings.cy.ts โ yaml-editor.cy.ts)
- Added new test scenario: "Show possible enum values in yaml sidebar"
- Added helper functions in views/yaml-editor.ts
@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.
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 onh5text 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.
@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:
- Refactored existing tests (yaml-editor-settings.cy.ts โ yaml-editor.cy.ts)
- Added new test scenario: "Show possible enum values in yaml sidebar"
- 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.
/test backend
/test e2e-gcp-console
@jhadvig Could you help to approve the pr? Thanks!
/test okd-scos-images
/verified by ci /label acknowledge-critical-fixes-only /label docs-approved /label px-approved /lgtm
@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.
@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.
/test okd-scos-images
[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
- ~~frontend/OWNERS~~ [jhadvig,logonoff]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
/retest-required
Remaining retests: 0 against base HEAD 9ac9e36e6bca30bd2b7f84752cc588f4cb842b44 and 2 for PR HEAD bb8a848c35245f90d6c0353f2337e2141c9b63cd in total
/retest-required
Remaining retests: 0 against base HEAD d3b540a070b976f490eb3259f963703f4c33200d and 1 for PR HEAD bb8a848c35245f90d6c0353f2337e2141c9b63cd in total
/retest-required
Remaining retests: 0 against base HEAD 99c3437a187d33c057466f99e6c2e3ef04f45422 and 0 for PR HEAD bb8a848c35245f90d6c0353f2337e2141c9b63cd in total