Skip to content

Commit b79e278

Browse files
committed
Missing method to get timeouts (W3C)
1 parent 581b1f2 commit b79e278

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

lib/WebDriver/Session.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,19 @@ public function frame()
324324
return new Frame($this->url . '/frame');
325325
}
326326

327+
/**
328+
* Get timeouts (W3C): /session/:sessionId/timeouts (GET)
329+
* - $session->getTimeouts()
330+
*
331+
* @return mixed
332+
*/
333+
public function getTimeouts()
334+
{
335+
$result = $this->curl('GET', '/timeouts');
336+
337+
return $result['value'];
338+
}
339+
327340
/**
328341
* timeouts methods: /session/:sessionId/timeouts (POST)
329342
* - $session->timeouts($json) - set timeout for an operation
@@ -343,7 +356,7 @@ public function timeouts()
343356
}
344357

345358
if (func_num_args() === 2) {
346-
$type = func_get_arg(0); // 'script', 'implicit', or 'page load' (legacy: 'pageLoad')
359+
$type = func_get_arg(0); // 'script', 'implicit', or 'pageLoad' (legacy: 'pageLoad')
347360
$timeout = func_get_arg(1); // timeout in milliseconds
348361

349362
$arg = $this->legacy ? array('type' => $type, 'ms' => $timeout) : array($type => $timeout);

lib/WebDriver/Timeouts.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ final class Timeouts extends AbstractWebDriver
4040
protected function methods()
4141
{
4242
return array(
43+
// Legacy JSON Wire Protocol
4344
'async_script' => array('POST'),
4445
'implicit_wait' => array('POST'),
4546
);

0 commit comments

Comments
 (0)