public function __construct(WebDriver $driver, $source, $x_offset, $y_offset)
 {
     parent::__construct($driver);
     $this->action->addAction(new WebDriverClickAndHoldAction($this->mouse, $source));
     $this->action->addAction(new WaitAction(1));
     $this->action->addAction(new WebDriverMoveToOffsetAction($this->mouse, null, $x_offset, $y_offset));
     $this->action->addAction(new WaitAction(1));
     $this->action->addAction(new WebDriverButtonReleaseAction($this->mouse, null));
     $this->action->addAction(new WaitAction(1));
 }
示例#2
0
 /**
  * Performs a simple mouse drag-and-drop operation.
  *
  * ``` php
  * <?php
  * $I->dragAndDrop('#drag', '#drop');
  * ?>
  * ```
  *
  * @param string $source (CSS ID or XPath)
  * @param string $target (CSS ID or XPath)
  */
 public function dragAndDrop($source, $target)
 {
     $snodes = $this->matchFirstOrFail($this->webDriver, $source);
     $tnodes = $this->matchFirstOrFail($this->webDriver, $target);
     $action = new WebDriverActions($this->webDriver);
     $action->dragAndDrop($snodes, $tnodes)->perform();
 }
示例#3
0
 public function __construct(WebDriver $driver)
 {
     parent::__construct($driver);
     $this->touchScreen = $driver->getTouch();
 }