Добавить
Уведомления

Get The Index Of An Element Using jQuery Method

In this video, we find an element, and then confirm its index among its siblings by invoking the jQuery method index() cy.get('#carousel li.active') // call jQuery index() method // to yield the index of the active LI item .invoke('index') .should('equal', 2) // if you want to work with the index, // yield it to the next command .then(function (index) { cy.log(`index is **${index}**`) }) Find this example and many more at https://glebbahmutov.com/cypress-examples

Иконка канала JavaScript С Основами
22 подписчика
12+
16 просмотров
2 года назад
12+
16 просмотров
2 года назад

In this video, we find an element, and then confirm its index among its siblings by invoking the jQuery method index() cy.get('#carousel li.active') // call jQuery index() method // to yield the index of the active LI item .invoke('index') .should('equal', 2) // if you want to work with the index, // yield it to the next command .then(function (index) { cy.log(`index is **${index}**`) }) Find this example and many more at https://glebbahmutov.com/cypress-examples

, чтобы оставлять комментарии