[9.4] test: Fix flaky service map Scout accessibility test (#267960)#268667
Open
jennypavlova wants to merge 5 commits into
Open
[9.4] test: Fix flaky service map Scout accessibility test (#267960)#268667jennypavlova wants to merge 5 commits into
jennypavlova wants to merge 5 commits into
Conversation
- Fixes the Scout failure tracked in [elastic#262609](elastic#262609): `service_map_a11y.spec.ts` expected `toBeFocused()` on the service circle **after** typing in find-in-page. Focusing the node blurs the find field; search highlights are intentionally cleared when the find input loses focus (`isFocused`), which led to unstable focus/DOM during the assertion. - Separates **node focus + focus ring** from **find-in-page**: focus the circle without opening find first; cover find in its own step (`focusBodyForMapShortcuts`, ⌃K, fill, match summary, Enter to center, settle). - **`expect(locator).toBeVisible()` on `serviceMapNodeSearchHighlightFrame` failed** even when the counter showed `1/1` because highlight context only updates when React treats the field as focused. `fill()` on `data-test-subj="serviceMapControlsSearch"` targets the **layout wrapper**; the native input may receive keystrokes without reliably firing `EuiFieldSearch` `onFocus`, so `isFocused` stayed false and **`serviceMapNodeSearchHighlightFrame` never rendered**. The test now fills and sends Enter via **`#serviceMapFindInPageInput`** (same element as `focusServiceMapFindInput()`). - Resolves the highlight frame from the service node root with an XPath ancestor to `[data-test-subj="serviceMapNodeSearchHighlightFrame"]`. - Asserts the highlight **before** Enter where possible: map centering can steal focus and clear highlights per existing product behavior. Closes elastic#262609 Made with [Cursor](https://cursor.com) Co-authored-by: Cursor <cursoragent@cursor.com> (cherry picked from commit 7dfcaed)
|
Pinging @elastic/obs-presentation-team (Team:obs-presentation) |
Contributor
💔 Build Failed
Failed CI Steps
Test Failures
Metrics [docs]
History
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #262609
Backport
This will backport the following commits from
mainto9.4:Questions ?
Please refer to the Backport tool documentation