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

More detailed failure report #191

Open
ericmasiello opened this issue Nov 17, 2022 · 1 comment
Open

More detailed failure report #191

ericmasiello opened this issue Nov 17, 2022 · 1 comment

Comments

@ericmasiello
Copy link

What would you like to see in the library?
I am using cypress-audit purely to test for accessibility failures. As such, my tests are very simple, e.g.

describe('Mobile Dock', () => {
    beforeEach(() => {
        cy.visit('/mobile-dock');
    });

    it('should pass lighthouse audit', () => {
        cy.lighthouse({
            accessibility: 100,
        });
    });

    it('should pass pa11y audit', () => {
        cy.pa11y();
    });
});

However, if i my lighthouse score fails, Cypress only reports that it did not meet the 100 value. What I'd like to know is which specific aspects of accessibility it failed on.

Why?
This reduces friction in diagnosing accessibility problems. Right now, my only recourse is to manually rerun the same page in Chrome with Lighthouse and look its detailed output to understand why the failure occurred.

Any other information that may help understanding the need
N/A

@MuckT
Copy link
Contributor

MuckT commented Mar 27, 2023

@ericmasiello try adding this to your cypress.config.ts
The results of the audits should now be in your console in .xml but present.

reporter: 'junit',
reporterOptions: {
  mochaFile: 'cypress/results/[hash]-test-output.xml',
  toConsole: true,
},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants