Skip to content

Commit e673390

Browse files
authored
added exclude
1 parent a8a38e1 commit e673390

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,12 @@ it('passes axe', () => {
8989
cy.visit('/')
9090
cy.injectAxe()
9191
// ...
92-
cy.get('.my-button').checkA11y() // target certain elements
93-
// OR
94-
cy.checkA11y() // check the whole document
92+
93+
cy.checkA11y() // checks the whole document
94+
95+
cy.get('#mobile-menu').checkA11y() // checks id="mobile-menu only
96+
97+
cy.wrap({ exclude: ['.not-me']}).checkA11y() // checks the whole document except class=".not-me"
9598
})
9699
```
97100

0 commit comments

Comments
 (0)