File tree 4 files changed +14
-8
lines changed
java/client/test/org/openqa/selenium
4 files changed +14
-8
lines changed Original file line number Diff line number Diff line change 18
18
package org .openqa .selenium .devtools ;
19
19
20
20
import static org .assertj .core .api .Assumptions .assumeThat ;
21
+ import static org .openqa .selenium .testing .TestUtilities .isFirefoxVersionNotLessThan ;
21
22
22
23
import org .junit .Before ;
23
24
import org .openqa .selenium .testing .JUnit4TestBase ;
24
25
25
-
26
26
public abstract class DevToolsTestBase extends JUnit4TestBase {
27
27
28
28
protected DevTools devTools ;
29
29
30
30
@ Before
31
31
public void setUp () {
32
32
assumeThat (driver ).isInstanceOf (HasDevTools .class );
33
+ assumeThat (isFirefoxVersionNotLessThan (83 , driver )).isTrue ();
33
34
34
35
devTools = ((HasDevTools ) driver ).getDevTools ();
35
36
devTools .createSessionIfThereIsNotOne ();
Original file line number Diff line number Diff line change @@ -53,7 +53,6 @@ public class Html5CapabilitiesTest extends JUnit4TestBase {
53
53
public void avoidRemote () {
54
54
// TODO: Resolve why these tests don't work on the remote server
55
55
assumeTrue (TestUtilities .isLocal ());
56
- assumeTrue (TestUtilities .getFirefoxVersion (driver ) >= 12 );
57
56
}
58
57
59
58
@ Test
Original file line number Diff line number Diff line change 38
38
import static org .assertj .core .api .Assumptions .assumeThat ;
39
39
import static org .openqa .selenium .remote .http .Contents .utf8String ;
40
40
import static org .openqa .selenium .testing .Safely .safelyCall ;
41
+ import static org .openqa .selenium .testing .TestUtilities .isFirefoxVersionNotLessThan ;
41
42
42
43
public class NetworkInterceptorTest {
43
44
@@ -52,15 +53,16 @@ public static void shouldTestBeRunAtAll() {
52
53
53
54
@ Before
54
55
public void setup () {
55
- appServer = new NettyAppServer (req -> new HttpResponse ()
56
- .setStatus (200 )
57
- .addHeader ("Content-Type" , MediaType .XHTML_UTF_8 .toString ())
58
- .setContent (utf8String ("<html><head><title>Hello, World!</title></head><body/></html>" )));
59
- appServer .start ();
60
-
61
56
driver = new WebDriverBuilder ().get ();
62
57
63
58
assumeThat (driver ).isInstanceOf (HasDevTools .class );
59
+ assumeThat (isFirefoxVersionNotLessThan (83 , driver )).isTrue ();
60
+
61
+ appServer = new NettyAppServer (req -> new HttpResponse ()
62
+ .setStatus (200 )
63
+ .addHeader ("Content-Type" , MediaType .XHTML_UTF_8 .toString ())
64
+ .setContent (utf8String ("<html><head><title>Hello, World!</title></head><body/></html>" )));
65
+ appServer .start ();
64
66
}
65
67
66
68
@ After
Original file line number Diff line number Diff line change @@ -60,6 +60,10 @@ public static boolean isFirefox(WebDriver driver) {
60
60
return getUserAgent (driver ).contains ("Firefox" );
61
61
}
62
62
63
+ public static boolean isFirefoxVersionNotLessThan (int version , WebDriver driver ) {
64
+ return isFirefox (driver ) && getFirefoxVersion (driver ) >= version ;
65
+ }
66
+
63
67
public static boolean isInternetExplorer (WebDriver driver ) {
64
68
String userAgent = getUserAgent (driver );
65
69
return userAgent != null && (userAgent .contains ("MSIE" ) || userAgent .contains ("Trident" ));
You can’t perform that action at this time.
0 commit comments