D
D
Dmitri19982022-01-04 02:13:13
Node.js
Dmitri1998, 2022-01-04 02:13:13

How to do the same test for an array of pages in cypress?

Tried to do so, but gives an error ->Cannot call `cy.visit()` outside a running test.

describe('example to-do app', () => {

  pages.forEach(page => {
      cy.visit(page)
      it(`TEST for page ${page}`, () => {
        cy.get('.home-section').should('have.length', 4)
      })
  })
})

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question