1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- <?php
- namespace Facebook\WebDriver;
- use Facebook\WebDriver\Remote\DriverCommand;
- use Facebook\WebDriver\Remote\ExecuteMethod;
- class WebDriverTimeouts
- {
-
- protected $executor;
- public function __construct(ExecuteMethod $executor)
- {
- $this->executor = $executor;
- }
-
- public function implicitlyWait($seconds)
- {
- $this->executor->execute(
- DriverCommand::IMPLICITLY_WAIT,
- ['ms' => $seconds * 1000]
- );
- return $this;
- }
-
- public function setScriptTimeout($seconds)
- {
- $this->executor->execute(
- DriverCommand::SET_SCRIPT_TIMEOUT,
- ['ms' => $seconds * 1000]
- );
- return $this;
- }
-
- public function pageLoadTimeout($seconds)
- {
- $this->executor->execute(DriverCommand::SET_TIMEOUT, [
- 'type' => 'page load',
- 'ms' => $seconds * 1000,
- ]);
- return $this;
- }
- }
|