cypress-axe icon indicating copy to clipboard operation
cypress-axe copied to clipboard

checkA11y failing when called after setting cy.clock

Open moizang opened this issue 4 years ago • 3 comments

Hi,

I noticed that checkA11y failed when called after using the cy.clock(...) function to set a date

I get the following error when trying to call checkA11y :

cy.then() timed out after waiting 4000ms.

Your callback function returned a promise that never resolved.

The callback function was:

function(a){i(e)&&(e=void 0),i(t)&&(t=void 0),i(n)&&(n=void 0);var o=t||{},s=o.includedImpacts,u=r(o,["includedImpacts"]);return a.axe.run(e||a.document,u).then((function(e){var t=e.violations;return s&&Array.isArray(s)&&Boolean(s.length)?t.filter((function(e){return s.includes(e.impact)})):t}))}

Running cypress-axe 0.8.1 and cypress 4.12.1

moizang avatar Sep 22 '20 15:09 moizang

I've been fighting this issue for the past couple days and had not connected the dots with the cy.clock() tests being the culprits until I saw this bug report.

mychalhackman avatar Sep 22 '20 17:09 mychalhackman

I was able to work around this by restoring the clock before calling checkA11y().

mychalhackman avatar Sep 22 '20 17:09 mychalhackman

Thanks for the workaround, I had not thought of that !

moizang avatar Sep 23 '20 08:09 moizang