Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

175
Visualizações
Undefined is not iterable (cannot read property Symbol(Symbol.iterator)) in cypress

` it.only("suggest a price", () => {

const suggestedBidAmount = Math.floor(Math.random() * maxval) + minval;
const vehicleIdSuggestedPrice = "d42f516a867590633dd8a82cb2563437";
const platformIdSuggestPrice = "xxxxx";

cy.request({
  method: "POST",
  url: Cypress.env("apiHostForEndpoints") + "/suggest-price",
  headers: {
    Authorization: Cypress.env("token"),
    "content-type": Cypress.env("contentType"),
  },
  body: {
    id: vehicleIdSuggestedPrice,
    bid: suggestedBidAmount,
    auctionPlatformId: platformIdSuggestPrice,
    auctionPlatformUserId: platformUserId,
  },

  failOnStatusCode: false,
}).then((res) => {
  //Assertion for one by one
  expect(res.status).to.eq(200);
  expect(res.body.suggestedPrices[0].auctionPlatformVehicleId).to.be.equal(
    vehicleIdSuggestedPrice
  );
  expect(res.body.suggestedPrices[0].status).contains("pending");
  expect(res.body.suggestedPrices[0].amount).to.be.within(minval, maxval);
  expect(res.body.suggestedPrices[0].auctionPlatformId).contains(
    platformIdSuggestPrice
  );
  // Assertion in one time
  for (const index of res.body.suggestedPrices) {
    expect(res.body.suggestedPrices[index].amount).to.be.within(
      minval,
      maxval
    );
  }
  assert
    .isNotNull(res.amount, "is not null")
    .and.isNotNull(res.body.id, "is not null")
    .and.isNotNull(res.body.createdAt, "is not null");
});

}); `

Can you please advise the reason for this failure? I added my code. So, as seen from sc all assertions are passing but gives an error of: Undefined is not iterable (cannot read property Symbol(Symbol.iterator))

thankenter image description here you!

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda