component-driven / cypress-axe

Test accessibility with axe-core in Cypress
MIT License
622 stars 86 forks source link

Using a different assertion library? #46

Open GCHQDeveloper911 opened 4 years ago

GCHQDeveloper911 commented 4 years ago

Firstly, cypress-axe is brilliant! Previously I was using axe-core with webdriverio, and it was painfully slow! However, one frustration with cypress-axe is the use of node assert. Elsewhere in our tests I'm using the chai library bundled into Cypress, which I have also extended to provide soft assertions (ie, continue on assertion fail) based on code found here:https://stackoverflow.com/questions/55868107/does-cypress-support-soft-assertion

I have modified cypress-axe locally to use chai.softExpect, and it behaves as I'd like. this allows me to run multiple a11y checks against different pages / page sections in the same test.

Might it be possible to have some sort of configuration option that allowed the user to specify which assertion library / method to use? Or something similar?

sapegin commented 4 years ago

Could you post some examples? Ideally, both of your changes and how are you using them.