Add example for stubbing typing username and password into window.prompt
SofiulAlam opened this issue · comments
SofiulAlam commented
Hi,
I am very new to Cypress and spend half days looking examples on how to send text in prompt.
I have tried below code but getting error.
cy.visit('http://localhost:3000')
cy.window().then((win) => {
cy.stub(win, 'prompt').returns('username', 'password')
})
Requirements:
I need to enter username and password and click the window prompt submit button or close the window without entering username and password . Any ideas please?
Thanking you in advanced.
Kind Regards,
Sofiul