Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
added facebook/php-webdriver to composer.json
Browse files Browse the repository at this point in the history
  • Loading branch information
everzet committed Dec 21, 2011
1 parent d71acd1 commit 1f31834
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 3 deletions.
29 changes: 28 additions & 1 deletion composer.json
Expand Up @@ -26,7 +26,8 @@
"recommend": {
"fabpot/goutte": "*",
"behat/sahi-client": ">=1.0.1",
"alexandresalome/php-selenium": "*"
"alexandresalome/php-selenium": "*",
"facebook/php-webdriver": "*"
},

"autoload": {
Expand Down Expand Up @@ -88,6 +89,32 @@
}
}
},
"facebook/php-webdriver": {
"package": {
"name": "facebook/php-webdriver",
"version": "master-dev",
"dist": {
"url": "https://github.com/facebook/php-webdriver/zipball/master",
"type": "zip"
},
"source": {
"url": "git://github.com/facebook/php-webdriver.git",
"type": "git",
"reference": "master"
},
"autoload": {
"psr-0": {
"WebDriverBase": ".",
"WebDriver": ".",
"WebDriverContainer": ".",
"WebDriverSession": ".",
"WebDriverElement": ".",
"WebDriverEnvironment": ".",
"WebDriverSimpleItem": "."
}
}
}
},
"zendframework/zend-registry": {
"package": {
"name": "zendframework/zend-registry",
Expand Down
14 changes: 12 additions & 2 deletions src/Behat/Mink/Driver/Selenium2Driver.php
Expand Up @@ -10,7 +10,7 @@
use Selenium\Client as SeleniumClient,
Selenium\Locator as SeleniumLocator,
Selenium\Exception as SeleniumException,
\WebDriver as WebDriver;
WebDriver as WebDriver;

/*
* This file is part of the Behat\Mink.
Expand Down Expand Up @@ -42,7 +42,7 @@ class Selenium2Driver implements DriverInterface
/**
* The WebDriver instance
* @var WebDriver
*/
*/
private $webDriver;

/**
Expand All @@ -54,6 +54,16 @@ class Selenium2Driver implements DriverInterface
*/
public function __construct($browserName = 'firefox', $desiredCapabilities = null, $wdHost = 'http://localhost:4444/wd/hub')
{
// load WD exceptions if not loaded
if (!class_exists('IndexOutOfBoundsWebDriverError')) {
$wdReflection = new \ReflectionClass('WebDriver');
$libPath = dirname($wdReflection->getFilename());

if (file_exists($path = $libPath.'/WebDriverExceptions.php')) {
require_once($path);
}
}

$this->setBrowserName($browserName);
$this->setDesiredCapabilities($desiredCapabilities);
$this->setWebDriver( new WebDriver($wdHost) );
Expand Down

0 comments on commit 1f31834

Please sign in to comment.