You are here

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

#varbase: To move the mouse over an element.

Example: When I move the mouse over "header#navbar #main_menu ul.nav li a"

@When /^I move the mouse over the "([^"]*)"$/

File

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

Class

VarbaseContext
Defines application features from the specific context.

Code

public function iMouseOver($selector) {
  $elem = $this
    ->getSession()
    ->getPage()
    ->find('css', $selector);
  if ($elem) {
    $elem
      ->mouseOver();
  }
  else {
    throw new Exception("No element matching \"{$selector}\" is found.");
  }
}