You are here

public function VarbaseContext::acceptAlert in Varbase: The Ultimate Drupal CMS Starter Kit (Bootstrap Ready) 8.8

Same name and namespace in other branches
  1. 8.4 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::acceptAlert()
  2. 8.5 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::acceptAlert()
  3. 8.6 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::acceptAlert()
  4. 8.7 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::acceptAlert()
  5. 9.0.x tests/features/bootstrap/VarbaseContext.php \VarbaseContext::acceptAlert()

Accept alert if present.

Varbase Context #varbase.

Example #1: When I accept alert Example #2: And accept alert.

@when /^(?:|I )accept alert$/

File

tests/features/bootstrap/VarbaseContext.php, line 1184

Class

VarbaseContext
Defines application features from the specific context.

Code

public function acceptAlert() {
  try {
    $this
      ->getSession()
      ->getDriver()
      ->getWebDriverSession()
      ->accept_alert();
  } catch (Exception $e) {

    // no-op, alert might not be present.
  }
}