Skip to content

NO-JIRA: Remove redundant waitFor calls in Playwright e2e tests#16583

Open
rhamilto wants to merge 2 commits into
openshift:mainfrom
rhamilto:playwright-waitfor-cleanup
Open

NO-JIRA: Remove redundant waitFor calls in Playwright e2e tests#16583
rhamilto wants to merge 2 commits into
openshift:mainfrom
rhamilto:playwright-waitfor-cleanup

Conversation

@rhamilto

@rhamilto rhamilto commented Jun 9, 2026

Copy link
Copy Markdown
Member

Analysis / Root cause:
Playwright action methods (fill(), click(), check(), clear()) and robustClick() auto-wait for element actionability (visible, enabled, stable). Several e2e page objects and specs had explicit waitFor({ state: 'visible' }) calls immediately before actions on the same element, which is redundant.

Additionally, there was no lint enforcement to prevent new redundant waitFor() calls from being introduced, and many legitimate state-waiting uses were written as waitFor() instead of idiomatic Playwright expect() web-first assertions.

The integration test user agent override (used to dismiss the getting started modal) was only set via addInitScript + Object.defineProperty, which is fragile — it only overrides the JS-side value and can fail on some Chromium builds where navigator.userAgent is non-configurable.

Solution description:

ESLint enforcement

  • Added no-restricted-syntax rule to e2e/.eslintrc.cjs that warns on all .waitFor() calls
  • Warning message explains Playwright auto-wait behavior and when eslint-disable-next-line is appropriate
  • Catches redundant waitFor at lint time — both for humans and AI migration tools

Redundant waitFor removal

  • Removed DetailsPage.waitForPageLoad() method and its unused fields (skeletonLoader, resourceTitle)
  • Removed waitForLoad parameter from clickResourceRow() (never called with false, and robustClick already auto-waits)
  • Removed redundant waitFor before robustClick in clickKebabAction() and clickResourceRow()
  • Removed redundant waitFor() calls in page objects and specs where the next action on the same locator auto-waits

Replace waitFor with expect() assertions

Replaced 22 waitFor() calls with idiomatic Playwright web-first assertions:

  • waitFor({ state: 'visible' })expect(x).toBeVisible()
  • waitFor({ state: 'detached' })expect(x).not.toBeAttached()
  • waitFor({ state: 'hidden' })expect(x).toBeHidden()

The 10 remaining waitFor() calls are in try/catch retry loops or .catch() blocks where expect() cannot be used (it throws on failure rather than allowing graceful recovery).

Harden integration test user agent

  • Set userAgent at the Playwright project config level for all test projects (not auth setup projects), ensuring navigator.userAgent returns ConsoleIntegrationTestEnvironment natively at the browser level
  • Extended the existing addInitScript fallback to also override Navigator.prototype.userAgent with configurable: true
  • This ensures the getting started modal is reliably dismissed in CI

Migration docs

  • Removed redundant waitFor guidance from migrate-cypress skill (the lint rule covers it)
  • Updated migration-context.md to reference the ESLint rule
  • Fixed docs: deleteClusterCustomResource does not exist in KubernetesClient

Screenshots / screen recording:
N/A - no visual changes

Test setup:
None required

Test cases:
All affected e2e tests pass against localhost:9000:

  • pseudolocalization.spec.ts (1 test)
  • cluster-settings.spec.ts (3 tests)
  • update-modal.spec.ts (1 test)
  • console-link.spec.ts (2 tests)
  • create-namespace.spec.ts (1 test)

Browser conformance:

  • Chrome

Additional info:
waitFor() remains appropriate when:

  • Waiting inside a try/catch or .catch() block (e.g., retry loops, optional elements)
  • The element state check needs to be non-fatal

For all other state-waiting cases, prefer expect() web-first assertions — they retry automatically and produce better error messages on failure.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jun 9, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@rhamilto: This pull request explicitly references no jira issue.

Details

In response to this:

Analysis / Root cause:
Playwright action methods (fill(), click(), check(), clear()) and robustClick() auto-wait for element actionability (visible, enabled, stable). Several e2e page objects and specs had explicit waitFor({ state: 'visible' }) calls immediately before actions on the same element, which is redundant.

Solution description:

  • Removed 10 redundant waitFor() calls across 5 files:
  • cluster-settings-page.ts (4): openChannelModal, inputChannelName, openUpdateModal, openUpdateDropdown
  • navigation.ts (1): navigateViaNav
  • oauth-page.ts (2): removeIDP (removeAction + confirmButton)
  • web-terminal-page.ts (2): clickAdvancedTimeout, setTimeoutValue
  • favorites.spec.ts (4): page-load waits before click/assertion
  • Updated .claude/migration-context.md with auto-awaiting rules and correct wait translation patterns
  • Updated .claude/skills/migrate-cypress/SKILL.md with rules to prevent redundant waitFor in future migrations

Screenshots / screen recording:
N/A - no visual changes

Test setup:
None required

Test cases:

  • All affected e2e tests should continue to pass without the redundant waitFor calls
  • Playwright actions auto-wait, so behavior is unchanged

Browser conformance:

  • Chrome

Additional info:
waitFor() remains appropriate when waiting for a state transition without a subsequent action on the same element (e.g., waiting for a loading indicator to detach, confirming navigation completed).

Reviewers and assignees:
/assign rhamilto

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.

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

This PR updates Cypress→Playwright migration docs and the migrate-cypress skill, replaces many explicit Playwright locator.waitFor({ state }) calls with expect-based assertions or removes redundant waits in page objects/tests, adds an ESLint rule flagging waitFor(), and adds clickAdvancedTimeout().

Changes

Playwright Auto-Waiting Pattern Migration

Layer / File(s) Summary
Migration docs & guidance
.claude/migration-context.md
Rewrites Waits & Retries guidance to map Cypress timeout to Playwright action/expect timeouts, adds a Playwright Auto-Awaiting section, data-test migration rules, k8sClient cleanup guidance, page-object naming rules, and expands the “Things to NEVER Do” checklist.
migrate-cypress skill rules
.claude/skills/migrate-cypress/SKILL.md
Tightens Phase 3 page-object conventions and Key Translation Rules: require adding data-test for legacy-only attributes, enforce locator exposure and robustClick() usage, forbid try/catch in k8s cleanup, and ban legacy-prefixed naming.
ESLint rule and suppressions
frontend/e2e/.eslintrc.cjs, frontend/e2e/pages/base-page.ts, frontend/e2e/pages/web-terminal-config-page.ts, frontend/e2e/pages/web-terminal-page.ts, frontend/e2e/pages/cluster-dashboard-page.ts, frontend/e2e/pages/cluster-settings-page.ts
Adds a no-restricted-syntax rule that flags Playwright waitFor() calls and inserts targeted eslint-disable-next-line no-restricted-syntax comments where needed.
Page-object readiness and helper changes
frontend/e2e/pages/*, frontend/e2e/setup/*, frontend/e2e/tests/*
Removes explicit waitFor({ state: ... }) before clicks/fills in many page-object methods and tests; replaces some waits with expect(...).toBeVisible()/toContainText(); removes waitForPageLoad() and related skeleton waits; adds clickAdvancedTimeout() and adjusts setTimeoutValue() to rely on auto-waiting and fill+Tab application.
Tests: favorites & various e2e specs
frontend/e2e/tests/console/favorites/*, frontend/e2e/tests/console/*, frontend/e2e/tests/console/crd-extensions/*, frontend/e2e/tests/olm/*
Removes multiple redundant visibility waits in tests and test helpers, replacing gating with expect-based assertions or relying on auto-waiting where appropriate.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • openshift/console#15949: Overlaps on cluster-dashboard Playwright wait/visibility handling and status-card/popover logic.
  • openshift/console#16550: Related migration guidance changes around data-test/getByTestId, page-object patterns, and k8s cleanup behavior.

Suggested labels

docs-approved, kind/cypress, verified

🚥 Pre-merge checks | ✅ 14 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (14 passed)
Check name Status Explanation
Title check ✅ Passed The PR title accurately describes the main change: removing redundant waitFor calls in Playwright e2e tests. It is concise, clear, and directly reflects the primary objective of the changeset.
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.
Stable And Deterministic Test Names ✅ Passed Custom check for Ginkgo test names is inapplicable; PR contains only Playwright (TypeScript) e2e tests with stable, deterministic test names using constant strings, no Ginkgo tests present.
Test Structure And Quality ✅ Passed PR contains only Playwright e2e tests (TypeScript/JavaScript), not Ginkgo tests. Custom check requires Ginkgo test code review, which is not applicable here.
Microshift Test Compatibility ✅ Passed The custom check targets Ginkgo e2e tests; this PR contains only modifications to existing Playwright (TypeScript) e2e tests and documentation. No new tests are added.
Single Node Openshift (Sno) Test Compatibility ✅ Passed This PR contains only Playwright (TypeScript) test modifications, not new Ginkgo tests. The custom check applies only to new Ginkgo e2e tests, which this PR does not add.
Topology-Aware Scheduling Compatibility ✅ Passed PR modifies only test infrastructure (.claude docs, frontend/e2e tests) with no deployment manifests, operator code, or scheduling constraints—check is not applicable.
Ote Binary Stdout Contract ✅ Passed PR contains only frontend e2e tests (TypeScript/JavaScript) and documentation; no Go code or test binary stdout violations present.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed This PR refactors Playwright e2e tests by removing redundant waitFor calls. It contains no new Ginkgo tests, so the IPv6/disconnected network check does not apply.
No-Weak-Crypto ✅ Passed PR contains only Playwright e2e test refactoring and documentation updates. No cryptographic operations, weak algorithms, or secret comparisons are present.
Container-Privileges ✅ Passed PR modifies only Playwright test code, test helpers, and documentation—no container/K8s manifests present that the container-privileges check would apply to.
No-Sensitive-Data-In-Logs ✅ Passed No logging of sensitive data found in PR changes. PR removes redundant waitFor() calls and updates documentation without exposing passwords, tokens, keys, or PII.
Description check ✅ Passed The pull request description comprehensively addresses all required template sections with detailed analysis, solution description, test cases, and browser conformance.

✏️ 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 Leo6Leo and jhadvig June 9, 2026 16:01
@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 9, 2026
@rhamilto rhamilto force-pushed the playwright-waitfor-cleanup branch from f90e9c2 to be0795b Compare June 9, 2026 16:03

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

🤖 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/migration-context.md:
- Around line 498-512: Update the guidance paragraph to state that only
KubernetesClient.deleteNamespace and KubernetesClient.deleteCustomResource
swallow 404s (they catch errors and call isNotFound(err) to silence “not found”
errors) and therefore callers should not wrap those specific cleanup calls in
try/catch; remove the claim that deleteClusterCustomResource also swallows 404s
and instead note that KubernetesClient.deleteClusterCustomResource is not
implemented in the client so it should not be included in the “swallow 404s”
guidance.
🪄 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: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 66663232-ec3f-459e-98bc-542625f22f0a

📥 Commits

Reviewing files that changed from the base of the PR and between 9d30029 and f90e9c2.

📒 Files selected for processing (7)
  • .claude/migration-context.md
  • .claude/skills/migrate-cypress/SKILL.md
  • frontend/e2e/pages/cluster-settings-page.ts
  • frontend/e2e/pages/navigation.ts
  • frontend/e2e/pages/oauth-page.ts
  • frontend/e2e/pages/web-terminal-page.ts
  • frontend/e2e/tests/console/favorites/favorites.spec.ts
💤 Files with no reviewable changes (5)
  • frontend/e2e/pages/web-terminal-page.ts
  • frontend/e2e/pages/oauth-page.ts
  • frontend/e2e/tests/console/favorites/favorites.spec.ts
  • frontend/e2e/pages/navigation.ts
  • frontend/e2e/pages/cluster-settings-page.ts

Comment thread .claude/migration-context.md
@rhamilto rhamilto force-pushed the playwright-waitfor-cleanup branch from be0795b to 0af4aa6 Compare June 9, 2026 17:17

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

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

27-31: ⚡ Quick win

Consider removing redundant visibility wait for consistency.

Similar to clickResourceRow, line 29 has an explicit waitFor({ state: 'visible' }) before robustClick, which is redundant since robustClick already waits for visibility. For consistency with the PR's objective and the cleanup in other methods, consider removing this redundant wait.

♻️ Suggested refactor
 async clickKebabAction(actionId: string): Promise<void> {
   const action = this.page.locator(`[data-test-action="${actionId}"]`);
-  await action.waitFor({ state: 'visible', timeout: 10_000 });
-  await this.robustClick(action);
+  await this.robustClick(action, { timeout: 10_000 });
 }
🤖 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 27 - 31, The
clickKebabAction method redundantly calls await action.waitFor({ state:
'visible', timeout: 10_000 }) before calling this.robustClick(action); remove
that explicit wait so clickKebabAction mirrors clickResourceRow and relies on
robustClick to handle visibility/waiting. Update the method implementation
(clickKebabAction) to call only this.robustClick(action) and keep any existing
timeout/visibility behavior centralized inside robustClick.
🤖 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/details-page.ts`:
- Around line 52-56: In clickResourceRow, remove the redundant explicit waitFor
call (the await row.waitFor... line) because BasePage.robustClick already waits
for visibility; instead call robustClick with the desired timeout if you need
the 30_000ms window (i.e., use this.robustClick(row, { timeout: 30_000 }) or the
existing robustClick API), updating clickResourceRow to obtain the locator via
getResourceRow and delegate waiting/clicking to robustClick; reference
functions: clickResourceRow, getResourceRow, robustClick, and
BasePage.robustClick.

---

Nitpick comments:
In `@frontend/e2e/pages/details-page.ts`:
- Around line 27-31: The clickKebabAction method redundantly calls await
action.waitFor({ state: 'visible', timeout: 10_000 }) before calling
this.robustClick(action); remove that explicit wait so clickKebabAction mirrors
clickResourceRow and relies on robustClick to handle visibility/waiting. Update
the method implementation (clickKebabAction) to call only
this.robustClick(action) and keep any existing timeout/visibility behavior
centralized inside robustClick.
🪄 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: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 1904c79d-caf2-425e-92a0-946c90ffdc08

📥 Commits

Reviewing files that changed from the base of the PR and between be0795b and 0af4aa6.

📒 Files selected for processing (8)
  • .claude/migration-context.md
  • .claude/skills/migrate-cypress/SKILL.md
  • frontend/e2e/pages/cluster-settings-page.ts
  • frontend/e2e/pages/details-page.ts
  • frontend/e2e/pages/navigation.ts
  • frontend/e2e/pages/oauth-page.ts
  • frontend/e2e/pages/web-terminal-page.ts
  • frontend/e2e/tests/console/favorites/favorites.spec.ts
💤 Files with no reviewable changes (5)
  • frontend/e2e/pages/navigation.ts
  • frontend/e2e/pages/oauth-page.ts
  • frontend/e2e/pages/cluster-settings-page.ts
  • frontend/e2e/pages/web-terminal-page.ts
  • frontend/e2e/tests/console/favorites/favorites.spec.ts
✅ Files skipped from review due to trivial changes (2)
  • .claude/skills/migrate-cypress/SKILL.md
  • .claude/migration-context.md

Comment thread frontend/e2e/pages/details-page.ts
@rhamilto

rhamilto commented Jun 9, 2026

Copy link
Copy Markdown
Member Author

/retest

1 similar comment
@rhamilto

rhamilto commented Jun 9, 2026

Copy link
Copy Markdown
Member Author

/retest

@rhamilto rhamilto force-pushed the playwright-waitfor-cleanup branch from cac8b24 to 51bcada Compare June 9, 2026 20:57
@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 9, 2026
Comment on lines +19 to +20
'If this waitFor() is intentional (waiting for state without a subsequent action), ' +
'add // eslint-disable-next-line no-restricted-syntax',

@fsgreco fsgreco Jun 10, 2026

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.

We could add another alternative to the the eslint disable rule, which is to use web assertions (it's suggested also by Playwright documentation: either use web assertions or waitFor)

Suggested change
'If this waitFor() is intentional (waiting for state without a subsequent action), ' +
'add // eslint-disable-next-line no-restricted-syntax',
'If this waitFor() is intentional (waiting for state without a subsequent action), ' +
'either add // eslint-disable-next-line no-restricted-syntax',
'or use web assertions, e.g. `await expect(yourElement).toBeVisible()`'

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@fsgreco and I discussed this with @Leo6Leo and @logonoff during office hours earlier today. We're gonna roll with the lint rule for now as it seems to do a better job enforcing limited waitFor and requires and explicit exception, hopefully reducing the number of unintentional instances.

await page.getByTestId('loading-indicator').waitFor({ state: 'detached' });

// OK — confirming the editor loaded before reading its content (not an action on the element)
await page.getByTestId('code-editor').waitFor({ state: 'visible' });

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.

We could also add another stronger alternative, which is to add it in conjunction with or(). Let's say we have a modal with either error or success (so there are two possible locators):

Suggested change
await page.getByTestId('code-editor').waitFor({ state: 'visible' });
await page.getByTestId('code-editor').waitFor({ state: 'visible' });
const successMessage = page.getByTestId('.success-message');
const errorMessage = page.getByTestId('.error-message');
// Use the .or() combinator and wait for either one to appear
await successMessage.or(errorMessage).waitFor({ state: 'visible' });

@rhamilto rhamilto force-pushed the playwright-waitfor-cleanup branch from 51bcada to 41a9c22 Compare June 10, 2026 11:34
@openshift-ci openshift-ci Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 10, 2026
@rhamilto

Copy link
Copy Markdown
Member Author

/retest

@fsgreco fsgreco left a comment

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.

I think that "avoid" could be confusing or ambiguous

Comment thread .claude/migration-context.md Outdated

@fsgreco fsgreco left a comment

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.

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jun 10, 2026
@rhamilto rhamilto added the jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. label Jun 10, 2026
@rhamilto

Copy link
Copy Markdown
Member Author

/retest

@rhamilto rhamilto force-pushed the playwright-waitfor-cleanup branch from 305a3a5 to 74e434b Compare June 10, 2026 21:50
@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label Jun 10, 2026
@openshift-ci openshift-ci Bot added component/helm Related to helm-plugin component/insights Related to insights plugin component/knative Related to knative-plugin component/metal3 Related to metal3-plugin component/monitoring Related to monitoring component/olm Related to OLM component/sdk Related to console-plugin-sdk component/shared Related to console-shared component/topology Related to topology kind/cypress Related to Cypress e2e integration testing kind/demo-plugin Related to dynamic-demo-plugin kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated plugin-api-changed Categorizes a PR as containing plugin API changes labels Jun 11, 2026
@rhamilto rhamilto force-pushed the playwright-waitfor-cleanup branch from ed2fe29 to acc58e7 Compare June 11, 2026 16:12
@openshift-ci openshift-ci Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 11, 2026
@rhamilto

Copy link
Copy Markdown
Member Author

/test frontend

@rhamilto rhamilto force-pushed the playwright-waitfor-cleanup branch 3 times, most recently from 645641d to 4122e7c Compare June 11, 2026 18:48
@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 11, 2026
rhamilto and others added 2 commits June 11, 2026 18:02
Add a no-restricted-syntax ESLint rule that warns on all .waitFor()
calls in Playwright e2e tests. Playwright actions (click, fill, check,
clear) auto-wait for actionability, so waitFor() before an action is
redundant. For intentional uses (waiting for state without a subsequent
action, or inside error recovery), add an eslint-disable comment.

Replace 22 waitFor() calls with idiomatic expect() web-first assertions
(e.g. toBeVisible, not.toBeAttached) and remove 3 that were redundant
before an action. The remaining 10 are all in try/catch or .catch()
blocks where expect() cannot be used.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove the `perspective` useState that duplicated `activePerspective`
— use `activePerspective` directly to eliminate the stale-state window.
Guard the tour dispatch with `if (loaded)` to avoid dispatching
initialize before user preferences have loaded.

Gate tour rendering with an `initializedWithLoadedData` state flag that
prevents the guided tour from flashing stale state during perspective
switches. The flag resets when the perspective changes and is only set
after the effect re-initializes the reducer with the correct completion
state for the new perspective. Using state (not a ref) ensures the
component re-renders after initialization, so the tour appears for
uncompleted perspectives.

Add a unit test verifying that completed tours do not re-appear
when the completed state changes.

Co-authored-by: Santiago Greco <sgreco@redhat.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@rhamilto rhamilto force-pushed the playwright-waitfor-cleanup branch from 4122e7c to df62a09 Compare June 11, 2026 22:06
@openshift-ci openshift-ci Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 11, 2026
@rhamilto

Copy link
Copy Markdown
Member Author

/retest

@openshift-ci

openshift-ci Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

@rhamilto: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-playwright df62a09 link false /test e2e-playwright

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

approved Indicates a PR has been approved by an approver from all required OWNERS files. component/backend Related to backend component/core Related to console core functionality component/dashboard Related to dashboard component/dev-console Related to dev-console component/git-service Related to git-service component/helm Related to helm-plugin component/insights Related to insights plugin component/knative Related to knative-plugin component/metal3 Related to metal3-plugin component/monitoring Related to monitoring component/olm Related to OLM component/sdk Related to console-plugin-sdk component/shared Related to console-shared component/topology Related to topology jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. kind/cypress Related to Cypress e2e integration testing kind/demo-plugin Related to dynamic-demo-plugin kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated plugin-api-changed Categorizes a PR as containing plugin API changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants