'Exclude Best Practices From Angular Cypress E2E Test Using Axe

I'm working in an Angular project that has Cypress E2E Tests set-up. The E2E tests are using cypress-axe to perform an accessibility test.

We've been using the Axe DevTools (Chrome Browser Extension) with the 'Best Practices' turned OFF.

However, the cypress-axe test is using the best practices. Is there a configuration we can add to checkA11y() to turn off the best practices?

Here's what my checkA11y() looks like now:

cy.checkA11y(
   null,
   {
      includedImpacts: ["critical", "serious", "moderate"],
      rules: {
         "color-contrast": { enabled: false }
      }
   } as Options,
   terminalLog
);

I want to be able to run the E2E tests and get the same result that I would running the browser extension with 'Best Practices' turned off.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source