How to use findByRole and only get the element containing the exact string (and no more)

Viewed 21

I want to find a link using findByRole with the name "word". There's also a link with the name "word with". How can I use

cy.findByRole('link', { name: /name/i })

and only get the link containing "name"?

0 Answers
Related