Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

108
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda