public function boot(Nette\DI\Container $container, $databaseName) { $this->windows = array(); $this->waitForSeleniumSlot(); $this->serviceLocator = $container; TesterHelpers::setup(); // ensure error & exception helpers are registered $this->httpServer = new HttpServer(); $env = (array) $this->options[self::OPTION_ENV_VARIABLES] + array($this->options[self::OPTION_ENV_PREFIX] . '_DEBUG' => '0', $this->options[self::OPTION_ENV_PREFIX] . '_SELENIUM' => '1', $this->options[self::OPTION_ENV_PREFIX] . '_DATABASE' => $databaseName, $this->options[self::OPTION_ENV_PREFIX] . '_LOG_DIR' => TEMP_DIR, $this->options[self::OPTION_ENV_PREFIX] . '_TEMP_DIR' => TEMP_DIR); $this->httpServer->start($this->serviceLocator->expand($this->options[self::OPTION_ROUTER]), $env); $httpRequest = new Nette\Http\Request($this->httpServer->getUrl(), array(), array(), array(), array(), array(), 'GET'); $this->serviceLocator->removeService('httpRequest'); $this->serviceLocator->addService('httpRequest', $httpRequest); $this->sessionFactory = new SessionFactory($this->serviceLocator, $this->httpServer, $this->options); $this->currentSession = $this->sessionFactory->create(); $this->currentSession->setContext($this); $this->windows[] = $this->currentSession; if ($this->options[self::OPTION_VIDEO_ENABLE]) { $this->videoRecorder = new VideoRecorder(TEMP_DIR); $this->videoRecorder->start(); } }
/** * @return \PHPUnit_Extensions_Selenium2TestCase_URL */ public function createBrowserUrl() { return \PHPUnit_Extensions_Selenium2TestCase_URL::fromHostAndPort($this->httpServer->getUrl()->host, $this->httpServer->getUrl()->port); }