Beispiel #1
0
  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());
  }
Beispiel #2
0
  @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);
  }
Beispiel #3
0
  @BeforeClass
  public static void startSecondServer() {
    otherServer = new JettyAppServer();
    otherServer.start();

    otherPages = new Pages(otherServer);
  }
Beispiel #4
0
 @AfterClass
 public static void stopTestServer() {
   server.stop();
 }
Beispiel #5
0
 @BeforeClass
 public static void startTestServer() {
   server = new SeleniumAppServer();
   server.start();
 }
Beispiel #6
0
 @AfterClass
 public static void stopSecondServer() {
   otherServer.stop();
 }
 public void stop() {
   appServer.stop();
 }
 public InProcessTestEnvironment() {
   appServer = new Jetty7AppServer();
   appServer.start();
 }