Bird
0
0

Which command correctly injects axe into the page before running accessibility checks in Cypress?

easy📝 Syntax Q12 of 15
Cypress - Plugins and Ecosystem
Which command correctly injects axe into the page before running accessibility checks in Cypress?
Acy.runAxe()
Bcy.loadAxe()
Ccy.injectAxe()
Dcy.startAxe()
Step-by-Step Solution
Solution:
  1. Step 1: Recall the cypress-axe setup command

    The official command to inject axe into the page is cy.injectAxe().
  2. Step 2: Verify other options

    Other options like cy.runAxe(), cy.loadAxe(), and cy.startAxe() are not valid Cypress commands for this purpose.
  3. Final Answer:

    cy.injectAxe() -> Option C
  4. Quick Check:

    Inject axe = cy.injectAxe() [OK]
Quick Trick: Use cy.injectAxe() to add axe before checks [OK]
Common Mistakes:
  • Using cy.runAxe() instead of cy.injectAxe()
  • Confusing command names
  • Forgetting to inject axe before checking

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Cypress Quizzes