OCPBUGS-105517: Fix flaky search.spec.ts Playwright e2e tests - #16938
Conversation
The "Search page - Recently used" tests flake in CI for two reasons: 1. openResourcesFilter() clicks the combobox but doesn't wait for the dropdown listbox to render. On slower CI runs the assertion fires before the element exists. 2. ensureDeveloperPerspective() confirms the perspective switcher toggle is interactive but not that the Developer option is actually listed. The console may still be loading perspective extensions after the toggle re-renders as a dropdown. Wait for the dropdown listbox visibility after opening, and extend the ensureDeveloperPerspective retry loop to verify the Developer menu option is present before proceeding. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
@rhamilto: This pull request references Jira Issue OCPBUGS-105517, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
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. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
WalkthroughThe E2E page objects now verify that the Developer perspective is available and that the resource dropdown is visible before test execution continues. ChangesE2E readiness checks
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 14 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (14 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
/jira refresh |
|
@rhamilto: This pull request references Jira Issue OCPBUGS-105517, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
DetailsIn response to this:
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. |
|
/pipeline required |
|
Scheduling tests matching the |
|
Tests from second stage were triggered manually. Pipeline can be controlled only manually, until HEAD changes. Use command to trigger second stage. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: logonoff, rhamilto The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/verified by playwright test passes |
|
@logonoff: This PR has been marked as verified by DetailsIn response to this:
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. |
|
@rhamilto: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. |
42ca40a
into
openshift:main
|
@rhamilto: Jira Issue Verification Checks: Jira Issue OCPBUGS-105517 Jira Issue OCPBUGS-105517 has been moved to the MODIFIED state and will move to the VERIFIED state when the change is available in an accepted nightly payload. 🕓 DetailsIn response to this:
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. |
Analysis / Root cause:
The
dev-console/search.spec.ts"Search page - Recently used" Playwright e2e tests flake in CI due to two race conditions:Dropdown not awaited after click:
SearchPage.openResourcesFilter()clicks the resource filter combobox but returns immediately without waiting for the dropdown listbox (#resource-dropdown-listbox) to render. On slower CI runs,toBeVisible()assertions against dropdown contents fail because the element doesn't exist yet.Developer perspective not fully loaded:
ensureDeveloperPerspective()patches the cluster config to enable the Developer perspective, then reloads until the perspective switcher toggle is no longer a static single-perspective div. However, the toggle becoming a<Select>dropdown does not guarantee the "Developer" menu option is listed — the console may still be loading perspective extensions.switchPerspective("Developer")opens the dropdown, finds no Developer option, and throwsPerspective "Developer" not found in switcher menu.Solution description:
Added
await expect(this.resourceDropdownList).toBeVisible()after the click inopenResourcesFilter()so Playwright auto-retries until the dropdown is fully open before any test assertions run against its contents.Extended the
ensureDeveloperPerspective()retry loop to open the perspective switcher dropdown and verify the "Developer" menu option is visible before considering the perspective ready. The dropdown is dismissed withEscapeafter each check.Screenshots / screen recording:
Test setup:
Run the search.spec.ts Playwright e2e tests against a cluster where the Developer perspective is not enabled by default (single perspective mode).
Test cases:
shows recently searched resource in dropdownpasses consistentlyshows up to 5 recently searched itemspasses consistentlyclears recently searched historypasses consistentlyBrowser conformance:
Additional info:
Jira: https://redhat.atlassian.net/browse/OCPBUGS-105517
Reviewers and assignees:
Summary by CodeRabbit