You are here

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

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

#varbase: To right click on an element.

Example: When I move the mouse over "#right-click-to-configure a"

@When /^I right click "([^"]*)"$/

File

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

Class

VarbaseContext
Defines application features from the specific context.

Code

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