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

113
Views
Difference between on('windows.alert()') and on('windows:alert') in cypress?
cy.on('window:alert',(str)=>{
            expect(str).to.equal('Hello , share this practice page and share your knowledge');
        });

This was executing the assertion but,

cy.on('window.alert()',(str)=>{
            expect(str).to.equal('Hello , share this practice page and share your knowledge');
        });

But this was not executing the assertion. I am new to cypress and want to understand why and how these two are different?

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

0

Actually, there is no difference between them. The cy.on() method calls core javascript methods. Even if you do not add the () sign to the end of a function, the constructor method of the same method will be called, unless it takes a parameter inside the function.

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!