Confirm The Same Text In A Couple Of Elements

preview_player
Показать описание
You can confirm two elements on the page have the same text:
.invoke('text')
.then(function (text) {
})
If you have more than two elements, it works the same way. For example, let's pick a random SELECT option and then confirm the text is shown in two places:
.mapInvoke('getAttribute', 'value')
.print()
.sample()
.print('picked %o')
.then(function (name) {
})
Рекомендации по теме
Комментарии
Автор

Nice, thanks for this. However, not sure if it can be achieved in this case, but I would generally prefer if you show solutions in plain Cypress, not using plugins. In case someone does not want to or cannot use them.

Clonmanify
visit shbcf.ru