Bird
0
0

You wrote this Cypress test:

medium📝 Debug Q14 of 15
Cypress - Plugins and Ecosystem
You wrote this Cypress test:
cy.visit('/dashboard')
cy.checkA11y()

But the accessibility check does not run and no errors appear. What is missing?
AYou forgot to call <code>cy.injectAxe()</code> before <code>cy.checkA11y()</code>
BYou need to add <code>cy.wait()</code> before <code>cy.checkA11y()</code>
CYou must pass a selector to <code>cy.checkA11y()</code>
DYou should use <code>cy.runAxe()</code> instead of <code>cy.checkA11y()</code>
Step-by-Step Solution
Solution:
  1. Step 1: Identify missing axe injection

    Before running accessibility checks, axe must be injected with cy.injectAxe().
  2. Step 2: Confirm correct command usage

    Without injection, cy.checkA11y() does not run properly and silently fails.
  3. Final Answer:

    You forgot to call cy.injectAxe() before cy.checkA11y() -> Option A
  4. Quick Check:

    Inject axe first = cy.injectAxe() [OK]
Quick Trick: Always inject axe before checking accessibility [OK]
Common Mistakes:
  • Skipping cy.injectAxe()
  • Adding unnecessary cy.wait()
  • Passing selector when not needed
  • Using wrong command cy.runAxe()

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Cypress Quizzes