|
2 | 2 |
|
3 | 3 | namespace Behat\Mink\Driver; |
4 | 4 |
|
5 | | -use Behat\Mink\Element\NodeElement; |
6 | 5 | use Behat\Mink\Exception\DriverException; |
7 | | -use Behat\Mink\Session; |
8 | 6 | use WebDriver\Exception\UnknownError; |
9 | 7 | use WebDriver\Key; |
10 | 8 | use WebDriver\WebDriver; |
|
24 | 22 | */ |
25 | 23 | class Selenium2Driver extends CoreDriver |
26 | 24 | { |
27 | | - /** |
28 | | - * The current Mink session |
29 | | - * @var \Behat\Mink\Session |
30 | | - */ |
31 | | - private $session; |
32 | | - |
33 | 25 | /** |
34 | 26 | * Whether the browser has been started |
35 | 27 | * @var Boolean |
@@ -103,7 +95,7 @@ protected function setBrowserName($browserName = 'firefox') |
103 | 95 |
|
104 | 96 | /** |
105 | 97 | * Sets the desired capabilities - called on construction. If null is provided, will set the |
106 | | - * defaults as dsesired. |
| 98 | + * defaults as desired. |
107 | 99 | * |
108 | 100 | * See http://code.google.com/p/selenium/wiki/DesiredCapabilities |
109 | 101 | * |
@@ -262,14 +254,6 @@ protected function executeJsOnXpath($xpath, $script, $sync = true) |
262 | 254 | )); |
263 | 255 | } |
264 | 256 |
|
265 | | - /** |
266 | | - * @see Behat\Mink\Driver\DriverInterface::setSession() |
267 | | - */ |
268 | | - public function setSession(Session $session) |
269 | | - { |
270 | | - $this->session = $session; |
271 | | - } |
272 | | - |
273 | 257 | /** |
274 | 258 | * Starts driver. |
275 | 259 | */ |
@@ -498,19 +482,15 @@ public function getWindowName() |
498 | 482 | } |
499 | 483 |
|
500 | 484 | /** |
501 | | - * Finds elements with specified XPath query. |
502 | | - * |
503 | | - * @param string $xpath |
504 | | - * |
505 | | - * @return array array of Behat\Mink\Element\NodeElement |
| 485 | + * {@inheritdoc} |
506 | 486 | */ |
507 | 487 | public function find($xpath) |
508 | 488 | { |
509 | 489 | $nodes = $this->wdSession->elements('xpath', $xpath); |
510 | 490 |
|
511 | 491 | $elements = array(); |
512 | 492 | foreach ($nodes as $i => $node) { |
513 | | - $elements[] = new NodeElement(sprintf('(%s)[%d]', $xpath, $i+1), $this->session); |
| 493 | + $elements[] = sprintf('(%s)[%d]', $xpath, $i+1); |
514 | 494 | } |
515 | 495 |
|
516 | 496 | return $elements; |
|
0 commit comments