You are here

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

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.5 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iPrintAlertText()
  4. 8.6 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iPrintAlertText()
  5. 8.7 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iPrintAlertText()

Print the text of the current alert message.

Varbase Context #varbase.

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 1230

Class

VarbaseContext
Defines application features from the specific context.

Code

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

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