Click A Random Element

preview_player
Показать описание

.its('length')
.then(function (n) {
return Cypress._.random(0, n - 1)
})
.then(function (k) {
.eq(k)
.click()
})

Рекомендации по теме
Комментарии
Автор

How crazy cypress is 😅, this is so powerful framework for the e2e test

AdnanErlansyah-nxxp
Автор

Hi Gleb Bahmotov

Can you please create a video on token generation class as generic and generated token can be used in testcases???

soonepetto
Автор

Hi gleb, I have a question why shouldn't we pick random elemnts in automated tests? Let's say I have some dynamic content which is set by content editors using some kind of CMS like WordPress or ContentStack so for example I don't know exact values. I thought using random items might act more like a real user and can catch more bugs.

rwojciechowski
Автор

hi, at 0:54, in my case it was show "hidden icon with count value". Because of that it shows zero value for " .then(cy.log)" . how to solve this

CLICKCAST