t.me/atinfo_chat Telegram группа по автоматизации тестирования

Cypress.io - How to use ElementsCollection

cypressio
page-elements
javascript
Теги: #<Tag:0x00007fb3010f29e8> #<Tag:0x00007fb3010f2358> #<Tag:0x00007fb3010f1f48>

#1

I should check if the page have 20 elements.

It’s very easy with Selenide

$$("[data-test='topic-item']").shouldHave(CollectionCondition.size(20));

But I haven’t idea how to do it with Cypress.io


(Denis Baibak) #2

cy.get('ul>li').each(function () {...}) // Iterate through each 'li'