You are here

trait MouseTrait in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/jcalderonzumba/mink-phantomjs-driver/src/MouseTrait.php \Zumba\Mink\Driver\MouseTrait

Class MouseTrait @package Zumba\Mink\Driver

Hierarchy

File

vendor/jcalderonzumba/mink-phantomjs-driver/src/MouseTrait.php, line 11

Namespace

Zumba\Mink\Driver
View source
trait MouseTrait {

  /**
   * Generates a mouseover event on the given element by xpath
   * @param string $xpath
   * @throws DriverException
   */
  public function mouseOver($xpath) {
    $element = $this
      ->findElement($xpath, 1);
    $this->browser
      ->hover($element["page_id"], $element["ids"][0]);
  }

  /**
   * Clicks if possible on an element given by xpath
   * @param string $xpath
   * @return mixed
   * @throws DriverException
   */
  public function click($xpath) {
    $elements = $this
      ->findElement($xpath, 1);
    $this->browser
      ->click($elements["page_id"], $elements["ids"][0]);
  }

  /**
   * {@inheritdoc}
   */

  /**
   * Double click on element found via xpath
   * @param string $xpath
   * @throws DriverException
   */
  public function doubleClick($xpath) {
    $elements = $this
      ->findElement($xpath, 1);
    $this->browser
      ->doubleClick($elements["page_id"], $elements["ids"][0]);
  }

  /**
   * Right click on element found via xpath
   * @param string $xpath
   * @throws DriverException
   */
  public function rightClick($xpath) {
    $elements = $this
      ->findElement($xpath, 1);
    $this->browser
      ->rightClick($elements["page_id"], $elements["ids"][0]);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
MouseTrait::click public function Clicks if possible on an element given by xpath
MouseTrait::doubleClick public function Double click on element found via xpath
MouseTrait::mouseOver public function Generates a mouseover event on the given element by xpath
MouseTrait::rightClick public function Right click on element found via xpath