sclavijosuero / wick-a11y

Cypress plugin for performing configurable Accessibility tests using AXE. Flawless integration in Cypress with violations shown graphically on the web page and the Cypress log, and generating HTML document with violations details and screenshot.
MIT License
24 stars 3 forks source link

adding retries will throw an error #12

Open h2oearth opened 1 week ago

h2oearth commented 1 week ago

Hi,

First of all, Thank you for wick-a11y!

I am starting to play with your plugin, and I have noticed that if I enable retries, I get an error.

cy.checkAccessibility(null, {
  impactStyling: customImpactStyling,
  includedImpacts: ['critical', 'serious', 'moderate'],
  retries: 3,
});
Screenshot 2024-11-09 at 6 04 28 pm
sclavijosuero commented 1 week ago

Hi @h2oearth , thank you for the feedback and reporting this possible issue. This retires parameter is part of cypress-axe instead of wick-a11y.

Usually for retries with wick-a11y I use the retries parameter in Cypress config file:

  retries: {
    openMode: 1,
    runMode: 1,
  },

This works pretty well and shows nicely in the cypress log (or even in Cypress Cloud if you are recording the results):

image

I will have a look though and see if there is any incompatibility between wick-a11y and this retries parameter from cypress-axe.

sclavijosuero commented 1 week ago

@h2oearth , I have tried retries parameter and is working fine.

it('Check accessibility Parabank web site', { defaultCommandTimeout: 15000 }, () => {
    cy.visit('https://parabank.parasoft.com/parabank/index.htm')
    cy.wait(2000) // Using cy.wait(TIME) is a very bad practice, but it is used for simplicity in this example

    cy.checkAccessibility(null, { includedImpacts: ['critical', 'serious', 'moderate', 'minor'], retries: 10 })
});

In this case since I retry 10 times it takes much more time until ended up failing when there are violations. Could you try that tests I did above?

If the error still persist, then should be something with your installation or configuration of wick-a11y. Notice that you do not have to install cypress-axe or axe-core in your project, when you install wick-a11y it take care of all that for you.

If even with that still persist, I would need access to your repo when you have all configured so I can try to reproduce. Hope this helps!