diff --git a/src/VisualCeption.php b/src/VisualCeption.php index a23d070..9a6ff11 100755 --- a/src/VisualCeption.php +++ b/src/VisualCeption.php @@ -24,6 +24,7 @@ class VisualCeption extends \Codeception\Module { private $maximumDeviation = 0; + private $webDriverClass = 'WebDriver'; /** * @var \RemoteWebDriver @@ -35,29 +36,20 @@ class VisualCeption extends \Codeception\Module */ private $storageStrategy; - /** - * Create an object from VisualCeption Class - * - * @param array $config - * @return result - */ - public function __construct($config) - { - $result = parent::__construct($config); - $this->init(); - return $result; - } - /** * Initialize the module and read the config. * * @throws \RuntimeException */ - private function init() + private function _initialize() { if (array_key_exists('maximumDeviation', $this->config)) { $this->maximumDeviation = $this->config["maximumDeviation"]; } + + if (array_key_exists('webdriver', $this->config)) { + $this->webDriverClass = $this->config["webdriver"]; + } $this->storageStrategy = Factory::getStorage($this->config); } @@ -70,10 +62,10 @@ private function init() */ public function _before(\Codeception\TestCase $test) { - if (!$this->hasModule("WebDriver")) { - throw new \Exception("VisualCeption uses the WebDriver. Please be sure that this module is activated."); + if (!$this->hasModule($this->webDriverClass)) { + throw new \Exception("VisualCeption uses the " . $this->webDriverClass . ". Please be sure that this module is activated."); } - $this->webDriver = $this->getModule("WebDriver")->webDriver; + $this->webDriver = $this->getModule($this->webDriverClass)->webDriver; } /** diff --git a/src/VisualCeption/Html/Manipulation.php b/src/VisualCeption/Html/Manipulation.php index 5cd733e..f432ae4 100755 --- a/src/VisualCeption/Html/Manipulation.php +++ b/src/VisualCeption/Html/Manipulation.php @@ -6,7 +6,7 @@ class Manipulation { private $webDriver; - public function __construct(\RemoteWebDriver $webDriver) + public function __construct(\Facebook\WebDriver\Remote\RemoteWebDriver $webDriver) { $this->webDriver = $webDriver; $this->injectJQuery(); diff --git a/src/VisualCeption/Html/Screenshot.php b/src/VisualCeption/Html/Screenshot.php index 05df496..d62b3fe 100755 --- a/src/VisualCeption/Html/Screenshot.php +++ b/src/VisualCeption/Html/Screenshot.php @@ -6,7 +6,7 @@ class Screenshot { private $webDriver; - public function __construct(\RemoteWebDriver $webDriver) + public function __construct(\Facebook\WebDriver\Remote\RemoteWebDriver $webDriver) { $this->webDriver = $webDriver; }