https://cypress.io logo
Need help with pagination #cypress-recurse
# i-need-help
b
The element that I'm trying to click becomes not visible(not exists in DOM) at the last iteration My code is:
Copy code
recurse(
            () => cy.get('[title="next page"] > .page-link'),
            ($next) => $next.is('hidden'),
            {
                timeout: 15000,
                delay: 100,
                log: true,
                debugLog: true,
                post() {
                    cy.get('[title="next page"] > .page-link').click()
                }
            }
        )
Cypress is not finding it How to approach that? Thank you #1064946933187235880
g
isn't the element removed from the DOM on the last page? Thus you need to disable the built-in cypress existence check. I should add a lesson on this to my https://cypress.tips/courses/cypress-plugins course
b
Hi, Gleb! Yes, it gets removed from the dome DOM as soon as last page gets reached. Could you give me a hint on how to disable that Cypress check for this test? I appreciate your response. Thank you! @gray-kilobyte-89541
g
a) use https://cypress.tips/search to find answers b) I added a lesson
7 Views