You are here

public function VarbaseContext::iFillInAlert 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::iFillInAlert()
  2. 8.4 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iFillInAlert()
  3. 8.6 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iFillInAlert()
  4. 8.7 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iFillInAlert()
  5. 9.0.x tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iFillInAlert()

#varbase: To fill a text in the alert message.

Example 1: When I fill "See this alert" in alert Example 2: And fill "See this text" in alert

@When /^(?:|I )fill "(?P<text>[^"]*)" in alert$/

File

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

Class

VarbaseContext
Defines application features from the specific context.

Code

public function iFillInAlert($message) {
  try {
    $this
      ->getSession()
      ->getDriver()
      ->getWebDriverSession()
      ->postAlert_text($message);
  } catch (\WebDriver\Exception $e) {

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