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

118
Views
¿Cómo manejar los errores de ciprés?

Digamos que tengo una prueba simple:

 /// <reference types="cypress" /> describe('Something important', () => { it('First test', () => { ... }) })

Y lo que debo hacer es manejar si algo sucede en First test , estaba intentando algo como, pero no funciona de esta manera:

 it('First test', () => { try { ... } catch (e) { ... // send email, for example } })

Entonces, de alguna manera necesito manejar lo que suceda en la prueba. ¿Es posible? Algo como esto, pero para toda la prueba:

 cy.get('button').contains('hello') .catch((err) => { // oh no the button wasn't found // (or something else failed) cy.get('somethingElse').click() })
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

¿Es esto lo que necesita ?

 Cypress.on('fail', (error, runnable) => { debugger // we now have access to the err instance // and the mocha runnable this failed on throw error // throw error to have test still fail })

Esto se activará cuando la prueba falle, para que pueda realizar su correo electrónico u otra acción.

Pero, en general, Cypress espera que sepa que el botón estará allí. No debería tener demasiadas cosas impredecibles en la página (o no en la página, según sea el caso).

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!