@Test public void executeTests() throws IOException { String testBase = server.whereIs("/selenium-server/tests"); Path outputFile = Paths.get(StandardSystemProperty.JAVA_IO_TMPDIR.value()) .resolve("core-test-suite" + browser.replace('*', '-') + ".html"); if (Files.exists(outputFile)) { Files.delete(outputFile); } Files.createDirectories(outputFile.getParent()); String result = new HTMLLauncher() .runHTMLSuite( browser, // We need to do this because the path relativizing code in java.net.URL is // clearly having a bad day. "/selenium-server/tests" appended to "../tests/" // ends up as "/tests" rather than "/selenium-server/tests" as you'd expect. testBase + "/TestSuite.html", testBase + "/TestSuite.html", outputFile.toFile(), TimeUnit.MINUTES.toSeconds(5), null); assertEquals("PASSED", result); }
private String getUrl() throws MalformedURLException { AppServer appServer = GlobalTestEnvironment.get().getAppServer(); URL url = new URL(appServer.whereIs("/selenium-server/tests/html/basicAuth/index.html")); return String.format( "%s://alice:foo@%s:%d%s", url.getProtocol(), url.getHost(), url.getPort(), url.getFile()); }