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

102
Views
Verifique el número de veces que se llamó a window.close - ciprés

He creado stub para window.close para cypress. Quiero saber la cantidad de veces que se ha llamado.

 cy.window().then(win => { cy.stub(win, 'close').as('parentWindowCalled'); });

Quiero verificar si window.close nunca se llama. Cómo puedo hacer eso ?

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

0

Necesitarías el objeto stub

 let stub cy.window().then(win => { stub = cy.stub(win, 'close').as('parentWindowCalled'); }) // actions cy.wait('@parentWindowCalled') cy.wait('@parentWindowCalled') cy.wait('@parentWindowCalled') cy.then(() => expect(stub).to.have.been.called.exactly(3))

to.have.been.called es simplemente extraer el recuento de llamadas del espía, por lo que puede encadenar otros criterios como .have.been.called.at.least(3) .

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!