public function testSetDriverOptionsCorrect() { $user_driver_options = array('o1' => 'v1', 'o2' => 'v2'); $expected_driver_options = array('driverParam1' => 'driverParamValue1') + $user_driver_options; $this->assertSame($this->browser, $this->browser->setDriverOptions($user_driver_options)); $this->assertSame($expected_driver_options, $this->browser->getDriverOptions()); }
/** * 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)); }
/** * 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\\GoutteDriver')) { throw new \RuntimeException('Install MinkGoutteDriver in order to use goutte driver.'); } $driver_options = $browser->getDriverOptions(); if ($this->_isGoutte1()) { $guzzle_client = $this->_buildGuzzle3Client($driver_options['guzzle_parameters']); } else { $guzzle_client = $this->_buildGuzzle4Client($driver_options['guzzle_parameters']); } $goutte_client = new \Behat\Mink\Driver\Goutte\Client($driver_options['server_parameters']); $goutte_client->setClient($guzzle_client); return new \Behat\Mink\Driver\GoutteDriver($goutte_client); }