18
18
package org .openqa .selenium .server .htmlrunner ;
19
19
20
20
import static org .junit .Assert .assertEquals ;
21
- import static org .junit .Assert .assertTrue ;
22
21
22
+ import com .google .common .base .StandardSystemProperty ;
23
23
import com .google .common .collect .ImmutableSortedSet ;
24
24
25
25
import com .thoughtworks .selenium .testing .SeleniumAppServer ;
33
33
import org .openqa .selenium .environment .webserver .AppServer ;
34
34
import org .openqa .selenium .os .CommandLine ;
35
35
36
- import java .io .File ;
37
36
import java .io .IOException ;
37
+ import java .nio .file .Files ;
38
+ import java .nio .file .Path ;
39
+ import java .nio .file .Paths ;
38
40
import java .util .concurrent .TimeUnit ;
39
41
40
42
@ RunWith (Parameterized .class )
@@ -61,8 +63,12 @@ public static void stopTestServer() {
61
63
@ Test
62
64
public void executeTests () throws IOException {
63
65
String testBase = server .whereIs ("/selenium-server/tests" );
64
- File outputFile = File .createTempFile ("core-test-suite" , browser .replace ('*' , '-' ) + ".html" );
65
- assertTrue (outputFile .delete ());
66
+ Path outputFile = Paths .get (StandardSystemProperty .JAVA_IO_TMPDIR .value ())
67
+ .resolve ("core-test-suite" + browser .replace ('*' , '-' ) + ".html" );
68
+ if (Files .exists (outputFile )) {
69
+ Files .delete (outputFile );
70
+ }
71
+ Files .createDirectories (outputFile .getParent ());
66
72
67
73
String result = new HTMLLauncher ()
68
74
.runHTMLSuite (
@@ -72,7 +78,7 @@ public void executeTests() throws IOException {
72
78
// ends up as "/tests" rather than "/selenium-server/tests" as you'd expect.
73
79
testBase + "/TestSuite.html" ,
74
80
testBase + "/TestSuite.html" ,
75
- outputFile ,
81
+ outputFile . toFile () ,
76
82
TimeUnit .MINUTES .toMillis (5 ),
77
83
true );
78
84
@@ -87,8 +93,8 @@ public static Iterable<String> parameters() {
87
93
browsers .add ("*googlechrome" );
88
94
}
89
95
90
- if (CommandLine .find ("wires " ) != null ) {
91
- // browsers.add("*firefox");
96
+ if (CommandLine .find ("geckodriver " ) != null ) {
97
+ browsers .add ("*firefox" );
92
98
}
93
99
94
100
switch (Platform .getCurrent ().family ()) {
@@ -97,7 +103,7 @@ public static Iterable<String> parameters() {
97
103
break ;
98
104
99
105
case WINDOWS :
100
- browsers .add ("*iexplore " );
106
+ browsers .add ("*MicrosoftEdge " );
101
107
break ;
102
108
}
103
109
0 commit comments