3

In my form, in order to submit, I need to press the OK button in a Javascript confirm() popup. How can I confirm in Laravel Dusk so that I can automate the submission of the form for testing purposes?

Image of the Confirm

1

1 Answer 1

5
$browser->dismissDialog(); # = press Cancel (if confirmation)
$browser->acceptDialog(); # = press OK
$browser->assertDialogOpened('Text in dialog'); # = check dialog exist with text specified.

Good luck

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.