Skip to content

Tests: Fix failure to dismiss guided tour when running locally#2118

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:release-4.19from
kyoto:tests-fix-tour-dismissal
Jun 22, 2026
Merged

Tests: Fix failure to dismiss guided tour when running locally#2118
openshift-merge-bot[bot] merged 1 commit into
openshift:release-4.19from
kyoto:tests-fix-tour-dismissal

Conversation

@kyoto

@kyoto kyoto commented Jun 22, 2026

Copy link
Copy Markdown
Member

Fix is just for running locally with the SKIP_OLS_SETUP=true option

Summary by CodeRabbit

  • Tests
    • Enhanced test fixtures with automatic guided tour dismissal to ensure tests run without interruption from tutorial overlays.

@kyoto kyoto added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 22, 2026
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: c0fa241b-7646-4bea-8370-c86297d74608

📥 Commits

Reviewing files that changed from the base of the PR and between bcb3bdd and 757fb85.

📒 Files selected for processing (1)
  • tests/support/fixtures.ts

📝 Walkthrough

Walkthrough

A new auto-enabled Playwright fixture dismissGuidedTour is added to tests/support/fixtures.ts. It registers a locator handler for the guided-tour secondary button ([data-test="tour-step-footer-secondary"]) that clicks it whenever it appears. The exported test type is updated to include dismissGuidedTour alongside captureConsoleLogs.

Changes

Guided Tour Dismissal Fixture

Layer / File(s) Summary
dismissGuidedTour auto fixture
tests/support/fixtures.ts
Extends the test fixture generic with dismissGuidedTour: void, adds the fixture implementation using page.addLocatorHandler targeting [data-test="tour-step-footer-secondary"], and clicks the button automatically whenever it appears during test execution.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐇 A guided tour popped up one day,
Blocking the tests in every way.
So I added a fixture with a click,
To dismiss the tour real quick!
Now tests run free, hooray hooray~ 🎉

🚥 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 directly and specifically describes the main change: adding a fixture to automatically dismiss guided tours in tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

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

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

@openshift-ci openshift-ci Bot requested review from JoaoFula and xrajesh June 22, 2026 05:11
@openshift-ci

openshift-ci Bot commented Jun 22, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by:

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

1 similar comment
@openshift-ci

openshift-ci Bot commented Jun 22, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by:

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
tests/support/fixtures.ts (1)

254-256: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Consider handling specific error cases rather than swallowing all exceptions.

The empty catch block silently swallows all errors, including unexpected failures like click errors, incorrect selectors, or cases where the tour button is present but doesn't hide after clicking. This could mask legitimate test failures.

Consider using a more targeted approach:

♻️ Alternative implementation with explicit presence check
 export const dismissGuidedTour = async (page: Page): Promise<void> => {
   const skipTourBtn = page.locator('[data-test="tour-step-footer-secondary"]');
-  try {
-    await expect(skipTourBtn).toBeVisible({ timeout: 3_000 });
+  const isVisible = await skipTourBtn.isVisible({ timeout: 3_000 }).catch(() => false);
+  if (isVisible) {
     await skipTourBtn.click();
     await expect(skipTourBtn).toBeHidden();
-  } catch {
-    // Tour not present
   }
 };

This way, only the "tour not present" case is handled silently, while genuine failures (e.g., button doesn't hide after click) will still throw and fail the test.

🤖 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 `@tests/support/fixtures.ts` around lines 254 - 256, The empty catch block is
silently swallowing all exceptions, masking legitimate test failures like click
errors or selector issues. Instead of using a bare try-catch, first explicitly
check if the tour element or button exists before attempting any operations on
it (use a targeted selector check or element presence verification). Only handle
the specific case where the element is not found silently, and allow any genuine
failures to propagate and fail the test.
🤖 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.

Nitpick comments:
In `@tests/support/fixtures.ts`:
- Around line 254-256: The empty catch block is silently swallowing all
exceptions, masking legitimate test failures like click errors or selector
issues. Instead of using a bare try-catch, first explicitly check if the tour
element or button exists before attempting any operations on it (use a targeted
selector check or element presence verification). Only handle the specific case
where the element is not found silently, and allow any genuine failures to
propagate and fail the test.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: cc62dca1-9003-4670-b8a0-b2717dc98979

📥 Commits

Reviewing files that changed from the base of the PR and between 10a30f2 and bcb3bdd.

📒 Files selected for processing (2)
  • tests/support/fixtures.ts
  • tests/tests/lightspeed.spec.ts

@kyoto kyoto force-pushed the tests-fix-tour-dismissal branch from bcb3bdd to 757fb85 Compare June 22, 2026 05:23
@kyoto

kyoto commented Jun 22, 2026

Copy link
Copy Markdown
Member Author

/cherry-pick main

@openshift-cherrypick-robot

Copy link
Copy Markdown

@kyoto: once the present PR merges, I will cherry-pick it on top of main in a new PR and assign it to you.

Details

In response to this:

/cherry-pick main

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.

@JoaoFula

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jun 22, 2026
@openshift-merge-bot openshift-merge-bot Bot merged commit 21942b7 into openshift:release-4.19 Jun 22, 2026
5 checks passed
@openshift-cherrypick-robot

Copy link
Copy Markdown

@kyoto: new pull request created: #2123

Details

In response to this:

/cherry-pick main

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.

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. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants