I need some help with Nightwatch.js testing. Is there any way to make a .waitForElement if loop? got an app where i move some values between two storages ( randomly 1 >> 2 or 1 << 2) and than perform few more steps if a value is passed to next storage. It goes on for about 1000 times but when one storege is empty it displays an info that movement is cancelled instead a input field to enter a value to move and than loop breaks.
In console I get:
Element <#state_form > div.x_panel1 > table > tbody:nth-child(2) > tr:nth-child(1) > td:nth-child(4) > input> was visible after 71 milliseconds.
Or
Timed out while waiting for element <#state_form > div.x_panel1 > table > tbody:nth-child(2) > tr:nth-child(1) > td:nth-child(4) > input> to be present for 5000 milliseconds. - expected "visible" but got: "not found"
I need to make a loop that if .waitForElement will be failed it should go back to the begining and go through all the fields again and again.
And do not know how to make it true or false statment...