You are here

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

Same name and namespace in other branches
  1. 8.4 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()

Right click on an element.

Varbase Context #varbase.

Example #1: When I right click "#right-click-to-configure a" Example #2: And I right click "Right click action box"

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

File

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

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.");
  }
}