/** * Accept an alert. * * @return static */ public function acceptAlert() { try { $this->session->accept_alert(); } catch (\WebDriver\Exception\NoAlertOpenError $e) { throw new PHPUnitException("Well, tried to accept the alert, but there wasn't one. Dangit."); } return $this; }
/** * Accept alert or confirm popup * * Example: * ``` php * <?php * $I->click('Show alert popup'); * $I->acceptPopup(); * * ``` */ public function acceptPopup() { $this->webDriverSession->accept_alert(); }