Skip to content

Files

Latest commit

 

History

History
29 lines (19 loc) · 583 Bytes

require-data-selectors.md

File metadata and controls

29 lines (19 loc) · 583 Bytes

Pattern: Missing use of data-* attribute

Issue: -

Description

Forces cy.get to allow selectors that target data-* attributes.

Example of incorrect code:

cy.get(".a")
cy.get('[daedta-cy=submit]').click()
cy.get('[d-cy=submit]')
cy.get(".btn-large").click()
cy.get(".btn-.large").click()

Example of correct code:

cy.get('[data-cy=submit]').click()
cy.get('[data-QA=submit]')

Further Reading