updated-packages
This commit is contained in:
16
vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverButtonReleaseAction.php
vendored
Normal file
16
vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverButtonReleaseAction.php
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Facebook\WebDriver\Interactions\Internal;
|
||||
|
||||
use Facebook\WebDriver\WebDriverAction;
|
||||
|
||||
/**
|
||||
* Move to the location and then release the mouse key.
|
||||
*/
|
||||
class WebDriverButtonReleaseAction extends WebDriverMouseAction implements WebDriverAction
|
||||
{
|
||||
public function perform()
|
||||
{
|
||||
$this->mouse->mouseUp($this->getActionLocation());
|
||||
}
|
||||
}
|
13
vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverClickAction.php
vendored
Normal file
13
vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverClickAction.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Facebook\WebDriver\Interactions\Internal;
|
||||
|
||||
use Facebook\WebDriver\WebDriverAction;
|
||||
|
||||
class WebDriverClickAction extends WebDriverMouseAction implements WebDriverAction
|
||||
{
|
||||
public function perform()
|
||||
{
|
||||
$this->mouse->click($this->getActionLocation());
|
||||
}
|
||||
}
|
16
vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverClickAndHoldAction.php
vendored
Normal file
16
vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverClickAndHoldAction.php
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Facebook\WebDriver\Interactions\Internal;
|
||||
|
||||
use Facebook\WebDriver\WebDriverAction;
|
||||
|
||||
/**
|
||||
* Move the the location, click and hold.
|
||||
*/
|
||||
class WebDriverClickAndHoldAction extends WebDriverMouseAction implements WebDriverAction
|
||||
{
|
||||
public function perform()
|
||||
{
|
||||
$this->mouse->mouseDown($this->getActionLocation());
|
||||
}
|
||||
}
|
16
vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverContextClickAction.php
vendored
Normal file
16
vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverContextClickAction.php
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Facebook\WebDriver\Interactions\Internal;
|
||||
|
||||
use Facebook\WebDriver\WebDriverAction;
|
||||
|
||||
/**
|
||||
* You can call it 'Right Click' if you like.
|
||||
*/
|
||||
class WebDriverContextClickAction extends WebDriverMouseAction implements WebDriverAction
|
||||
{
|
||||
public function perform()
|
||||
{
|
||||
$this->mouse->contextClick($this->getActionLocation());
|
||||
}
|
||||
}
|
78
vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverCoordinates.php
vendored
Normal file
78
vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverCoordinates.php
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
|
||||
namespace Facebook\WebDriver\Interactions\Internal;
|
||||
|
||||
use Facebook\WebDriver\Exception\UnsupportedOperationException;
|
||||
use Facebook\WebDriver\WebDriverPoint;
|
||||
|
||||
/**
|
||||
* Interface representing basic mouse operations.
|
||||
*/
|
||||
class WebDriverCoordinates
|
||||
{
|
||||
/**
|
||||
* @var null
|
||||
*/
|
||||
private $onScreen;
|
||||
/**
|
||||
* @var callable
|
||||
*/
|
||||
private $inViewPort;
|
||||
/**
|
||||
* @var callable
|
||||
*/
|
||||
private $onPage;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $auxiliary;
|
||||
|
||||
/**
|
||||
* @param null $on_screen
|
||||
* @param callable $in_view_port
|
||||
* @param callable $on_page
|
||||
* @param string $auxiliary
|
||||
*/
|
||||
public function __construct($on_screen, callable $in_view_port, callable $on_page, $auxiliary)
|
||||
{
|
||||
$this->onScreen = $on_screen;
|
||||
$this->inViewPort = $in_view_port;
|
||||
$this->onPage = $on_page;
|
||||
$this->auxiliary = $auxiliary;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws UnsupportedOperationException
|
||||
* @return WebDriverPoint
|
||||
*/
|
||||
public function onScreen()
|
||||
{
|
||||
throw new UnsupportedOperationException(
|
||||
'onScreen is planned but not yet supported by Selenium'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return WebDriverPoint
|
||||
*/
|
||||
public function inViewPort()
|
||||
{
|
||||
return call_user_func($this->inViewPort);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return WebDriverPoint
|
||||
*/
|
||||
public function onPage()
|
||||
{
|
||||
return call_user_func($this->onPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string The attached object id.
|
||||
*/
|
||||
public function getAuxiliary()
|
||||
{
|
||||
return $this->auxiliary;
|
||||
}
|
||||
}
|
13
vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverDoubleClickAction.php
vendored
Normal file
13
vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverDoubleClickAction.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Facebook\WebDriver\Interactions\Internal;
|
||||
|
||||
use Facebook\WebDriver\WebDriverAction;
|
||||
|
||||
class WebDriverDoubleClickAction extends WebDriverMouseAction implements WebDriverAction
|
||||
{
|
||||
public function perform()
|
||||
{
|
||||
$this->mouse->doubleClick($this->getActionLocation());
|
||||
}
|
||||
}
|
12
vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverKeyDownAction.php
vendored
Normal file
12
vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverKeyDownAction.php
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Facebook\WebDriver\Interactions\Internal;
|
||||
|
||||
class WebDriverKeyDownAction extends WebDriverSingleKeyAction
|
||||
{
|
||||
public function perform()
|
||||
{
|
||||
$this->focusOnElement();
|
||||
$this->keyboard->pressKey($this->key);
|
||||
}
|
||||
}
|
12
vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverKeyUpAction.php
vendored
Normal file
12
vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverKeyUpAction.php
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Facebook\WebDriver\Interactions\Internal;
|
||||
|
||||
class WebDriverKeyUpAction extends WebDriverSingleKeyAction
|
||||
{
|
||||
public function perform()
|
||||
{
|
||||
$this->focusOnElement();
|
||||
$this->keyboard->releaseKey($this->key);
|
||||
}
|
||||
}
|
48
vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverKeysRelatedAction.php
vendored
Normal file
48
vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverKeysRelatedAction.php
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace Facebook\WebDriver\Interactions\Internal;
|
||||
|
||||
use Facebook\WebDriver\Internal\WebDriverLocatable;
|
||||
use Facebook\WebDriver\WebDriverKeyboard;
|
||||
use Facebook\WebDriver\WebDriverMouse;
|
||||
|
||||
/**
|
||||
* Base class for all keyboard-related actions.
|
||||
*/
|
||||
abstract class WebDriverKeysRelatedAction
|
||||
{
|
||||
/**
|
||||
* @var WebDriverKeyboard
|
||||
*/
|
||||
protected $keyboard;
|
||||
/**
|
||||
* @var WebDriverMouse
|
||||
*/
|
||||
protected $mouse;
|
||||
/**
|
||||
* @var WebDriverLocatable|null
|
||||
*/
|
||||
protected $locationProvider;
|
||||
|
||||
/**
|
||||
* @param WebDriverKeyboard $keyboard
|
||||
* @param WebDriverMouse $mouse
|
||||
* @param WebDriverLocatable $location_provider
|
||||
*/
|
||||
public function __construct(
|
||||
WebDriverKeyboard $keyboard,
|
||||
WebDriverMouse $mouse,
|
||||
WebDriverLocatable $location_provider = null
|
||||
) {
|
||||
$this->keyboard = $keyboard;
|
||||
$this->mouse = $mouse;
|
||||
$this->locationProvider = $location_provider;
|
||||
}
|
||||
|
||||
protected function focusOnElement()
|
||||
{
|
||||
if ($this->locationProvider) {
|
||||
$this->mouse->click($this->locationProvider->getCoordinates());
|
||||
}
|
||||
}
|
||||
}
|
48
vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverMouseAction.php
vendored
Normal file
48
vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverMouseAction.php
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace Facebook\WebDriver\Interactions\Internal;
|
||||
|
||||
use Facebook\WebDriver\Internal\WebDriverLocatable;
|
||||
use Facebook\WebDriver\WebDriverMouse;
|
||||
|
||||
/**
|
||||
* Base class for all mouse-related actions.
|
||||
*/
|
||||
class WebDriverMouseAction
|
||||
{
|
||||
/**
|
||||
* @var WebDriverMouse
|
||||
*/
|
||||
protected $mouse;
|
||||
/**
|
||||
* @var WebDriverLocatable
|
||||
*/
|
||||
protected $locationProvider;
|
||||
|
||||
/**
|
||||
* @param WebDriverMouse $mouse
|
||||
* @param WebDriverLocatable|null $location_provider
|
||||
*/
|
||||
public function __construct(WebDriverMouse $mouse, WebDriverLocatable $location_provider = null)
|
||||
{
|
||||
$this->mouse = $mouse;
|
||||
$this->locationProvider = $location_provider;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null|WebDriverCoordinates
|
||||
*/
|
||||
protected function getActionLocation()
|
||||
{
|
||||
if ($this->locationProvider !== null) {
|
||||
return $this->locationProvider->getCoordinates();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
protected function moveToLocation()
|
||||
{
|
||||
$this->mouse->mouseMove($this->locationProvider);
|
||||
}
|
||||
}
|
13
vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverMouseMoveAction.php
vendored
Normal file
13
vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverMouseMoveAction.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Facebook\WebDriver\Interactions\Internal;
|
||||
|
||||
use Facebook\WebDriver\WebDriverAction;
|
||||
|
||||
class WebDriverMouseMoveAction extends WebDriverMouseAction implements WebDriverAction
|
||||
{
|
||||
public function perform()
|
||||
{
|
||||
$this->mouse->mouseMove($this->getActionLocation());
|
||||
}
|
||||
}
|
45
vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverMoveToOffsetAction.php
vendored
Normal file
45
vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverMoveToOffsetAction.php
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace Facebook\WebDriver\Interactions\Internal;
|
||||
|
||||
use Facebook\WebDriver\Internal\WebDriverLocatable;
|
||||
use Facebook\WebDriver\WebDriverAction;
|
||||
use Facebook\WebDriver\WebDriverMouse;
|
||||
|
||||
class WebDriverMoveToOffsetAction extends WebDriverMouseAction implements WebDriverAction
|
||||
{
|
||||
/**
|
||||
* @var int|null
|
||||
*/
|
||||
private $xOffset;
|
||||
/**
|
||||
* @var int|null
|
||||
*/
|
||||
private $yOffset;
|
||||
|
||||
/**
|
||||
* @param WebDriverMouse $mouse
|
||||
* @param WebDriverLocatable|null $location_provider
|
||||
* @param int|null $x_offset
|
||||
* @param int|null $y_offset
|
||||
*/
|
||||
public function __construct(
|
||||
WebDriverMouse $mouse,
|
||||
WebDriverLocatable $location_provider = null,
|
||||
$x_offset = null,
|
||||
$y_offset = null
|
||||
) {
|
||||
parent::__construct($mouse, $location_provider);
|
||||
$this->xOffset = $x_offset;
|
||||
$this->yOffset = $y_offset;
|
||||
}
|
||||
|
||||
public function perform()
|
||||
{
|
||||
$this->mouse->mouseMove(
|
||||
$this->getActionLocation(),
|
||||
$this->xOffset,
|
||||
$this->yOffset
|
||||
);
|
||||
}
|
||||
}
|
38
vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverSendKeysAction.php
vendored
Normal file
38
vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverSendKeysAction.php
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace Facebook\WebDriver\Interactions\Internal;
|
||||
|
||||
use Facebook\WebDriver\Internal\WebDriverLocatable;
|
||||
use Facebook\WebDriver\WebDriverAction;
|
||||
use Facebook\WebDriver\WebDriverKeyboard;
|
||||
use Facebook\WebDriver\WebDriverMouse;
|
||||
|
||||
class WebDriverSendKeysAction extends WebDriverKeysRelatedAction implements WebDriverAction
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $keys = '';
|
||||
|
||||
/**
|
||||
* @param WebDriverKeyboard $keyboard
|
||||
* @param WebDriverMouse $mouse
|
||||
* @param WebDriverLocatable $location_provider
|
||||
* @param string $keys
|
||||
*/
|
||||
public function __construct(
|
||||
WebDriverKeyboard $keyboard,
|
||||
WebDriverMouse $mouse,
|
||||
WebDriverLocatable $location_provider = null,
|
||||
$keys = ''
|
||||
) {
|
||||
parent::__construct($keyboard, $mouse, $location_provider);
|
||||
$this->keys = $keys;
|
||||
}
|
||||
|
||||
public function perform()
|
||||
{
|
||||
$this->focusOnElement();
|
||||
$this->keyboard->sendKeys($this->keys);
|
||||
}
|
||||
}
|
53
vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverSingleKeyAction.php
vendored
Normal file
53
vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverSingleKeyAction.php
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace Facebook\WebDriver\Interactions\Internal;
|
||||
|
||||
use Facebook\WebDriver\Internal\WebDriverLocatable;
|
||||
use Facebook\WebDriver\WebDriverAction;
|
||||
use Facebook\WebDriver\WebDriverKeyboard;
|
||||
use Facebook\WebDriver\WebDriverKeys;
|
||||
use Facebook\WebDriver\WebDriverMouse;
|
||||
|
||||
abstract class WebDriverSingleKeyAction extends WebDriverKeysRelatedAction implements WebDriverAction
|
||||
{
|
||||
const MODIFIER_KEYS = [
|
||||
WebDriverKeys::SHIFT,
|
||||
WebDriverKeys::LEFT_SHIFT,
|
||||
WebDriverKeys::RIGHT_SHIFT,
|
||||
WebDriverKeys::CONTROL,
|
||||
WebDriverKeys::LEFT_CONTROL,
|
||||
WebDriverKeys::RIGHT_CONTROL,
|
||||
WebDriverKeys::ALT,
|
||||
WebDriverKeys::LEFT_ALT,
|
||||
WebDriverKeys::RIGHT_ALT,
|
||||
WebDriverKeys::META,
|
||||
WebDriverKeys::RIGHT_META,
|
||||
WebDriverKeys::COMMAND,
|
||||
];
|
||||
|
||||
/** @var string */
|
||||
protected $key;
|
||||
|
||||
/**
|
||||
* @param string $key
|
||||
* @todo Remove default $key value in next major version (BC)
|
||||
*/
|
||||
public function __construct(
|
||||
WebDriverKeyboard $keyboard,
|
||||
WebDriverMouse $mouse,
|
||||
WebDriverLocatable $location_provider = null,
|
||||
$key = ''
|
||||
) {
|
||||
parent::__construct($keyboard, $mouse, $location_provider);
|
||||
|
||||
if (!in_array($key, self::MODIFIER_KEYS, true)) {
|
||||
throw new \InvalidArgumentException(
|
||||
sprintf(
|
||||
'keyDown / keyUp actions can only be used for modifier keys, but "%s" was given',
|
||||
$key
|
||||
)
|
||||
);
|
||||
}
|
||||
$this->key = $key;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user