I have ajax table in my web and this table has many pages. My goal is to go through all the rows and columns, go to the next page and make the following procedure until the end of the page. I have the following code:
for(let i = 0; i < 10; i++){
cy.get('tr:has(td)').each(($tr, rowIndex) => { // look at each row individually
cy.wrap($tr)
.find('td') // all cols inside this row
.invoke('slice', 5, 8) // filter to last 3 cols only
.invoke('text') // get all the text in one lump
.then(text => {
if (text.trim() === '') { // after trim(), is all text empty?
console.log(`Row ${rowIndex+1} has three empty cols`)
cy.wrap($tr).find('td').eq(5).click({force: true}) // click the 6th col
cy.wait(4000)
cy.get('.review-modal_textarea_3L5AQ').eq(0).should('be.visible').type(str)
cy.get('.pagination_pagination_2iOOV > :nth-child(4)').click({force: true}) //clicking to the next page
}
I managed to go through all rows and columns in one page, but having problem going to the next page (its going just one time). I think I have problem with loop. It simply doesn't working. I have i<10 because I have 10 pages, but the pages can be more (may there is a way to do it without for loop). How can I solve this problem?