I have a page where I land that have about 15 icons on it all with the same source. The way im grabbing each element looks like this:
JavaScript
x
2
1
cy.get('[src="someSource"]').click({ multiple: true })
2
The issue that have is that after clicking on an icon I have a model that pops up where I need to click another button before I can continue to the next icon.
I there a way for me to add another click in between each of these icons ?
Advertisement
Answer
You can use each()
for this:
JavaScript
1
5
1
cy.get('[src="someSource"]').each(($ele) => {
2
cy.wrap($ele).click()
3
//code to click the modal button
4
})
5