-
Notifications
You must be signed in to change notification settings - Fork 87
Can we expect html report for the accessibility issues #49
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
Comments
Why do you want to have an HTML specifically? How are you planning to use it? |
Need the same - json and html reports after all tests running. Maybe you could give me a clue about how to collect vulnerabilities and then use it? |
For now you can use cy.checkA11y(subject, null, violations => cy.task('reportA11y', violations), skipFailures) And then do whatever you want with them in your import { sortBy } from 'lodash';
const a11yViolations = {};
function appendA11yViolations(violations) {
for (const { id, impact, description, nodes } of violations) {
if (!a11yViolations[id]) {
a11yViolations[id] = { impact, description, count: 0 };
}
a11yViolations[id].count += nodes.length;
}
}
function printA11ySummary() {
const orders = { critical: 1000, serious: 2000, moderate: 3000, minor: 4000 };
const sorted = sortBy(a11yViolations, ({ impact, count }) => orders[impact] - count);
console.table(sorted);
}
export default (on, config) => {
on('task', {
reportA11y(violations) {
appendA11yViolations(violations);
return null;
},
afterAll() {
printA11ySummary();
return null;
},
});
return config;
}; And add this to your // Send an event we can subscribe to inside a plugin
after(() => {
cy.task('afterAll');
}); I want to include such functionality in the next major release. JSON is definitely a good option but I'm not so sure about HTML — it's a lot more work on templates and styling so I need more details on how folks are going to use it. |
@sapegin - I've implemented html reporting for this package. |
No description provided.
The text was updated successfully, but these errors were encountered: