filiphric / cypress-plugin-api

Cypress plugin to show your API information in the Cypress UI runner
ISC License
250 stars 33 forks source link

bug: Error when running the tests inside a foreach #82

Closed lucasdonato closed 1 year ago

lucasdonato commented 1 year ago

Hi Filip, when running more than one test within foreach, the timeout error occurs

I'm using cypress version 12.1.0 and cypress-plugin-api version 2.6.1

//It does not work
const ceps = ['30350577', '01001000']
//it works
//const ceps = ['30350577']

describe('GET CEP', () => {
    ceps.forEach(cep => {
        it('search cep', () => {
            cy.api(`https://viacep.com.br/ws/${cep}/json/`).then((req) => {
                expect(req.status).to.eq(200)
            })
        })
    })
})

image

filiphric commented 1 year ago

hey @lucasdonato I believe the cause of this is not the cypress version, but the fact that you have two tests with identical name. I’ll fix this anyway, thanks for reporting!