title: Pagination testing via cypress JS
body: <p><a href="https://i.stack.imgur.com/uPHO7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uPHO7.png" alt="enter image description here" /></a>I need to test that when I select some model car, as a result, I have only that model in all pages. So basically I do pagination testing. But I do something wrong that it does not moves to another page although selectors are correct. Please tell me what I am doing wrong.</p>
  <pre><code>findItem(&quot;AUDI&quot;)
     });
     async function findItem(value) {
         async function findInPage(index) {
             let found = false;
             cy.get(&quot;li.page-item:not(.page-pre):not(.page-next)&quot;).as(&quot;pages&quot;);
             await cy.get(&quot;@pages&quot;)
                 .its(&quot;length&quot;)
                 .then(async (len) =&gt; {
                     if (index &gt;= len) {
                         return false;
                     } else {
                         await cy.get(&quot;@pages&quot;)
                             .eq(index)
                             .click();
                         await cy.get(&quot;table tr &gt; td:nth-child(5) p&quot;)
                             .each(async ($itemNameEl, index) =&gt; {
                                 const itemText = $itemNameEl.text().toUpperCase();
                                 cy.log('item ', itemText);
                                 if (itemText.includes(value)) {
                                     found = true;
                                     await cy.wrap($itemNameEl).eq(index);
                                     //cy.get('.chakra-text.css-0').should('include', value)
                                     cy.get('.css-1b4k5p &gt; .chakra-text.css-0')
                                     .each(($el) =&gt; {
                                         expect($el.text().toUpperCase()).to.include(value)
                                      
                                     })
                                     return false;
                                 }
                             })
                             .then(() =&gt; {
                                 if (!found) {
                                     findInPage(++index);
                                 }
                             });
                     }
                 });
         }
         findInPage(0);
  }
  </code></pre>