Skip to content

NO-JIRA: switch to core platform page before test case run#837

Merged
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
Tai-RedHat:fix_perspective
Mar 19, 2026
Merged

NO-JIRA: switch to core platform page before test case run#837
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
Tai-RedHat:fix_perspective

Conversation

@Tai-RedHat
Copy link
Contributor

@Tai-RedHat Tai-RedHat commented Mar 12, 2026

Sometimes the displayed page will switch to others rather than the admin page. For example, acm alerting ui will switch to Fleet Management when the plugin is installed.

@openshift-ci openshift-ci bot requested review from etmurasaki and zhuje March 12, 2026 08:16
@coderabbitai
Copy link

coderabbitai bot commented Mar 12, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: c2ec3855-a2c0-4b63-ad2e-2d0ad4526924

📥 Commits

Reviewing files that changed from the base of the PR and between b9581ef and 1f3adec.

📒 Files selected for processing (2)
  • web/cypress/e2e/coo/02.acm_alerting_ui.cy.ts
  • web/cypress/support/commands/coo-install-commands.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • web/cypress/e2e/coo/02.acm_alerting_ui.cy.ts

Walkthrough

Both Cypress test files are updated to include a cy.switchPerspective('Core platform') control step: one added to a test case before initial navigation, and another added to the waitForCOOReady helper function when COO UI installation is enabled.

Changes

Cohort / File(s) Summary
Perspective switching setup
web/cypress/e2e/coo/02.acm_alerting_ui.cy.ts, web/cypress/support/commands/coo-install-commands.ts
Added cy.switchPerspective('Core platform') control step to establish the correct UI context in test and support command initialization.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: adding a perspective switch to the Core platform before test cases run to ensure correct UI context.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Stable And Deterministic Test Names ✅ Passed Pull request modifies Cypress test files (.cy.ts), not Ginkgo tests. Ginkgo naming guidelines do not apply.
Test Structure And Quality ✅ Passed PR modifications are Cypress E2E tests in TypeScript, not Ginkgo tests. The custom check requires Ginkgo test code review, making this check not applicable.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

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

❤️ Share

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

Tip

You can disable the changed files summary in the walkthrough.

Disable the reviews.changed_files_summary setting to disable the changed files summary in the walkthrough.

Copy link

@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.

🧹 Nitpick comments (1)
web/cypress/support/commands/operator-commands.ts (1)

305-310: LGTM - consider guarding against redundant perspective switches.

The perspective switch before navigating to Installed Operators correctly ensures the UI is in the expected context. This addresses the PR objective.

One minor observation: the underlying switchPerspective implementation (in auth-commands.ts) does not check if the perspective is already active before attempting to switch. If waitForCOOReady is called when already on "Core platform", the code will still open the switcher menu and click unnecessarily. This is inefficient but not breaking.

,

💡 Optional: Guard against redundant switching in the command implementation

You could enhance switchPerspective in auth-commands.ts to skip switching if already on the target perspective:

// In auth-commands.ts, inside switchPerspective
cy.get('[data-test-id="perspective-switcher-toggle"]').then(($toggle) => {
  if ($toggle.text().includes(perspectives[0])) {
    cy.log(`Already on ${perspectives[0]} perspective, skipping switch`);
    return;
  }
  // ... existing switching logic
});

This would be a broader improvement applicable to all perspective switching calls.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/cypress/support/commands/operator-commands.ts` around lines 305 - 310,
The review suggests avoiding redundant UI actions: update the switchPerspective
implementation in auth-commands.ts so it first checks whether the current
perspective already matches the target (e.g., inspect the perspective switcher
element text for the desired value) and return early if so; adjust the logic
that currently always opens the '[data-test-id="perspective-switcher-toggle"]'
and clicks options, so functions like waitForCOOReady or other callers of
switchPerspective skip unnecessary menu interactions when already on the
requested perspective.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@web/cypress/support/commands/operator-commands.ts`:
- Around line 305-310: The review suggests avoiding redundant UI actions: update
the switchPerspective implementation in auth-commands.ts so it first checks
whether the current perspective already matches the target (e.g., inspect the
perspective switcher element text for the desired value) and return early if so;
adjust the logic that currently always opens the
'[data-test-id="perspective-switcher-toggle"]' and clicks options, so functions
like waitForCOOReady or other callers of switchPerspective skip unnecessary menu
interactions when already on the requested perspective.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 84b13219-27bc-4030-82eb-4007db37d10b

📥 Commits

Reviewing files that changed from the base of the PR and between 4b2ccc0 and 54216e5.

📒 Files selected for processing (2)
  • web/cypress/e2e/coo/02.acm_alerting_ui.cy.ts
  • web/cypress/support/commands/operator-commands.ts

@jgbernalp jgbernalp changed the title switch to core platform page before test case run NO-JIRA: switch to core platform page before test case run Mar 17, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 17, 2026
@openshift-ci-robot
Copy link

@Tai-RedHat: This pull request explicitly references no jira issue.

Details

In response to this:

Sometimes the displayed page will switch to others rather than the admin page. For example, acm alerting ui will switch to Fleet Management when the plugin is installed.

Summary by CodeRabbit

  • Tests
  • Enhanced test reliability by establishing proper UI context before executing alerting and operator test scenarios.

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.

@jgbernalp
Copy link
Contributor

/lgtm

@jgbernalp
Copy link
Contributor

cc @etmurasaki

@openshift-ci openshift-ci bot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Mar 17, 2026
@etmurasaki
Copy link
Contributor

/label qe-approved

@openshift-ci openshift-ci bot added qe-approved Signifies that QE has signed off on this PR needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Mar 19, 2026
@openshift-ci openshift-ci bot removed lgtm Indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Mar 19, 2026
Copy link

@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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@web/cypress/support/commands/operator-commands.ts`:
- Around line 67-70: The file contains a merge artifact: an improperly closed
collectDebugInfo() followed by object-method style entries (installCOO,
waitForCOOReady, etc.) and a duplicated collectDebugInfo declaration later;
remove or fix the malformed block so there is a single valid collectDebugInfo
implementation and the other functions are either standalone exported functions
or methods inside a proper object/namespace. Specifically, delete the orphaned
trailing block that ends with "}," after collectDebugInfo or convert the
following method-like entries into a real object (or plain function exports),
and remove the duplicate collectDebugInfo declaration so only the intended,
correctly scoped collectDebugInfo, installCOO, waitForCOOReady, etc. remain.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 1965efb0-2fdd-4b2b-a4fc-a4108c3f88a6

📥 Commits

Reviewing files that changed from the base of the PR and between 54216e5 and b9581ef.

📒 Files selected for processing (2)
  • web/cypress/e2e/coo/02.acm_alerting_ui.cy.ts
  • web/cypress/support/commands/operator-commands.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • web/cypress/e2e/coo/02.acm_alerting_ui.cy.ts

@Tai-RedHat
Copy link
Contributor Author

Tai-RedHat commented Mar 19, 2026

PR rebased since waitForCOOReady has been moved to coo-install-commands.ts.

  (Results)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Tests:        1                                                                                │
  │ Passing:      1                                                                                │
  │ Failing:      0                                                                                │
  │ Pending:      0                                                                                │
  │ Skipped:      0                                                                                │
  │ Screenshots:  0                                                                                │
  │ Video:        false                                                                            │
  │ Duration:     13 minutes, 16 seconds                                                           │
  │ Spec Ran:     02.acm_alerting_ui.cy.ts                                                         │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 19, 2026

@Tai-RedHat: 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.

@DavidRajnoha
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 19, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 19, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: DavidRajnoha, jgbernalp, Tai-RedHat

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

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit dd34c12 into openshift:main Mar 19, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. qe-approved Signifies that QE has signed off on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants