-
Notifications
You must be signed in to change notification settings - Fork 341
Accessibility test Kitchen Sink with Playwright #1260
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
drammock
merged 56 commits into
pydata:main
from
gabalafou:playwright-a11y-test-kitchen-sink
Apr 14, 2023
Merged
Changes from 49 commits
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
e3ed101
Add core-js so dev build works
gabalafou a16cc88
add more pages, test server
gabalafou 68079b2
add documentation
gabalafou 5030606
add prerequisites to nox test
gabalafou 423ed5d
update package-lock.json via stb
gabalafou de4e2dd
update package-lock.json via nox -s compile
gabalafou 310f171
streamline, update docs
gabalafou 09906c1
typo
gabalafou 2480b00
sync lockfile (remove core-js)
gabalafou 6f938ba
Update tests/utils.py
gabalafou b5b57ca
Update tests/README.md
gabalafou f47a60a
Update docs/community/topics/accessibility.md
gabalafou 62b6ae7
Update tests/README.md
gabalafou fc04acf
Update tests/utils.py
gabalafou 23be214
Update tests/utils.py
gabalafou 66fac74
- nox session a11y
gabalafou bc311db
update docs
gabalafou 94fb49f
Merge branch 'main' into playwright-a11y-test-kitchen-sink
gabalafou 9436844
uncomment commented-out tests
gabalafou e5a8814
regenerate package-lock.json via:
gabalafou 3f86b11
oops finish updating tests
gabalafou 700b64a
do not include a11y tests in main test session
gabalafou c57011d
remove redundant decorator
gabalafou ced281d
Update tests/README.md
gabalafou 33b10ac
Update tests/README.md
gabalafou f8cee2c
Update tests/README.md
gabalafou 9df077a
Remove base-url Pytest plugin
gabalafou 1c2b8d5
Update tests/utils/pretty_axe_results.py
gabalafou a4325f5
Apply suggestions from code review
gabalafou 72dfedc
Merge branch 'main' into playwright-a11y-test-kitchen-sink
gabalafou f1c8007
fix pretty_axe_results
gabalafou 0317729
Generate each test run from parameters
gabalafou 744fc94
remove unused marker url_path
gabalafou 5e06478
undo multiline
gabalafou 6820864
update doc string
gabalafou 419d9e8
Add CI check for --with-deps suggested by Tony
gabalafou c18dbd6
oops, rm extra playwright install line
gabalafou e63d3e7
update comment
gabalafou 83af9ac
update docstring
gabalafou 178a689
Merge remote-tracking branch 'upstream/main' into playwright-a11y-tes…
drammock f7b92ea
testing the pytest-axe mark
drammock 926d426
run prettier
drammock 49c15a9
Revert "testing the pytest-axe mark"
drammock 036506b
Fix D104
drammock 0f0d599
skip a11y tests on CI runs
drammock 2176326
run a11y tests on one CI worker only
drammock ec6a9d7
:white_check_mark: Register a11y mark and separate dependencies
trallard 452ef73
:construction_worker: Update CI - delegate playwright install and cache
trallard 71a86ac
📝 Update test docs
trallard 645202c
:white_check_mark: Ensure a11y tests are skipped unles called
trallard 07b9566
:construction_worker: Ensure CI installs all deps
trallard 19ccd1b
:rewind: Revert to installing playwright
trallard 112a27a
:construction_worker: Forgot to re-add a11y deps
trallard 00005d2
:pencil2: Fix typo
trallard b9d83f6
:wrench: Fix path - seems to have been messed up when moving things
trallard 22953ed
Update tests/test_a11y.py
drammock 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,6 +56,9 @@ jobs: | |
# windows test | ||
- os: windows-latest | ||
python-version: "3.11" | ||
# needed to cache the browsers for the accessibility tests | ||
env: | ||
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/pw-browsers | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
@@ -90,14 +93,34 @@ jobs: | |
pip install nox | ||
nox -s compile | ||
- name: Run tests | ||
run: pytest --color=yes --cov pydata_sphinx_theme --cov-branch --cov-report xml:cov.xml --cov-report= --cov-fail-under ${{ env.COVERAGE_THRESHOLD }} | ||
run: pytest -m "not a11y" --color=yes --cov pydata_sphinx_theme --cov-branch --cov-report xml:cov.xml --cov-report= --cov-fail-under ${{ env.COVERAGE_THRESHOLD }} | ||
- name: Upload to Codecov | ||
if: matrix.python-version == '3.11' && matrix.os == 'ubuntu-latest' | ||
uses: codecov/[email protected] | ||
with: | ||
files: cov.xml | ||
fail_ci_if_error: true | ||
|
||
# note I am setting this on top of the Python cache as I could not find | ||
# how to set the hash key on the python one | ||
- name: Set up browser cache (for accessibility tests) | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
${{ github.workspace }}/pw-browsers | ||
key: ${{ runner.os }}-pw-${{ hashFiles('pyproject.toml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pw- | ||
|
||
- name: Run accessibility tests with playwright | ||
if: matrix.python-version == '3.11' && matrix.os == 'ubuntu-latest' | ||
run: | | ||
pip install playwright | ||
python -m playwright install --with-deps | ||
stb compile | ||
sphinx-build -b=html docs/ docs/_build/html | ||
pytest -m a11y | ||
|
||
# Build our site on the 3 major OSes and check for Sphinx warnings | ||
build-site: | ||
needs: [lint] | ||
|
@@ -124,7 +147,7 @@ jobs: | |
- name: Build docs | ||
run: sphinx-build -b html docs/ docs/_build/html --keep-going -w warnings.txt | ||
- name: Check for unexpected Sphinx warnings | ||
run: python tests/check_warnings.py | ||
run: python tests/utils/check_warnings.py | ||
|
||
# Run local Lighthouse audit against built site | ||
audit: | ||
|
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 |
---|---|---|
@@ -1,11 +1,18 @@ | ||
# Accessibility checks | ||
|
||
The accessibility checking tools can find a number of common HTML patterns which | ||
```{note} | ||
April-2023: we are currently | ||
[re-evaluating how we do accessibility checks](https://github.com/pydata/pydata-sphinx-theme/issues/1168) | ||
and reporting, so this may change soon. | ||
``` | ||
|
||
In general, accessibility-checking tools can find a limited number of common HTML patterns which | ||
assistive technology can't help users understand. | ||
We run a [Lighthouse](https://developers.google.com/web/tools/lighthouse) job in our CI/CD, which generates a "score" for all pages in our **Kitchen Sink** example documentation. | ||
The configuration for Lighthouse is in: | ||
|
||
- `.github/workflows/lighthouserc.json` | ||
## Accessibility checks as part of our development process | ||
|
||
We run a [Lighthouse](https://developers.google.com/web/tools/lighthouse) job in our CI/CD, which generates a "score" for all pages in our **Kitchen Sink** example documentation. | ||
The configuration for Lighthouse can be found in the `.github/workflows/lighthouserc.json` file. | ||
|
||
For more information about configuring lighthouse, see [the lighthouse documentation](https://github.com/GoogleChrome/lighthouse-ci/blob/main/docs/configuration.md). | ||
For more information about configuring Lighthouse, see [the Lighthouse documentation](https://github.com/GoogleChrome/lighthouse-ci/blob/main/docs/configuration.md). | ||
For more information about Accessibility in general, see [](../../user_guide/accessibility.rst). |
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
gabalafou marked this conversation as resolved.
Show resolved
Hide resolved
gabalafou marked this conversation as resolved.
Show resolved
Hide resolved
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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.