/** * Returns a new driver instance according to the browser configuration. * * @param BrowserConfiguration $browser The browser configuration. * * @return DriverInterface */ public function createDriver(BrowserConfiguration $browser) { if (!class_exists('Behat\\Mink\\Driver\\ZombieDriver')) { throw new \RuntimeException('Install MinkZombieDriver in order to use zombie driver.'); } $driver_options = $browser->getDriverOptions(); return new \Behat\Mink\Driver\ZombieDriver(new \Behat\Mink\Driver\NodeJS\Server\ZombieServer($browser->getHost(), $browser->getPort(), $driver_options['node_bin'], $driver_options['server_path'], $driver_options['threshold'], $driver_options['node_modules_path'])); }
/** * Returns a new driver instance according to the browser configuration. * * @param BrowserConfiguration $browser The browser configuration. * * @return DriverInterface */ public function createDriver(BrowserConfiguration $browser) { if (!class_exists('Behat\\Mink\\Driver\\SahiDriver')) { throw new \RuntimeException('Install MinkSahiDriver in order to use sahi driver.'); } $driver_options = $browser->getDriverOptions(); $connection = new \Behat\SahiClient\Connection($driver_options['sid'], $browser->getHost(), $browser->getPort(), $driver_options['browser'], $driver_options['limit']); return new \Behat\Mink\Driver\SahiDriver($browser->getBrowserName(), new \Behat\SahiClient\Client($connection)); }
/** * Creates driver based on browser configuration. * * @param BrowserConfiguration $browser Browser configuration. * * @return DriverInterface */ private function _createDriver(BrowserConfiguration $browser) { $browser_name = $browser->getBrowserName(); $capabilities = $browser->getDesiredCapabilities(); $capabilities['browserName'] = $browser_name; // TODO: maybe doesn't work! ini_set('default_socket_timeout', $browser->getTimeout()); $driver = new Selenium2Driver($browser_name, $capabilities, 'http://' . $browser->getHost() . ':' . $browser->getPort() . '/wd/hub'); return $driver; }
/** * Returns a new driver instance according to the browser configuration. * * @param BrowserConfiguration $browser The browser configuration. * * @return DriverInterface */ public function createDriver(BrowserConfiguration $browser) { if (!class_exists('Behat\\Mink\\Driver\\Selenium2Driver')) { throw new \RuntimeException('Install MinkSelenium2Driver in order to use selenium2 driver.'); } $browser_name = $browser->getBrowserName(); $capabilities = $browser->getDesiredCapabilities(); $capabilities['browserName'] = $browser_name; // TODO: Maybe doesn't work! ini_set('default_socket_timeout', $browser->getTimeout()); $driver = new \Behat\Mink\Driver\Selenium2Driver($browser_name, $capabilities, 'http://' . $browser->getHost() . ':' . $browser->getPort() . '/wd/hub'); return $driver; }
/** * Test description. * * @return void */ public function testSetHostCorrect() { $expected = 'EXAMPLE_HOST'; $this->assertSame($this->browser, $this->browser->setHost($expected)); $this->assertSame($expected, $this->browser->getHost()); }