Skip to content
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

Add WCAG PR check #274

Merged
merged 39 commits into from Aug 5, 2022
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
37874b6
Add WCAG PR check
nmanu1 Aug 2, 2022
8780aec
Automated update to THIRD-PARTY-NOTICES from github action's 3rd part…
github-actions[bot] Aug 2, 2022
a1c7241
Try sleeping
nmanu1 Aug 2, 2022
16c8437
Sleep longer
nmanu1 Aug 2, 2022
9882621
Fix wrong port and update package versions
nmanu1 Aug 2, 2022
4dc074b
Revert "Fix wrong port and update package versions"
nmanu1 Aug 2, 2022
931c341
Fix port and update some imports
nmanu1 Aug 2, 2022
e983c1e
Remove build
nmanu1 Aug 2, 2022
8dfe7c7
Remove extra steps
nmanu1 Aug 2, 2022
6012358
Bump some package versions
nmanu1 Aug 2, 2022
9fcac7f
Update more packages
nmanu1 Aug 2, 2022
cd16587
Bump a11y
nmanu1 Aug 2, 2022
fe13233
Bump actions
nmanu1 Aug 2, 2022
b7d9c6e
Bump links to 6.5.0
nmanu1 Aug 2, 2022
ea9fa1c
Upgrade percy
nmanu1 Aug 2, 2022
bfaae61
Bump links to 6.5.9
nmanu1 Aug 2, 2022
301c281
Try smoke-test
nmanu1 Aug 3, 2022
1123603
Revert "Try smoke-test"
nmanu1 Aug 3, 2022
1c0172f
Try bash script
nmanu1 Aug 3, 2022
6402c37
Try wrapping script
nmanu1 Aug 3, 2022
a7c0dbc
Try one long line
nmanu1 Aug 3, 2022
8bc9017
Remove |
nmanu1 Aug 3, 2022
4e77d97
Semicolons
nmanu1 Aug 3, 2022
6110549
Shorten
nmanu1 Aug 3, 2022
5e59685
Update packages and use TS
nmanu1 Aug 4, 2022
022bf2a
Upgrade percy/storybook
nmanu1 Aug 4, 2022
740ae60
Format and make quiet
nmanu1 Aug 4, 2022
cc9c956
Export default
nmanu1 Aug 4, 2022
e23d88c
Merge branch 'main' into dev/wcag-pr-check
nmanu1 Aug 4, 2022
5043813
Reuse script
nmanu1 Aug 4, 2022
ee5e7cf
Fix paths
nmanu1 Aug 4, 2022
7bd00a5
Try npm run command
nmanu1 Aug 4, 2022
212892a
oops
nmanu1 Aug 4, 2022
174bcba
Try some TS
nmanu1 Aug 4, 2022
074458d
Revert "Try some TS"
nmanu1 Aug 4, 2022
2fadcdd
Fix spacing
nmanu1 Aug 4, 2022
14ca6f8
Add asterisk
nmanu1 Aug 4, 2022
31f31fa
Abstract out wcag config
nmanu1 Aug 4, 2022
8e581aa
Update package-lock
nmanu1 Aug 4, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/wcag_test.yml
@@ -0,0 +1,19 @@
name: WCAG tests

on:
pull_request:
branches:
- main

jobs:
call_wcag_test:
uses: yext/slapshot-reusable-workflows/.github/workflows/wcag_test.yml@v1
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
with:
build_script: |
npm run storybook -- --quiet &
until curl http://localhost:6006 -I --silent
nmanu1 marked this conversation as resolved.
Show resolved Hide resolved
do
sleep 1
done
31 changes: 31 additions & 0 deletions .storybook/test-runner.ts
@@ -0,0 +1,31 @@
import { injectAxe, checkA11y } from 'axe-playwright';
import { Page } from 'playwright-core';

/*
* See https://storybook.js.org/docs/react/writing-tests/test-runner#test-hook-api-experimental
nmanu1 marked this conversation as resolved.
Show resolved Hide resolved
* to learn more about the test-runner hooks API.
*/
const renderFunctions = {
async preRender(page: Page) {
await injectAxe(page);
},
async postRender(page: Page, context) {
await checkA11y(page, '#root', {
axeOptions: {
runOnly: {
type: 'tag',
values: ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']
},
rules: {
'color-contrast': { enabled: context.name !== 'Loading' }
},
nmanu1 marked this conversation as resolved.
Show resolved Hide resolved
},
detailedReport: true,
detailedReportOptions: {
html: true,
},
});
},
};

export default renderFunctions;
2 changes: 1 addition & 1 deletion THIRD-PARTY-NOTICES
Expand Up @@ -4,7 +4,7 @@ The following NPM packages may be included in this product:
- @babel/helper-validator-identifier@7.16.7
- @babel/highlight@7.16.10
- @babel/runtime-corejs3@7.17.2
- @babel/runtime@7.16.7
- @babel/runtime@7.18.9

These packages each contain the following license and notice below:

Expand Down