purple-ice-75399
03/16/2023, 11:48 PMconst normalize = (text) => text.replace(/\u200B/g, '')
const matchesSearch = (search) => (_index, label) =>
normalize(label.textContent).includes(search)
which is used like so:
cy.get('label')
.then(($labels) => $labels.filter(matchesSearch('text_to_find_here')))
.find('input')
Would it be better to use cy.contains('label', 'text_to_find_here')
, or what would be the best approach to situations like this?
Thanks!