Laravel Dusk Javascript 确认()

Laravel Dusk Javascript Confirm()

在我的表单中,为了提交,我需要在 Javascript 确认()弹出窗口中按下确定按钮。我如何在 Laravel Dusk 中确认,以便我可以自动提交用于测试目的的表单?

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

祝你好运