[9.2] [Scout][a11y] adding axe-core validation (#243953)#244797
Merged
alexwizp merged 3 commits intoelastic:9.2from Dec 2, 2025
Merged
[9.2] [Scout][a11y] adding axe-core validation (#243953)#244797alexwizp merged 3 commits intoelastic:9.2from
axe-core validation (#243953)#244797alexwizp merged 3 commits intoelastic:9.2from
Conversation
**Summary**
- Integrates `axe-core` accessibility checks into our test-suite for
`Scout`.
- Adds a shared helper `checkA11y` that runs axe on a given DOM context.
- Targets automated detection of common accessibility issues (color
contrast, missing ARIA, etc.) so we catch regressions earlier.
Configuration is unified with Cypress and FTR
**Why**
- Improve accessibility coverage by running automated checks in-unit and
in functional tests.
- Provide a simple, reusable helper for tests so authors can validate
accessibility as part of normal test work.
**What changed**
- Adds `axe-core` dependency and wiring to run it in tests.
- Introduces `checkA11y` helper used by existing tests. This method is
accessible through the `Page` object.
**How to use**
> [!NOTE]
>We recommend running `checkA11y` with the `include` parameter set to
the root element you are testing. This makes the tests more isolated and
reduces the time required to analyze the DOM structure.
```
test('an example of using the checkA11y check', async ({ page }) => {
....
const { violations } = await page.checkA11y({ include: ['{CSS selector of root element you are testing}'] });
expect(violations).toHaveLength(0);
});
```
## Screens
**Example of report**
<img width="963" height="326" alt="image"
src="https://github.com/user-attachments/assets/c8450ad8-deea-47c3-a4d7-e7e2e0a73d88"
/>
**ESLint issue*
<img width="963" height="326" alt="Screenshot 2025-11-28 at 15 23 55"
src="https://github.com/user-attachments/assets/387400ac-4fb8-45d6-9649-09f7ee3fb8f5"
/>
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
(cherry picked from commit 1caf007)
# Conflicts:
# .buildkite/scripts/steps/security/third_party_packages.txt
# package.json
# src/platform/packages/shared/kbn-scout/moon.yml
# src/platform/packages/shared/kbn-scout/src/playwright/fixtures/scope/test/scout_page/index.ts
# src/platform/packages/shared/kbn-scout/src/playwright/fixtures/scope/test/scout_page/single_thread.ts
# src/platform/packages/shared/kbn-scout/src/playwright/utils/index.ts
dmlemeshko
approved these changes
Dec 2, 2025
Contributor
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Public APIs missing exports
|
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.
Backport
This will backport the following commits from
mainto9.2:axe-corevalidation (#243953)Questions ?
Please refer to the Backport tool documentation