123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <?php
- namespace Facebook\WebDriver\Remote;
- use Facebook\WebDriver\WebDriverKeyboard;
- use Facebook\WebDriver\WebDriverKeys;
- class RemoteKeyboard implements WebDriverKeyboard
- {
-
- private $executor;
-
- public function __construct(RemoteExecuteMethod $executor)
- {
- $this->executor = $executor;
- }
-
- public function sendKeys($keys)
- {
- $this->executor->execute(DriverCommand::SEND_KEYS_TO_ACTIVE_ELEMENT, [
- 'value' => WebDriverKeys::encode($keys),
- ]);
- return $this;
- }
-
- public function pressKey($key)
- {
- $this->executor->execute(DriverCommand::SEND_KEYS_TO_ACTIVE_ELEMENT, [
- 'value' => [(string) $key],
- ]);
- return $this;
- }
-
- public function releaseKey($key)
- {
- $this->executor->execute(DriverCommand::SEND_KEYS_TO_ACTIVE_ELEMENT, [
- 'value' => [(string) $key],
- ]);
- return $this;
- }
- }
|