Failed Conditions
Pull Request — experimental/sf (#3236)
by Kentaro
132:46 queued 125:39
created

DragAndDropBy   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 6

Importance

Changes 0
Metric Value
dl 0
loc 25
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 6
1
<?php
2
3
4
namespace Interactions;
5
6
7
use Facebook\WebDriver\Interactions\Internal\WebDriverButtonReleaseAction;
8
use Facebook\WebDriver\Interactions\Internal\WebDriverClickAndHoldAction;
9
use Facebook\WebDriver\Interactions\Internal\WebDriverMoveToOffsetAction;
10
use Facebook\WebDriver\Interactions\WebDriverActions;
11
use Facebook\WebDriver\WebDriver;
12
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
}