-
Notifications
You must be signed in to change notification settings - Fork 129
test(a11y): e2e baseline tests for a11y screen reader descriptions #2684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
a4fab86
feat(a11y): add accessibility e2e test suite with baseline tests for …
walterra c926e2a
fix(a11y): update e2e test expectations to match current accessibilit…
walterra 5c9854d
feat(e2e): add accessibility test suites for all chart types
walterra 59de150
test(a11y): fix accessibility test assertions to include chart types
walterra 31230ef
test(a11y): add comprehensive chart type coverage to accessibility tests
walterra ac8210f
test(a11y): update accessibility test expectations to match current o…
walterra 4a91c3c
refactor(e2e): remove unused accessibility helper file
walterra 287bc64
refactor(e2e): remove unused a11y helper and add edge case test comment
walterra e6e2581
refactor(e2e): consolidate accessibility test helper and unify test p…
walterra e7f9339
refactor(e2e): consolidate start scripts with --a11y flag
walterra 8148d0e
refactor(e2e): consolidate test scripts by adding --a11y flag to test.sh
walterra c053de0
feat(ci): add accessibility e2e tests to Buildkite pipeline
walterra 84dc582
feat(ci): add accessibility e2e tests to build pipeline
walterra 9df31b9
refactor(e2e): move a11y tests to tests_a11y directory and update config
walterra 7a57f62
fix(e2e): update a11y test imports and config for tests_a11y directory
walterra cccd3e8
fix(ci): use correct parallel key for a11y test job status reporting
walterra bbabde8
feat(ci): add A11Y report deployment and PR comment integration
walterra 317af37
refactor(ci): improve code formatting in e2e reports script
walterra bbe6e4e
Merge branch 'main' into a11y-e2e-baseline
walterra 5af5ad6
set parallelism to 1 for a11y e2e tests
walterra 0dd4b46
skip flame chart a11y tests
walterra a63c147
more distinct naming related to VRT/A11Y e2e tests
walterra 59f17fe
Merge branch 'main' into a11y-e2e-baseline
walterra c8ee7fb
add vrt postfix to playwright references
walterra 011a06b
add more vrt references
walterra 37b7e35
fix e2e->vrt
walterra 18dad61
fix firebase deploy
walterra 7c9cc4e
Merge branch 'main' into a11y-e2e-baseline
walterra f16bd3b
fix: review feedback
walterra 0bdbc20
Merge branch 'main' into a11y-e2e-baseline
walterra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
| * in compliance with, at your election, the Elastic License 2.0 or the Server | ||
| * Side Public License, v 1. | ||
| */ | ||
|
|
||
| import path from 'path'; | ||
|
|
||
| import { getMetadata, setMetadata } from 'buildkite-agent-node'; | ||
|
|
||
| import { updateCheckStatus } from './../../utils/github'; | ||
| import { exec, downloadArtifacts, startGroup, yarnInstall, getNumber, decompress, compress, bkEnv } from '../../utils'; | ||
| import { ENV_URL } from '../../utils/constants'; | ||
|
|
||
| const jobIndex = getNumber(process.env.BUILDKITE_PARALLEL_JOB); | ||
| const shardIndex = jobIndex ? jobIndex + 1 : 1; | ||
| const jobTotal = getNumber(process.env.BUILDKITE_PARALLEL_JOB_COUNT); | ||
|
|
||
| const pwFlags = ['--project=Chrome', '--config=playwright.a11y.config.ts']; | ||
|
|
||
| if (jobIndex !== null && jobTotal !== null) { | ||
| pwFlags.push(`--shard=${shardIndex}/${jobTotal}`); | ||
| } | ||
|
|
||
| void (async () => { | ||
| await yarnInstall('e2e'); | ||
|
|
||
| const key = `${bkEnv.checkId}--activeJobs`; | ||
| const value = shardIndex === jobTotal ? jobTotal - 1 : Number(await getMetadata(key)); | ||
| // TODO improve this status logic, not easy to communicate state of parallel steps | ||
| const activeJobs = Math.min((Number.isNaN(value) ? 0 : value) + 1, jobTotal ?? 1); | ||
| await setMetadata(key, String(activeJobs)); | ||
|
|
||
| await updateCheckStatus( | ||
| { | ||
| status: 'in_progress', | ||
| }, | ||
| 'playwright_a11y', | ||
| `${activeJobs} of ${jobTotal ?? 1} a11y jobs started`, | ||
| ); | ||
|
|
||
| const src = '.buildkite/artifacts/e2e_server.gz'; | ||
| await downloadArtifacts(src, 'build_e2e'); | ||
| await decompress({ | ||
| src, | ||
| dest: 'e2e/server', | ||
| }); | ||
|
|
||
| startGroup('Check Architecture'); | ||
| await exec('arch'); | ||
|
|
||
| startGroup('Running e2e a11y playwright job'); | ||
| const reportDir = `reports/a11y_report_${shardIndex}`; | ||
| async function postCommandTasks() { | ||
| await compress({ | ||
| src: path.join('e2e', reportDir), | ||
| dest: `.buildkite/artifacts/a11y_reports/report_${shardIndex}.gz`, | ||
| }); | ||
| } | ||
|
|
||
| const command = `yarn playwright test ${pwFlags.join(' ')}`; | ||
|
|
||
| try { | ||
| await exec(command, { | ||
| cwd: 'e2e', | ||
| env: { | ||
| [ENV_URL]: 'http://127.0.0.1:9002', | ||
| PLAYWRIGHT_HTML_REPORT: reportDir, | ||
| PLAYWRIGHT_JSON_OUTPUT_NAME: `reports/a11y-json/report_${shardIndex}.json`, | ||
| }, | ||
| }); | ||
| await postCommandTasks(); | ||
| } catch (error) { | ||
| await postCommandTasks(); | ||
| throw error; | ||
| } | ||
| })(); | ||
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
| * in compliance with, at your election, the Elastic License 2.0 or the Server | ||
| * Side Public License, v 1. | ||
| */ | ||
|
|
||
| import type { CustomGroupStep } from '../utils'; | ||
| import { createStep, commandStepDefaults, Plugins } from '../utils'; | ||
|
|
||
| export const playwrightA11yStep = createStep<CustomGroupStep>(() => { | ||
| const skip = false; | ||
| const parallelKey = 'playwright_a11y__parallel-step'; | ||
| return { | ||
| group: ':playwright: Playwright e2e A11Y', | ||
| key: 'playwright_a11y', | ||
| skip, | ||
| steps: [ | ||
| { | ||
| ...commandStepDefaults, | ||
| label: ':playwright: Playwright e2e A11Y', | ||
| skip, | ||
| parallelism: 1, | ||
| retry: { | ||
| automatic: [ | ||
| { | ||
| // Playwright tests likely failed correctly | ||
| exit_status: 1, | ||
| limit: 0, | ||
| }, | ||
| { | ||
| // Something went wrong with step command setup, retry once | ||
| exit_status: '*', | ||
| limit: 1, | ||
| }, | ||
| ], | ||
| }, | ||
| timeout_in_minutes: 10, // Shorter timeout for a11y tests | ||
| key: parallelKey, | ||
| depends_on: ['build_e2e'], | ||
| plugins: [Plugins.docker.playwright()], | ||
| artifact_paths: ['.buildkite/artifacts/a11y_reports/*', 'e2e/reports/a11y-json/*'], | ||
| commands: ['npx ts-node .buildkite/scripts/steps/playwright_a11y.ts'], | ||
| }, | ||
| { | ||
| ...commandStepDefaults, | ||
| key: 'playwright_a11y_merge_and_status', | ||
| label: ':playwright: Set a11y group status and merge reports', | ||
| skip, | ||
| allow_dependency_failure: true, | ||
| depends_on: [{ step: parallelKey, allow_failure: true }], | ||
| commands: ['npx ts-node .buildkite/scripts/steps/e2e_reports.ts'], | ||
| env: { | ||
| ECH_CHECK_ID: 'playwright_a11y', | ||
| }, | ||
| }, | ||
| ], | ||
| }; | ||
| }); |
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.