| 1 | <?php |
||
| 13 | class DragAndDropBy extends WebDriverActions |
||
| 14 | { |
||
| 15 | public function __construct(WebDriver $driver, $source, $x_offset, $y_offset) |
||
| 16 | { |
||
| 17 | parent::__construct($driver); |
||
| 18 | $this->action->addAction( |
||
| 19 | new WebDriverClickAndHoldAction($this->mouse, $source) |
||
| 20 | ); |
||
| 21 | $this->action->addAction( |
||
| 22 | new WaitAction(1) |
||
| 23 | ); |
||
| 24 | $this->action->addAction( |
||
| 25 | new WebDriverMoveToOffsetAction($this->mouse, null, $x_offset, $y_offset) |
||
| 26 | ); |
||
| 27 | $this->action->addAction( |
||
| 28 | new WaitAction(1) |
||
| 29 | ); |
||
| 30 | $this->action->addAction( |
||
| 31 | new WebDriverButtonReleaseAction($this->mouse, null) |
||
| 32 | ); |
||
| 33 | $this->action->addAction( |
||
| 34 | new WaitAction(1) |
||
| 35 | ); |
||
| 36 | } |
||
| 37 | } |