Nested each loops #29972
Unanswered
MarioIonchev
asked this question in
Questions and Help
Nested each loops
#29972
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, guys. I
m trying to test a product with some attributes that are somehow linked if they are available. I have 4 nested loops and there maybe more in the future. What i
m trying to do is check if the first ones attribute is available -> click() and continue with the same logic in the other nested loops. The last one checks for an available class and if (true) should -> click() and brake the loop. Due to asynchronous nature of Cypress, i
m not able to do it. I tried the cy.wrap() approach, but i get the error ( Element is detached from the DOM). To avoid this im using JQuery, Cypress.$ to get the element in each loop and click(). But when i log the index of each loop i see that they
re not working as nested loops, but are executed 1 by 1. Has any encounter such problem, or am i just doing something wrong here? Every workaround and solution would be appreciated. This is my current version of Cypress -> "cypress": "^11.2.0". Here`s my current code.selectOptions() {
let found = false;
Beta Was this translation helpful? Give feedback.
All reactions