File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed
java/client/test/org/openqa/selenium Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change 18
18
package org .openqa .selenium .javascript ;
19
19
20
20
import static org .junit .Assert .fail ;
21
+ import static org .openqa .selenium .testing .TestUtilities .isOnTravis ;
21
22
22
23
import com .google .common .base .Stopwatch ;
23
24
27
28
import org .openqa .selenium .TakesScreenshot ;
28
29
import org .openqa .selenium .WebDriver ;
29
30
import org .openqa .selenium .WebDriverException ;
31
+ import org .openqa .selenium .testing .TestUtilities ;
30
32
31
33
import java .net .URL ;
32
34
import java .util .concurrent .TimeUnit ;
@@ -63,14 +65,15 @@ public void evaluate() throws Throwable {
63
65
64
66
WebDriver driver = driverSupplier .get ();
65
67
66
- // Attempt to make the window as big as possible.
67
- try {
68
- driver .manage ().window ().maximize ();
69
- } catch (RuntimeException ignored ) {
70
- // We tried.
68
+ if (!isOnTravis ()) {
69
+ // Attempt to make the window as big as possible.
70
+ try {
71
+ driver .manage ().window ().maximize ();
72
+ } catch (RuntimeException ignored ) {
73
+ // We tried.
74
+ }
71
75
}
72
76
73
-
74
77
JavascriptExecutor executor = (JavascriptExecutor ) driver ;
75
78
// Avoid Safari JS leak between tests.
76
79
executor .executeScript ("if (window && window.top) window.top.G_testRunner = null" );
Original file line number Diff line number Diff line change @@ -197,6 +197,10 @@ public static boolean isLocal() {
197
197
return !Boolean .getBoolean ("selenium.browser.remote" ) && !SauceDriver .shouldUseSauce ();
198
198
}
199
199
200
+ public static boolean isOnTravis () {
201
+ return Boolean .valueOf (System .getenv ("TRAVIS" ));
202
+ }
203
+
200
204
public static Throwable catchThrowable (Runnable f ) {
201
205
try {
202
206
f .run ();
You can’t perform that action at this time.
0 commit comments