mirror of
https://github.com/PostHog/posthog.git
synced 2024-11-28 18:26:15 +01:00
36622515f1
* feat: test a11y with Cypress * axe test more pages * archive a11y violations on success too * remove date from file path * don't warn if no accessibility files to upload... they're not on all test jobs * support switching accessibility tests to failing * support aria label on lemon buttons * add story book axe add-on * Defuckulate the tests * oops * can't stop skipping a11y failures for home just yet
18 lines
465 B
JavaScript
18 lines
465 B
JavaScript
export const reportA11y = (options, tag, skipFailures = true) => {
|
|
if (typeof tag !== undefined) {
|
|
tag += '-'
|
|
}
|
|
|
|
// reports on A11y failures without failing the tests
|
|
cy.checkA11y(
|
|
null,
|
|
options,
|
|
(violations) => {
|
|
cy.log(`${violations.length} violation(s) detected`)
|
|
|
|
cy.writeFile(`a11y/${tag}accessibility-violations.json`, JSON.stringify(violations))
|
|
},
|
|
skipFailures
|
|
)
|
|
}
|