echo 'error reporting: E_ALL' . chr(10); } error_reporting(E_ALL); // Ensure a clean destination for results exists. exec('rm -rf "' . $results_directory . '"'); mkdir($results_directory); exec('cp -R "' . __DIR__ . '/fancybox" "' . $results_directory . '"'); // Set path to stuff in the HTML report if ($copytests) { $reltestpath = ''; } else { // Find a best guess relative path between results directory and tests directory to use for linking from result.html to tests $reltestpath = find_relative_path($results_directory, $tests_directory); } // Start job-wide services. $selenium_is_running = selenium_is_running($selenium_host, $selenium_port); $xvfb = NULL; $selenium = NULL; if ($selenium_is_running) { if ($output_startup_services) { echo 'Selenium is already running. Using the existing service.' . PHP_EOL; } $selenium = new SeleniumExternalService($selenium_host, $selenium_port); } else { if ($output_startup_services) { echo 'Selenium is not running. Starting a new, local service.' . PHP_EOL; } if (!$onscreen) { // Use the Selenium port for the X display number, too. $x_display_number = $selenium_port; $xvfb = new XvfbBackgroundService($x_display_number, $results_directory . '/xvfb.log', $res_width, $res_height);
protected function isReady() { return selenium_is_running($this->getHost(), $this->getPort()); }