thousands-house-85089
01/20/2023, 1:44 PMcy.get('[data-cy=<tag here>]')
to get all the elements with that tag (i.e. will return 3 elements in your screenshot.
The other approach I would use without front-end work would be something like
js
cy.get('#headerHolder')
.within(() => {
cy.contains('Book now')
})
First you're getting the main header, or higher level div which contains the other elements, then use the powerful cy.contains to look for the string within child divs.
Something like this approach, although because you have multiple 'Book now' buttons you might want to be more specific of parent div before doing the cy.contains()