Skip to content

Commit

Permalink
Expand set of browsers used for core runner tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shs96c committed Jul 28, 2016
1 parent adc8214 commit 3705de8
Showing 1 changed file with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
package org.openqa.selenium.server.htmlrunner;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import com.google.common.base.StandardSystemProperty;
import com.google.common.collect.ImmutableSortedSet;

import com.thoughtworks.selenium.testing.SeleniumAppServer;
Expand All @@ -33,8 +33,10 @@
import org.openqa.selenium.environment.webserver.AppServer;
import org.openqa.selenium.os.CommandLine;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.concurrent.TimeUnit;

@RunWith(Parameterized.class)
Expand All @@ -61,8 +63,12 @@ public static void stopTestServer() {
@Test
public void executeTests() throws IOException {
String testBase = server.whereIs("/selenium-server/tests");
File outputFile = File.createTempFile("core-test-suite", browser.replace('*', '-') + ".html");
assertTrue(outputFile.delete());
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(
Expand All @@ -72,7 +78,7 @@ public void executeTests() throws IOException {
// ends up as "/tests" rather than "/selenium-server/tests" as you'd expect.
testBase + "/TestSuite.html",
testBase + "/TestSuite.html",
outputFile,
outputFile.toFile(),
TimeUnit.MINUTES.toMillis(5),
true);

Expand All @@ -87,8 +93,8 @@ public static Iterable<String> parameters() {
browsers.add("*googlechrome");
}

if (CommandLine.find("wires") != null) {
// browsers.add("*firefox");
if (CommandLine.find("geckodriver") != null) {
browsers.add("*firefox");
}

switch (Platform.getCurrent().family()) {
Expand All @@ -97,7 +103,7 @@ public static Iterable<String> parameters() {
break;

case WINDOWS:
browsers.add("*iexplore");
browsers.add("*MicrosoftEdge");
break;
}

Expand Down

0 comments on commit 3705de8

Please sign in to comment.