When user click to $clickableCardEl it redirects to another page
it('cards should not to redirect to 404 page', () => {
cy.getByCyId('clickable-card').each($clickableCardEl => {
cy.wrap($clickableCardEl).click().wait(3000);
cy.getByCyId('not-found-content').should('not.exist');
cy.go('back');
});
});
And I get this error
cy.click() failed because the page updated as a result of this
command, but you tried to continue the command chain. The subject is
no longer attached to the DOM, and Cypress cannot requery the page
after commands such as cy.click().
I want to iterate all $clickableCardEl inside each loop and click on them.
2
Answers
try following
I want to iterate all $clickableCardEl inside each loop… – it’s not possible, the page refreshes with each click.
I want to test all cards should not to redirect to 404 page – it’s possible because you can use
cy.request()
to test links.