public static function getClient($environment)
{
switch (strtoupper($environment)) {
case HttpFactory::PRODUCTIONMODE:
return new SeleniumAdapter();
break;
default:
throw new \Exception('Invalid environment');
break;
}
}
/** * @param DesiredCapabilities $desiredCapabilities * @param String $host * @param Integer $port */ public function __construct(DesiredCapabilities $desiredCapabilities = null, $host = "http://localhost", $port = 4444) { $this->_hubUrl = "{$host}:{$port}/wd/hub"; isset($desiredCapabilities) ?: ($desiredCapabilities = new DesiredCapabilities("firefox")); $this->_httpClient = HttpFactory::getClient($this->_environment); $this->startSession($desiredCapabilities); }