You are here

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

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

#varbase: To print the text of the current alert message.

Example 1: When I print alert text Example 2: And print alert text

@When /^(?:|I ) print alert text$/

File

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

Class

VarbaseContext
Defines application features from the specific context.

Code

public function iPrintAlertText() {
  try {
    return $this
      ->getSession()
      ->getDriver()
      ->getWebDriverSession()
      ->getAlert_text();
  } catch (\WebDriver\Exception $e) {

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