Skip to content

Commit 59e158e

Browse files
committed
Updated the driver for the Mink 2.0 API
1 parent 018ec1c commit 59e158e

2 files changed

Lines changed: 4 additions & 24 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
"require": {
2323
"php": ">=5.3.1",
24-
"behat/mink": "~1.5.0@dev",
24+
"behat/mink": "dev-2-architecture-changes",
2525
"instaclick/php-webdriver": "~1.1"
2626
},
2727

src/Behat/Mink/Driver/Selenium2Driver.php

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
namespace Behat\Mink\Driver;
44

5-
use Behat\Mink\Element\NodeElement;
65
use Behat\Mink\Exception\DriverException;
7-
use Behat\Mink\Session;
86
use WebDriver\Exception\UnknownError;
97
use WebDriver\Key;
108
use WebDriver\WebDriver;
@@ -24,12 +22,6 @@
2422
*/
2523
class Selenium2Driver extends CoreDriver
2624
{
27-
/**
28-
* The current Mink session
29-
* @var \Behat\Mink\Session
30-
*/
31-
private $session;
32-
3325
/**
3426
* Whether the browser has been started
3527
* @var Boolean
@@ -103,7 +95,7 @@ protected function setBrowserName($browserName = 'firefox')
10395

10496
/**
10597
* Sets the desired capabilities - called on construction. If null is provided, will set the
106-
* defaults as dsesired.
98+
* defaults as desired.
10799
*
108100
* See http://code.google.com/p/selenium/wiki/DesiredCapabilities
109101
*
@@ -262,14 +254,6 @@ protected function executeJsOnXpath($xpath, $script, $sync = true)
262254
));
263255
}
264256

265-
/**
266-
* @see Behat\Mink\Driver\DriverInterface::setSession()
267-
*/
268-
public function setSession(Session $session)
269-
{
270-
$this->session = $session;
271-
}
272-
273257
/**
274258
* Starts driver.
275259
*/
@@ -498,19 +482,15 @@ public function getWindowName()
498482
}
499483

500484
/**
501-
* Finds elements with specified XPath query.
502-
*
503-
* @param string $xpath
504-
*
505-
* @return array array of Behat\Mink\Element\NodeElement
485+
* {@inheritdoc}
506486
*/
507487
public function find($xpath)
508488
{
509489
$nodes = $this->wdSession->elements('xpath', $xpath);
510490

511491
$elements = array();
512492
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);
514494
}
515495

516496
return $elements;

0 commit comments

Comments
 (0)