Marko Ristic
Marko Ristic

Reputation: 101

Cypress confirmation dialog

I am writing a test case for part of my app which covers application restart. During the application restart window confirmation dialog appears which has to be accepted in order to restart the app. And now I have a problem simulating this in Cypress, so my question is:

How to perform OK button action in the window confirmation dialog in Cypress test?

Thank you in advance!

Upvotes: 9

Views: 12625

Answers (1)

Sree.Bh
Sree.Bh

Reputation: 1789

Use:

cy.on('window:confirm', () => true);

Refer: App Events

Upvotes: 19

Related Questions