Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

114
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda