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
Refactor Accessibility Testing #3814
Conversation
Terraform plan for meta No changes. Your infrastructure matches the configuration.
✅ Plan applied in Deploy to Development and Management Environment #679 |
Terraform plan for dev No changes. Your infrastructure matches the configuration.
✅ Plan applied in Deploy to Development and Management Environment #679 |
Minimum allowed coverage is Generated by 🐒 cobertura-action against ecd9cfa |
Testing this branch from GitHub Actions has proven difficult - to ensure this doesn't hang for too long, I've un-drafted it without the workflow changes. A later PR can pick up workflow changes to get a11y tests running on every PR. |
backend/dissemination/management/commands/end_to_end_test_data_generator.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great addition!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small thing we can tackle next week (happy to help): let's remove the old test_a11y
commands and dependencies and do a sweep for straggler config or helper files previously used for pa11y
and maybe lighthouse (though I'm not sure if there are other reasons to keep it around).
We should replace the old a11y
npm commands with new ones for cypress. It might be useful to add a local-specific npm command that automatically loads fixtures as well.
docs/testing.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for updating the docs! This is excellent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea 👍
This is really excellent, @jperson1! It looks fairly feature-complete to me, but I think we need to do a sweep for a couple |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates, @jperson1! For good measure, I ran the a11y tests manually and everything looks great here.
Refactor Accessibility Testing
Issue: #3618
Drafting initially to ensure GHA workflows work properly.
Brief overview:
cypress-axe
to run accessibility testsload_fixtures
command to add a few more SACs per user, and some dummy dissemination data.Changes:
cypress-axe
.load_fixtures
management command to support the new tests.DISABLE_AUTH=True
. Similarly, allow access to the homepage without redirection ifDISABLE_AUTH=True
.How to test:
Please follow the instructions in the "Accessibility" section of
testing.md
. But basically:DISABLE_AUTH=True
load_fixtures
management command in the docker container after "logging in" once.All the accessibility changes by page:
Sometimes, you just need h1's.
Some funky fresh screenshots:
Cypress accessibility test results (headless mode):
An accessibility error during Cypress tests (standalone mode):
PR checklist: submitters
main
into your branch shortly before creating the PR. (You should also be mergingmain
into your branch regularly during development.)git status | grep migrations
. If there are any results, you probably need to add them to the branch for the PR. Your PR should have only one new migration file for each of the component apps, except in rare circumstances; you may need to delete some and re-runpython manage.py makemigrations
to reduce the number to one. (Also, unless in exceptional circumstances, your PR should not delete any migration files.)PR checklist: reviewers
make docker-clean; make docker-first-run && docker compose up
; then rundocker compose exec web /bin/bash -c "python manage.py test"
The larger the PR, the stricter we should be about these points.