Here is the code snippet I am working with:
cy.get('[data-testid="userRecords"]')
.each((record) => {
if (record.find('[data-testid="delete"]').is(":enabled"))
{
cy.wrap(record).find('[data-testid="delete"]').click()
if (someValue == 1)
{
cy.get('[data-testid="test"]').should("be.visible");
}
else
{
cy.get('[data-tstid="anotherTest"]').should("be.not.exist")
}
return false;
}
My main objective is to stop the each
loop if the outer if
statement is true.
Can anyone explain why I am having trouble exiting the each
loop?