-
Notifications
You must be signed in to change notification settings - Fork 11
Add WCAG PR check #274
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
Add WCAG PR check #274
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
37874b6
Add WCAG PR check
nmanu1 8780aec
Automated update to THIRD-PARTY-NOTICES from github action's 3rd part…
github-actions[bot] a1c7241
Try sleeping
nmanu1 16c8437
Sleep longer
nmanu1 9882621
Fix wrong port and update package versions
nmanu1 4dc074b
Revert "Fix wrong port and update package versions"
nmanu1 931c341
Fix port and update some imports
nmanu1 e983c1e
Remove build
nmanu1 8dfe7c7
Remove extra steps
nmanu1 6012358
Bump some package versions
nmanu1 9fcac7f
Update more packages
nmanu1 cd16587
Bump a11y
nmanu1 fe13233
Bump actions
nmanu1 b7d9c6e
Bump links to 6.5.0
nmanu1 ea9fa1c
Upgrade percy
nmanu1 bfaae61
Bump links to 6.5.9
nmanu1 301c281
Try smoke-test
nmanu1 1123603
Revert "Try smoke-test"
nmanu1 1c0172f
Try bash script
nmanu1 6402c37
Try wrapping script
nmanu1 a7c0dbc
Try one long line
nmanu1 8bc9017
Remove |
nmanu1 4e77d97
Semicolons
nmanu1 6110549
Shorten
nmanu1 5e59685
Update packages and use TS
nmanu1 022bf2a
Upgrade percy/storybook
nmanu1 740ae60
Format and make quiet
nmanu1 cc9c956
Export default
nmanu1 e23d88c
Merge branch 'main' into dev/wcag-pr-check
nmanu1 5043813
Reuse script
nmanu1 ee5e7cf
Fix paths
nmanu1 7bd00a5
Try npm run command
nmanu1 212892a
oops
nmanu1 174bcba
Try some TS
nmanu1 074458d
Revert "Try some TS"
nmanu1 2fadcdd
Fix spacing
nmanu1 14ca6f8
Add asterisk
nmanu1 31f31fa
Abstract out wcag config
nmanu1 8e581aa
Update package-lock
nmanu1 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
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: ./tests/scripts/start-storybook.sh |
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,29 @@ | ||
import { injectAxe, checkA11y } from 'axe-playwright'; | ||
import { Page } from 'playwright-core'; | ||
import { runOnly } from './wcagConfig'; | ||
|
||
/** | ||
* See https://storybook.js.org/docs/react/writing-tests/test-runner#test-hook-api-experimental | ||
* 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, | ||
rules: { | ||
'color-contrast': { enabled: context.name !== 'Loading' } | ||
}, | ||
}, | ||
detailedReport: true, | ||
detailedReportOptions: { | ||
html: true, | ||
}, | ||
}); | ||
}, | ||
}; | ||
|
||
export default renderFunctions; |
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,6 @@ | ||
import { axeOptionsConfig } from 'axe-playwright'; | ||
|
||
export const runOnly: axeOptionsConfig['axeOptions']['runOnly'] = { | ||
type: 'tag', | ||
values: ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa'] | ||
}; |
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.