Skip to content

[9.4] test: Fix flaky service map Scout accessibility test (#267960)#268667

Open
jennypavlova wants to merge 5 commits into
elastic:9.4from
jennypavlova:backport/9.4/pr-267960
Open

[9.4] test: Fix flaky service map Scout accessibility test (#267960)#268667
jennypavlova wants to merge 5 commits into
elastic:9.4from
jennypavlova:backport/9.4/pr-267960

Conversation

@jennypavlova
Copy link
Copy Markdown
Member

@jennypavlova jennypavlova commented May 11, 2026

Closes #262609

Backport

This will backport the following commits from main to 9.4:

Questions ?

Please refer to the Backport tool documentation

- 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)
@jennypavlova jennypavlova added the backport This PR is a backport of another PR label May 11, 2026
@jennypavlova jennypavlova enabled auto-merge (squash) May 11, 2026 12:01
@botelastic botelastic Bot added the Team:obs-presentation Focus: APM UI, Infra UI, Hosts UI, Universal Profiling, Obs Overview and left Navigation label May 11, 2026
@infra-vault-gh-plugin-prod
Copy link
Copy Markdown

Pinging @elastic/obs-presentation-team (Team:obs-presentation)

Copy link
Copy Markdown
Contributor

@sbelastic sbelastic left a comment

Choose a reason for hiding this comment

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

LGTM

@kibanamachine
Copy link
Copy Markdown
Contributor

kibanamachine commented May 11, 2026

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] Scout Lane #1 - stateful-classic / default / local-stateful-classic - Service map - accessibility - focus management and visible indicators work correctly
  • [job] [logs] Scout Lane #1 - stateful-classic / default / local-stateful-classic - Service map - accessibility - focus management and visible indicators work correctly

Metrics [docs]

✅ unchanged

History

cc @jennypavlova

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR Team:obs-presentation Focus: APM UI, Infra UI, Hosts UI, Universal Profiling, Obs Overview and left Navigation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants