Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

106
Views
Comprobación condicional de respuesta en Cypress

ingrese la descripción de la imagen aquí Necesito poner una condición que: si el organismo de respuesta no cumple con los criterios, debo

 cy.log(JSON.stringify(res))

Pero no sé cómo hacerlo. ingrese la descripción de la imagen aquí

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Puedes escribir algo como:

 cy.request({ body: {}, failOnStatusCode: false, }).then((res) => { if (res.status == 404) { cy.log(JSON.stringify(res.body)) //prints the response body cy.log(res.body.name) //prints name cy.log(res.body.message) //prints message } else { //Do Something else } })
about 4 years ago · Juan Pablo Isaza Report

0

Puede usar el evento fallido para registrar su respuesta si algún criterio falla.

 cy.request({ ... }) .then(res => { Cypress.once('fail', (error, runnable) => { cy.log(JSON.stringify(res)) throw error // throw error to have test still fail }) expect(... expect(... expect(... })
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!