I\'m starting to learn Cypress. I have a 4 row table (with a class of datatable). I can verify the number of rows this way:
cy.get(\'.datatable\').find(\'tr\
One option is to use "have.length" ...
cy.get('.datatable tr').should('have.length', 4)
...another option is to use should
cy.get('.datatable tr').should(($tr) => {
expect($tr).to.have.length(4)
})
...or then (synchronous queries)
cy.get('.datatable').then(($table) => {
// synchronously query to find length of elements
expect($table.find('td').length).to.equal(4)
})