Skip to content

Commit 6668237

Browse files
committed
Cache session capabilities
1 parent f2a06be commit 6668237

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

lib/WebDriver/Session.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@
6262
*/
6363
final class Session extends Container
6464
{
65+
/**
66+
* @var array
67+
*/
68+
private $capabilities = null;
69+
6570
/**
6671
* {@inheritdoc}
6772
*/
@@ -136,9 +141,13 @@ public function open($url)
136141
*/
137142
public function capabilities()
138143
{
139-
$result = $this->curl('GET', '');
144+
if ( ! isset($this->capabilities)) {
145+
$result = $this->curl('GET', '');
140146

141-
return $result['value'];
147+
$this->capabilities = $result['value'];
148+
}
149+
150+
return $this->capabilities;
142151
}
143152

144153
/**

0 commit comments

Comments
 (0)