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

Experimental PR: Research spike - Cypress + Accessibility testing #1675

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
8d1004e
feat(cypress-axe): add Axe a11y testing to Cypress test; add 1 spec t…
machikoyasuda Aug 17, 2023
8233596
feat(cypress-audit): add pa11y testing to each page, but add threshol…
machikoyasuda Aug 17, 2023
b432da3
feat(cypress-audit): add Lighthouse testing to each page, for perf, b…
machikoyasuda Aug 17, 2023
badf681
chore(cypress): add clarifying comments
machikoyasuda Aug 17, 2023
b379961
refactor(cypress): add a11yopts object
machikoyasuda Aug 17, 2023
e359bd4
feat(cypress-lighthouse): only run Lighthouse a11y, best practices. a…
machikoyasuda Aug 17, 2023
6c4d8ca
test(css): experiment - commit this change and rerun tests
machikoyasuda Aug 17, 2023
8831ef5
fix(test-cypress): run Cypress tests in Chrome
machikoyasuda Aug 17, 2023
c8c7d6c
test(gh-action): isolate just axe
machikoyasuda Aug 17, 2023
92ba44c
test(cypress): this test should Fail.
machikoyasuda Aug 18, 2023
6c2b654
test(axe): move inject
machikoyasuda Aug 18, 2023
15f2aab
test(axe): use support file, this test should Fail.
machikoyasuda Aug 18, 2023
88b24e3
test(cypress-axe): turn off supportFile false
machikoyasuda Aug 18, 2023
0b17111
fix(cypress): explicitly define supportFile path
machikoyasuda Aug 18, 2023
4b3377a
test(action): try actions/checkout
machikoyasuda Aug 18, 2023
01beee1
test(action): manually
machikoyasuda Aug 18, 2023
3c55753
test(action): try this one. should fail.
machikoyasuda Aug 18, 2023
1e27bf7
chore: oops
machikoyasuda Aug 18, 2023
c479342
test(action): try docker cypress
machikoyasuda Aug 18, 2023
014a29b
test(action): add run, remove steps
machikoyasuda Aug 18, 2023
c713495
test(action): add npm install
machikoyasuda Aug 18, 2023
4d992e9
test(action): try Head mode in Chrome
machikoyasuda Aug 18, 2023
27287ca
test(action): add v5
machikoyasuda Aug 18, 2023
73f3584
test(action): declare chrome and headed in npx instead
machikoyasuda Aug 18, 2023
358ae2c
test(action): remove cmd
machikoyasuda Aug 18, 2023
f731f4e
test(action): wrong filepath
machikoyasuda Aug 18, 2023
1123757
test(action): fix filepath again
machikoyasuda Aug 18, 2023
f406f3c
test(action): does pa11y or lighthouse work
machikoyasuda Aug 18, 2023
1ad8def
test(action): move injectAxe() to only axe test
machikoyasuda Aug 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/tests-cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ jobs:
env:
CYPRESS_baseUrl: http://localhost:8000
with:
command: npm test
browser: chrome
headed: true
working-directory: tests/cypress
wait-on: http://localhost:8000/healthcheck
spec: specs/accessibility.cy.js

- uses: actions/upload-artifact@v3
if: failure()
Expand Down
1 change: 1 addition & 0 deletions benefits/static/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ main {
}

#skip-to-content {
color: #005681;
left: unset !important;
transform: none;
overflow: hidden;
Expand Down
26 changes: 22 additions & 4 deletions tests/cypress/cypress.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
const { defineConfig } = require("cypress");
const { pa11y, prepareAudit } = require("@cypress-audit/pa11y");
const { lighthouse } = require("@cypress-audit/lighthouse");

module.exports = defineConfig({
downloadsFolder: "downloads",
Expand All @@ -8,12 +10,28 @@ module.exports = defineConfig({
viewportHeight: 960,
videosFolder: "videos",
e2e: {
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
// Adding custom task logging, for better a11y output
// ref: https://docs.cypress.io/api/commands/task#Usage
// https://github.com/component-driven/cypress-axe#using-the-violationcallback-argument
setupNodeEvents(on, config) {
return require("./plugins/index.js")(on, config);
on("before:browser:launch", (browser = {}, launchOptions) => {
prepareAudit(launchOptions);
});
on("task", {
lighthouse: lighthouse(),
pa11y: pa11y(),
log(message) {
console.log(message);
return null;
},
table(message) {
console.table(message);

return null;
},
});
},
specPattern: "specs/**/*.cy.{js,jsx,ts,tsx}",
supportFile: false,
supportFile: "support/e2e.js",
},
});
Loading
Loading