/** * 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 testSetTimeoutCorrect() { $expected = 1000; $this->assertSame($this->browser, $this->browser->setTimeout($expected)); $this->assertSame($expected, $this->browser->getTimeout()); }