public function start()
 {
     if (!$this->getDownloader()->isJarAlreadyDownloaded()) {
         $this->download();
     }
     if (!$this->getStarter()->isSeleniumAvailable()) {
         $this->seleniumStarter->start();
     }
 }
Exemplo n.º 2
0
 public function testStarterStartsWithPortByOptions()
 {
     $jarLocation = __DIR__ . '/../fixtures/selenium-dummy.jar';
     $javaLocation = 'java-location';
     $port = 1234;
     $this->exeFinder->expects($this->any())->method('find')->with('java')->willReturn($javaLocation);
     $this->seleniumOptions->expects($this->any())->method('getSeleniumQuery')->willReturn('not_empty');
     $this->seleniumOptions->expects($this->any())->method('getSeleniumUrl')->willReturn('not_empty');
     $this->seleniumOptions->expects($this->any())->method('getSeleniumJarLocation')->willReturn($jarLocation);
     $this->seleniumOptions->expects($this->any())->method('getSeleniumPort')->willReturn($port);
     $this->process->expects($this->any())->method('setCommandLine')->with($javaLocation . ' -jar ' . $jarLocation . ' -port ' . $port);
     $this->starter->start();
 }