protected function execute(InputInterface $input, OutputInterface $output) { /** @var TestSuite $testSuite */ $testSuite = (require $input->getOption('test-suite')); $host = $input->getOption('selenium-host'); $facebookDriver = FacebookRemoteWebDriver::create($host, DesiredCapabilities::chrome()); $remoteDriver = new RemoteWebDriver($facebookDriver, Url::fromString($input->getOption('base-url'))); try { $testSuite->execute($remoteDriver); } catch (\Exception $e) { do { $message = $e->getMessage(); } while ($e = $e->getPrevious()); } $report = $this->formatReport($testSuite); $output->writeln((string) $report); if (isset($message)) { $output->writeln("<error>" . $message . "<error>"); } }
/** * @return Url */ public function getCurrentUrl() { return Url::fromString($this->webDriver->getCurrentURL()); }