12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <?php
- namespace Facebook\WebDriver;
- use Facebook\WebDriver\Remote\DriverCommand;
- use Facebook\WebDriver\Remote\ExecuteMethod;
- class WebDriverAlert
- {
-
- protected $executor;
- public function __construct(ExecuteMethod $executor)
- {
- $this->executor = $executor;
- }
-
- public function accept()
- {
- $this->executor->execute(DriverCommand::ACCEPT_ALERT);
- return $this;
- }
-
- public function dismiss()
- {
- $this->executor->execute(DriverCommand::DISMISS_ALERT);
- return $this;
- }
-
- public function getText()
- {
- return $this->executor->execute(DriverCommand::GET_ALERT_TEXT);
- }
-
- public function sendKeys($value)
- {
- $this->executor->execute(
- DriverCommand::SET_ALERT_VALUE,
- ['text' => $value]
- );
- return $this;
- }
- }
|