Skip to content

Commit fa37d18

Browse files
committed
NeedsLocalEnvironment wasn't being checked anywhere
So it's likely it's not needed. Removing.
1 parent c3450b1 commit fa37d18

16 files changed

+0
-89
lines changed

java/test/org/openqa/selenium/ExecutingAsyncJavascriptTest.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
import org.junit.Test;
3333
import org.openqa.selenium.testing.Ignore;
3434
import org.openqa.selenium.testing.JUnit4TestBase;
35-
import org.openqa.selenium.testing.NeedsLocalEnvironment;
3635
import org.openqa.selenium.testing.NotYetImplemented;
3736

3837
import java.time.Duration;
@@ -277,7 +276,6 @@ public void shouldBeAbleToPassMultipleArgumentsToAsyncScripts() {
277276
}
278277

279278
@Test
280-
@NeedsLocalEnvironment(reason = "Relies on timing")
281279
public void shouldBeAbleToMakeXMLHttpRequestsAndWaitForTheResponse() {
282280
String script =
283281
"var url = arguments[0];" +
@@ -315,7 +313,6 @@ public void shouldBeAbleToMakeXMLHttpRequestsAndWaitForTheResponse() {
315313
@Ignore(IE)
316314
@Ignore(FIREFOX)
317315
@Ignore(value = SAFARI, reason = "Does not support alerts yet")
318-
@NeedsLocalEnvironment(reason = "Relies on timing")
319316
public void throwsIfScriptTriggersAlert() {
320317
driver.get(pages.simpleTestPage);
321318
driver.manage().timeouts().setScriptTimeout(Duration.ofMillis(5000));
@@ -332,7 +329,6 @@ public void throwsIfScriptTriggersAlert() {
332329
@Ignore(IE)
333330
@Ignore(FIREFOX)
334331
@Ignore(value = SAFARI, reason = "Does not support alerts yet")
335-
@NeedsLocalEnvironment(reason = "Relies on timing")
336332
public void throwsIfAlertHappensDuringScript() {
337333
driver.get(pages.slowLoadingAlertPage);
338334
driver.manage().timeouts().setScriptTimeout(Duration.ofMillis(5000));
@@ -348,7 +344,6 @@ public void throwsIfAlertHappensDuringScript() {
348344
@Ignore(IE)
349345
@Ignore(FIREFOX)
350346
@Ignore(value = SAFARI, reason = "Does not support alerts yet")
351-
@NeedsLocalEnvironment(reason = "Relies on timing")
352347
public void throwsIfScriptTriggersAlertWhichTimesOut() {
353348
driver.get(pages.simpleTestPage);
354349
driver.manage().timeouts().setScriptTimeout(Duration.ofMillis(5000));
@@ -365,7 +360,6 @@ public void throwsIfScriptTriggersAlertWhichTimesOut() {
365360
@Ignore(IE)
366361
@Ignore(FIREFOX)
367362
@Ignore(value = SAFARI, reason = "Does not support alerts yet")
368-
@NeedsLocalEnvironment(reason = "Relies on timing")
369363
public void throwsIfAlertHappensDuringScriptWhichTimesOut() {
370364
driver.get(pages.slowLoadingAlertPage);
371365
driver.manage().timeouts().setScriptTimeout(Duration.ofMillis(5000));
@@ -381,7 +375,6 @@ public void throwsIfAlertHappensDuringScriptWhichTimesOut() {
381375
@Ignore(IE)
382376
@Ignore(FIREFOX)
383377
@Ignore(value = SAFARI, reason = "Does not support alerts yet")
384-
@NeedsLocalEnvironment(reason = "Relies on timing")
385378
public void includesAlertTextInUnhandledAlertException() {
386379
driver.manage().timeouts().setScriptTimeout(Duration.ofMillis(5000));
387380
String alertText = "Look! An alert!";

java/test/org/openqa/selenium/FrameSwitchingTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
import org.junit.Test;
3636
import org.openqa.selenium.testing.Ignore;
3737
import org.openqa.selenium.testing.JUnit4TestBase;
38-
import org.openqa.selenium.testing.NeedsLocalEnvironment;
3938
import org.openqa.selenium.testing.NotYetImplemented;
4039

4140
import java.util.Random;
@@ -71,7 +70,6 @@ public void testShouldNotAutomaticallySwitchFocusToAnIFrameWhenAPageContainingTh
7170
}
7271

7372
@Test(timeout = 10000)
74-
@NeedsLocalEnvironment(reason = "it hangs at IE9 and event Test.timeout doesn't help")
7573
public void testShouldOpenPageWithBrokenFrameset() {
7674
driver.get(appServer.whereIs("framesetPage3.html"));
7775

java/test/org/openqa/selenium/ImplicitWaitTest.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,11 @@
3131
import org.openqa.selenium.support.ui.WebDriverWait;
3232
import org.openqa.selenium.testing.Ignore;
3333
import org.openqa.selenium.testing.JUnit4TestBase;
34-
import org.openqa.selenium.testing.NeedsLocalEnvironment;
3534
import org.openqa.selenium.testing.NotYetImplemented;
3635

3736
import java.time.Duration;
3837
import java.util.List;
3938

40-
@NeedsLocalEnvironment(reason =
41-
"Executing these tests over the wire doesn't work, because they relies on 100ms-specific timing")
4239
public class ImplicitWaitTest extends JUnit4TestBase {
4340

4441
@Before

java/test/org/openqa/selenium/PageLoadingTest.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
import org.openqa.selenium.testing.Ignore;
4343
import org.openqa.selenium.testing.JUnit4TestBase;
4444
import org.openqa.selenium.testing.NeedsFreshDriver;
45-
import org.openqa.selenium.testing.NeedsLocalEnvironment;
4645
import org.openqa.selenium.testing.NoDriverAfterTest;
4746
import org.openqa.selenium.testing.NoDriverBeforeTest;
4847
import org.openqa.selenium.testing.NotYetImplemented;
@@ -67,7 +66,6 @@ public void shouldSetAndGetPageLoadTimeout() {
6766
}
6867

6968
@Test
70-
@NeedsLocalEnvironment
7169
@NoDriverBeforeTest
7270
@NoDriverAfterTest
7371
public void testNoneStrategyShouldNotWaitForPageToLoad() {
@@ -86,7 +84,6 @@ public void testNoneStrategyShouldNotWaitForPageToLoad() {
8684
}
8785

8886
@Test
89-
@NeedsLocalEnvironment
9087
@NoDriverBeforeTest
9188
@NoDriverAfterTest
9289
@Ignore(value = CHROME, reason = "Flaky")
@@ -111,7 +108,6 @@ public void testNoneStrategyShouldNotWaitForPageToRefresh() {
111108
}
112109

113110
@Test
114-
@NeedsLocalEnvironment
115111
@NoDriverBeforeTest
116112
@NoDriverAfterTest
117113
public void testEagerStrategyShouldNotWaitForResources() {
@@ -133,7 +129,6 @@ public void testEagerStrategyShouldNotWaitForResources() {
133129
}
134130

135131
@Test
136-
@NeedsLocalEnvironment
137132
@NoDriverBeforeTest
138133
@NoDriverAfterTest
139134
public void testEagerStrategyShouldNotWaitForResourcesOnRefresh() {
@@ -350,7 +345,6 @@ public void testShouldNotHangIfDocumentOpenCallIsNeverFollowedByDocumentCloseCal
350345
@Test
351346
@Ignore(LEGACY_FIREFOX_XPI)
352347
@NotYetImplemented(SAFARI)
353-
@NeedsLocalEnvironment
354348
public void testPageLoadTimeoutCanBeChanged() {
355349
testPageLoadTimeoutIsEnforced(2);
356350
testPageLoadTimeoutIsEnforced(3);
@@ -359,7 +353,6 @@ public void testPageLoadTimeoutCanBeChanged() {
359353
@Test
360354
@Ignore(LEGACY_FIREFOX_XPI)
361355
@NotYetImplemented(SAFARI)
362-
@NeedsLocalEnvironment
363356
public void testCanHandleSequentialPageLoadTimeouts() {
364357
long pageLoadTimeout = 2;
365358
long pageLoadTimeBuffer = 10;
@@ -369,7 +362,6 @@ public void testCanHandleSequentialPageLoadTimeouts() {
369362
}
370363

371364
@Test
372-
@NeedsLocalEnvironment
373365
public void testShouldTimeoutIfAPageTakesTooLongToLoad() {
374366
try {
375367
testPageLoadTimeoutIsEnforced(2);
@@ -386,7 +378,6 @@ public void testShouldTimeoutIfAPageTakesTooLongToLoad() {
386378
@Ignore(value = LEGACY_FIREFOX_XPI, travis = true)
387379
@Ignore(HTMLUNIT)
388380
@Ignore(value = SAFARI, reason = "Flaky")
389-
@NeedsLocalEnvironment
390381
public void testShouldTimeoutIfAPageTakesTooLongToLoadAfterClick() {
391382
driver.manage().timeouts().pageLoadTimeout(Duration.ofSeconds(2));
392383

@@ -415,7 +406,6 @@ public void testShouldTimeoutIfAPageTakesTooLongToLoadAfterClick() {
415406
}
416407

417408
@Test
418-
@NeedsLocalEnvironment
419409
@Ignore(value = CHROME, reason = "Flaky")
420410
@Ignore(value = EDGE, reason = "Flaky")
421411
public void testShouldTimeoutIfAPageTakesTooLongToRefresh() {
@@ -452,7 +442,6 @@ public void testShouldTimeoutIfAPageTakesTooLongToRefresh() {
452442
@NotYetImplemented(EDGE)
453443
@NotYetImplemented(value = SAFARI)
454444
@NotYetImplemented(HTMLUNIT)
455-
@NeedsLocalEnvironment
456445
public void testShouldNotStopLoadingPageAfterTimeout() {
457446
try {
458447
testPageLoadTimeoutIsEnforced(1);

java/test/org/openqa/selenium/ProxySettingTest.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
import org.openqa.selenium.remote.http.HttpResponse;
4242
import org.openqa.selenium.testing.Ignore;
4343
import org.openqa.selenium.testing.JUnit4TestBase;
44-
import org.openqa.selenium.testing.NeedsLocalEnvironment;
4544
import org.openqa.selenium.testing.NoDriverAfterTest;
4645
import org.openqa.selenium.testing.NoDriverBeforeTest;
4746
import org.openqa.selenium.testing.Safely;
@@ -78,7 +77,6 @@ public void tearDown() {
7877

7978
@Test
8079
@Ignore(SAFARI)
81-
@NeedsLocalEnvironment
8280
@NoDriverBeforeTest
8381
@NoDriverAfterTest
8482
public void canConfigureManualHttpProxy() {
@@ -92,7 +90,6 @@ public void canConfigureManualHttpProxy() {
9290

9391
@Test
9492
@Ignore(SAFARI)
95-
@NeedsLocalEnvironment
9693
@NoDriverBeforeTest
9794
@NoDriverAfterTest
9895
public void canConfigureNoProxy() {
@@ -110,7 +107,6 @@ public void canConfigureNoProxy() {
110107

111108
@Test
112109
@Ignore(SAFARI)
113-
@NeedsLocalEnvironment
114110
@NoDriverBeforeTest
115111
@NoDriverAfterTest
116112
public void canConfigureProxyThroughPACFile() {
@@ -132,7 +128,6 @@ public void canConfigureProxyThroughPACFile() {
132128

133129
@Test
134130
@Ignore(SAFARI)
135-
@NeedsLocalEnvironment
136131
@NoDriverBeforeTest
137132
@NoDriverAfterTest
138133
@Ignore(value = FIREFOX, travis = true)

java/test/org/openqa/selenium/ReferrerTest.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
import org.openqa.selenium.remote.http.HttpResponse;
3434
import org.openqa.selenium.support.ui.WebDriverWait;
3535
import org.openqa.selenium.testing.Ignore;
36-
import org.openqa.selenium.testing.NeedsLocalEnvironment;
3736
import org.openqa.selenium.testing.SeleniumTestRule;
3837
import org.openqa.selenium.testing.SeleniumTestRunner;
3938

@@ -138,7 +137,6 @@ private WebDriver createDriver(String pacUrl) {
138137
* does not have a proxy configured.
139138
*/
140139
@Test
141-
@NeedsLocalEnvironment
142140
public void basicHistoryNavigationWithoutAProxy() {
143141
String page1Url = server1.whereIs(PAGE_1 + "?next=" + encode(server1.whereIs(PAGE_2)));
144142
String page2Url = server1.whereIs(PAGE_2 + "?next=" + encode(server1.whereIs(PAGE_3)));
@@ -155,7 +153,6 @@ public void basicHistoryNavigationWithoutAProxy() {
155153
* Tests navigation across multiple domains when the browser does not have a proxy configured.
156154
*/
157155
@Test
158-
@NeedsLocalEnvironment
159156
@Ignore(value = CHROME, reason = "https://developers.google.com/web/updates/2020/07/referrer-policy-new-chrome-default")
160157
@Ignore(value = FIREFOX, reason = "https://developers.google.com/web/updates/2020/07/referrer-policy-new-chrome-default")
161158
public void crossDomainHistoryNavigationWithoutAProxy() {
@@ -177,7 +174,6 @@ public void crossDomainHistoryNavigationWithoutAProxy() {
177174
* configured to use a proxy that permits direct access to that domain.
178175
*/
179176
@Test
180-
@NeedsLocalEnvironment
181177
public void basicHistoryNavigationWithADirectProxy() {
182178
proxyServer.setPacFileContents("function FindProxyForURL(url, host) { return 'DIRECT'; }");
183179
WebDriver driver = createDriver(proxyServer.whereIs("/pac.js"));
@@ -199,7 +195,6 @@ public void basicHistoryNavigationWithADirectProxy() {
199195
* permits direct access to those domains.
200196
*/
201197
@Test
202-
@NeedsLocalEnvironment
203198
@Ignore(value = CHROME, reason = "https://developers.google.com/web/updates/2020/07/referrer-policy-new-chrome-default")
204199
@Ignore(value = FIREFOX, reason = "https://developers.google.com/web/updates/2020/07/referrer-policy-new-chrome-default")
205200
public void crossDomainHistoryNavigationWithADirectProxy() {
@@ -224,7 +219,6 @@ public void crossDomainHistoryNavigationWithADirectProxy() {
224219
* redirects the second domain to another host.
225220
*/
226221
@Test
227-
@NeedsLocalEnvironment
228222
@Ignore(value = CHROME, reason = "https://developers.google.com/web/updates/2020/07/referrer-policy-new-chrome-default")
229223
@Ignore(value = FIREFOX, reason = "https://developers.google.com/web/updates/2020/07/referrer-policy-new-chrome-default")
230224
public void crossDomainHistoryNavigationWithAProxiedHost() {
@@ -256,7 +250,6 @@ public void crossDomainHistoryNavigationWithAProxiedHost() {
256250
* to connect directly to the target server.
257251
*/
258252
@Test
259-
@NeedsLocalEnvironment
260253
@Ignore(value = CHROME, reason = "https://developers.google.com/web/updates/2020/07/referrer-policy-new-chrome-default")
261254
@Ignore(value = FIREFOX, reason = "https://developers.google.com/web/updates/2020/07/referrer-policy-new-chrome-default")
262255
public void crossDomainHistoryNavigationWhenProxyInterceptsHostRequests() {
@@ -291,7 +284,6 @@ public void crossDomainHistoryNavigationWhenProxyInterceptsHostRequests() {
291284
reason = "IEDriver does not disable automatic proxy caching, causing this test to fail, issue 6629")
292285
@Ignore(FIREFOX)
293286
@Ignore(value = LEGACY_FIREFOX_XPI, travis = true)
294-
@NeedsLocalEnvironment
295287
@Ignore(value = CHROME, reason = "Flaky")
296288
public void navigationWhenProxyInterceptsASpecificUrl() {
297289
// Have our proxy intercept requests for page 2.

java/test/org/openqa/selenium/UnexpectedAlertBehaviorTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,10 @@
3232
import org.openqa.selenium.support.ui.WebDriverWait;
3333
import org.openqa.selenium.testing.Ignore;
3434
import org.openqa.selenium.testing.JUnit4TestBase;
35-
import org.openqa.selenium.testing.NeedsLocalEnvironment;
3635
import org.openqa.selenium.testing.NoDriverBeforeTest;
3736

3837
import java.time.Duration;
3938

40-
@NeedsLocalEnvironment(reason = "Requires local browser launching environment")
4139
@Ignore(value = SAFARI, reason = "Does not support alerts yet")
4240
public class UnexpectedAlertBehaviorTest extends JUnit4TestBase {
4341

java/test/org/openqa/selenium/chrome/ChromeOptionsFunctionalTest.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import org.openqa.selenium.support.ui.WebDriverWait;
2929
import org.openqa.selenium.build.InProject;
3030
import org.openqa.selenium.testing.JUnit4TestBase;
31-
import org.openqa.selenium.testing.NeedsLocalEnvironment;
3231
import org.openqa.selenium.testing.TestUtilities;
3332

3433
import java.io.IOException;
@@ -49,7 +48,6 @@ public void tearDown() {
4948
}
5049
}
5150

52-
@NeedsLocalEnvironment
5351
@Test
5452
public void canStartChromeWithCustomOptions() {
5553
ChromeOptions options = new ChromeOptions();
@@ -64,7 +62,6 @@ public void canStartChromeWithCustomOptions() {
6462
assertThat(userAgent).isEqualTo("foo;bar");
6563
}
6664

67-
@NeedsLocalEnvironment
6865
@Test
6966
public void optionsStayEqualAfterSerialization() {
7067
ChromeOptions options1 = new ChromeOptions();
@@ -74,7 +71,6 @@ public void optionsStayEqualAfterSerialization() {
7471
assertThat(options2).isEqualTo(options1);
7572
}
7673

77-
@NeedsLocalEnvironment
7874
@Test
7975
public void canSetAcceptInsecureCerts() {
8076
ChromeOptions options = new ChromeOptions();
@@ -87,7 +83,6 @@ public void canSetAcceptInsecureCerts() {
8783
assertThat(driver.getCapabilities().getCapability(ACCEPT_INSECURE_CERTS)).isEqualTo(true);
8884
}
8985

90-
@NeedsLocalEnvironment
9186
@Test
9287
public void canAddExtensionFromFile() {
9388
ChromeOptions options = new ChromeOptions();
@@ -106,7 +101,6 @@ public void canAddExtensionFromFile() {
106101
new WebDriverWait(driver, Duration.ofSeconds(10)).until(titleIs("clicks"));
107102
}
108103

109-
@NeedsLocalEnvironment
110104
@Test
111105
public void canAddExtensionFromStringEncodedInBase64() throws IOException {
112106
ChromeOptions options = new ChromeOptions();

java/test/org/openqa/selenium/firefox/FirefoxDriverTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
import org.openqa.selenium.testing.Ignore;
4646
import org.openqa.selenium.testing.JUnit4TestBase;
4747
import org.openqa.selenium.testing.NeedsFreshDriver;
48-
import org.openqa.selenium.testing.NeedsLocalEnvironment;
4948
import org.openqa.selenium.testing.NoDriverAfterTest;
5049
import org.openqa.selenium.testing.NotYetImplemented;
5150
import org.openqa.selenium.testing.drivers.WebDriverBuilder;
@@ -75,7 +74,6 @@
7574
import static org.openqa.selenium.support.ui.ExpectedConditions.titleIs;
7675
import static org.openqa.selenium.testing.drivers.Browser.FIREFOX;
7776

78-
@NeedsLocalEnvironment(reason = "Requires local browser launching environment")
7977
public class FirefoxDriverTest extends JUnit4TestBase {
8078

8179
private FirefoxDriver localDriver;

java/test/org/openqa/selenium/ie/InternetExplorerDriverTest.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import org.openqa.selenium.WebElement;
2626
import org.openqa.selenium.interactions.Actions;
2727
import org.openqa.selenium.testing.JUnit4TestBase;
28-
import org.openqa.selenium.testing.NeedsLocalEnvironment;
2928
import org.openqa.selenium.testing.NoDriverAfterTest;
3029
import org.openqa.selenium.testing.NoDriverBeforeTest;
3130
import org.openqa.selenium.testing.drivers.WebDriverBuilder;
@@ -35,7 +34,6 @@
3534
import static org.assertj.core.api.Assertions.assertThat;
3635
import static org.openqa.selenium.ie.InternetExplorerDriver.ENABLE_PERSISTENT_HOVERING;
3736

38-
@NeedsLocalEnvironment(reason = "Requires local browser launching environment")
3937
public class InternetExplorerDriverTest extends JUnit4TestBase {
4038

4139
@Test
@@ -65,7 +63,6 @@ public void canStartMultipleIeDriverInstances() {
6563

6664
@NoDriverBeforeTest
6765
@NoDriverAfterTest
68-
@NeedsLocalEnvironment
6966
@Test
7067
public void testPersistentHoverCanBeTurnedOff() throws Exception {
7168
createNewDriver(new ImmutableCapabilities(ENABLE_PERSISTENT_HOVERING, false));

0 commit comments

Comments
 (0)