/**
  * Initializes new driver connection with specific configuration
  *
  * @param array $connectionConfig Array of configuration data to start driver's connection
  *
  * @return Mage_Selenium_TestConfiguration
  */
 protected function _addDriverConnection(array $connectionConfig)
 {
     $driver = new Mage_Selenium_Driver();
     $driver->setBrowser($connectionConfig['browser']);
     $driver->setHost($connectionConfig['host']);
     $driver->setPort($connectionConfig['port']);
     $driver->setContiguousSession(true);
     $this->_drivers[] = $driver;
     $this->driver = $this->_drivers[0];
     return $this;
 }
Esempio n. 2
0
 /**
  * Initializes new driver connection with specific configuration
  *
  * @param array $browser
  *
  * @return Mage_Selenium_Driver
  * @throws InvalidArgumentException
  */
 public function addDriverConnection(array $browser)
 {
     if (!isset($browser['name'])) {
         $browser['name'] = '';
     }
     if (!isset($browser['browser'])) {
         $browser['browser'] = '';
     }
     if (!isset($browser['host'])) {
         $browser['host'] = 'localhost';
     }
     if (!isset($browser['port'])) {
         $browser['port'] = 4444;
     }
     if (!isset($browser['timeout'])) {
         $browser['timeout'] = 30;
     }
     if (!isset($browser['httpTimeout'])) {
         $browser['httpTimeout'] = 45;
     }
     if (!isset($browser['restartBrowser'])) {
         $browser['restartBrowser'] = true;
     }
     $driver = new Mage_Selenium_Driver();
     $driver->setLogHandle($this->getHelper('config')->getLogDir());
     $driver->setName($browser['name']);
     $driver->setBrowser($browser['browser']);
     $driver->setHost($browser['host']);
     $driver->setPort($browser['port']);
     $driver->setTimeout($browser['timeout']);
     $driver->setHttpTimeout($browser['httpTimeout']);
     $driver->setContiguousSession($browser['restartBrowser']);
     $driver->setBrowserUrl($this->_configHelper->getBaseUrl());
     return $driver;
 }