fix(e2e): fix Settings link and catalog timestamp failures on release-1.8#4518
fix(e2e): fix Settings link and catalog timestamp failures on release-1.8#4518zdrapela wants to merge 2 commits intoredhat-developer:release-1.8from
Conversation
…-1.8
- goToSettingsPage(): use getByRole('menuitem') instead of clickLink('Settings')
since the profile dropdown renders Settings as a menuitem, not an <a> link
- default-global-header: replace verifyLinkVisible('Settings') with menuitem
check to avoid strict mode violation (5 matching <a> elements)
- catalog-timestamp: clear search filter from previous test, use semantic
selectors (getByRole) instead of brittle CSS nth-child selectors
- .gitignore: add .local-test to prevent prettier from scanning deployment
artifacts (backported from main)
- eslint.config.js: add .local-test to ignores to prevent ESLint from scanning
deployment artifacts
These fixes are backported from main branch (commit bba55b4).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
/agentic_review |
Code Review by Qodo
1. Filter clear not verified
|
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR TypeBug fix, Tests Description
|
| Relevant files | |||||||
|---|---|---|---|---|---|---|---|
| Bug fix |
| ||||||
| Configuration changes |
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||||||
| // Clear search filter from previous test to show all components | ||
| const clearButton = page.getByRole("button", { name: "clear search" }); | ||
| if (await clearButton.isVisible()) { | ||
| await clearButton.click(); | ||
| } | ||
|
|
There was a problem hiding this comment.
1. Filter clear not verified 🐞 Bug ☼ Reliability
catalog-timestamp.spec.ts attempts to clear the previous test’s catalog search via an optional “clear search” button click but never asserts the filter is actually removed, so the sort test can run against a single filtered row and stop validating sort behavior reliably. This can yield false positives or flakiness depending on whether the clear affordance exists/works in that UI variant.
Agent Prompt
### Issue description
`catalog-timestamp.spec.ts` relies on an optional click of a "clear search" control to reset state from the prior test, but never verifies that the search field is actually cleared. If the control is absent or the click doesn’t clear the input (UI variant/accessibility name differences), the sorting test may run with the old filter still applied.
### Issue Context
The previous test sets a search filter via `uiHelper.searchInputPlaceholder(...)`, and the suite reuses the same `page` across tests; `beforeEach` does not clear the field.
### Fix Focus Areas
- e2e-tests/playwright/e2e/catalog-timestamp.spec.ts[48-93]
- e2e-tests/playwright/support/page-objects/page-obj.ts[14-17]
### Suggested change
After attempting to clear, explicitly clear the known search input (using `SEARCH_OBJECTS_COMPONENTS.placeholderSearch`/`ariaLabelSearch`) and assert it is empty (e.g., `await expect(page.locator(SEARCH_OBJECTS_COMPONENTS.placeholderSearch)).toHaveValue('')`) before proceeding to row/sort assertions.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
|
/test e2e-ocp-helm |
|
/test e2e-ocp-helm |
|
/test e2e-ocp-helm-nightly |
|
/test e2e-ocp-helm-nightly |
|
@zdrapela: 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. |
Summary
getByRole('menuitem')instead ofclickLink('Settings')since the profile dropdown renders Settings as a menuitem, not an<a>linkverifyLinkVisible('Settings')with menuitem check to avoid strict mode violation (5 matching<a>elements)getByRole) instead of brittle CSSnth-childselectors.local-testto ignores to prevent prettier/eslint from scanning deployment artifactsThese fixes are backported from main branch (commit bba55b4).
Fixes failing tests in release-1.8 OCP Helm nightly:
default-global-header.spec.ts— "Verify Profile Dropdown behaves as expected"guest-signin-happy-path.spec.ts— "Verify Profile is Guest in Settings page" & "Sign Out"catalog-timestamp.spec.ts— "Toggle CREATED AT sorting"