表題のとおり、ブラウザテスト中のアラートに対する操作をしたいです。
具体的には、ログイン後に出てくる下記のアラートです。
〇〇が通知の許可を求めています...受け取る/ブロック
下記のようなアプローチをしましたが、テストはErrorになっております。
どなたかご教示いただけないでしょうか。
public function testAlertAccept() { $this->browse(function (Browser $browser) { $browser->driver->switchTo()->alert()->accept(); $browser->assertPathBeginsWith('/profile'); }); } public function testAlertBlock() { $this->browse(function (Browser $browser) { $browser->dismissDialog() ->assertPathBeginsWith('/profile'); }); }
あなたの回答
tips
プレビュー