I have this code
cy.visit('http://localhost:3000/')
cy.get('.list').each((list, index, lists) => {
cy.contains('Learn').click()
cy.url().should('include', '/localhost')
cy.get(`[data-testid="card-input-${index}"]`)
.type('Learn Cypress')
.should('have.value', 'Learn Cypress')
cy.get(`[data-testid="btnAdd-${index}"]`).click()
cy.get(".card").each((card, index, cards) => {
cy.get(cards).should('have.length', 4)
})
})
I need this line to return only cards from the specific list. Right now it returns all cards from all lists.
cy.get(cards).should('have.length', 4)
I tried playing with literals, but it return [object object]
cy.get(`${cards}>card`).should('have.length', 4)