Skip to content

Commit

Permalink
NeedsLocalEnvironment wasn't being checked anywhere
Browse files Browse the repository at this point in the history
So it's likely it's not needed. Removing.
  • Loading branch information
shs96c committed Sep 27, 2021
1 parent c3450b1 commit fa37d18
Show file tree
Hide file tree
Showing 16 changed files with 0 additions and 89 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import org.junit.Test;
import org.openqa.selenium.testing.Ignore;
import org.openqa.selenium.testing.JUnit4TestBase;
import org.openqa.selenium.testing.NeedsLocalEnvironment;
import org.openqa.selenium.testing.NotYetImplemented;

import java.time.Duration;
Expand Down Expand Up @@ -277,7 +276,6 @@ public void shouldBeAbleToPassMultipleArgumentsToAsyncScripts() {
}

@Test
@NeedsLocalEnvironment(reason = "Relies on timing")
public void shouldBeAbleToMakeXMLHttpRequestsAndWaitForTheResponse() {
String script =
"var url = arguments[0];" +
Expand Down Expand Up @@ -315,7 +313,6 @@ public void shouldBeAbleToMakeXMLHttpRequestsAndWaitForTheResponse() {
@Ignore(IE)
@Ignore(FIREFOX)
@Ignore(value = SAFARI, reason = "Does not support alerts yet")
@NeedsLocalEnvironment(reason = "Relies on timing")
public void throwsIfScriptTriggersAlert() {
driver.get(pages.simpleTestPage);
driver.manage().timeouts().setScriptTimeout(Duration.ofMillis(5000));
Expand All @@ -332,7 +329,6 @@ public void throwsIfScriptTriggersAlert() {
@Ignore(IE)
@Ignore(FIREFOX)
@Ignore(value = SAFARI, reason = "Does not support alerts yet")
@NeedsLocalEnvironment(reason = "Relies on timing")
public void throwsIfAlertHappensDuringScript() {
driver.get(pages.slowLoadingAlertPage);
driver.manage().timeouts().setScriptTimeout(Duration.ofMillis(5000));
Expand All @@ -348,7 +344,6 @@ public void throwsIfAlertHappensDuringScript() {
@Ignore(IE)
@Ignore(FIREFOX)
@Ignore(value = SAFARI, reason = "Does not support alerts yet")
@NeedsLocalEnvironment(reason = "Relies on timing")
public void throwsIfScriptTriggersAlertWhichTimesOut() {
driver.get(pages.simpleTestPage);
driver.manage().timeouts().setScriptTimeout(Duration.ofMillis(5000));
Expand All @@ -365,7 +360,6 @@ public void throwsIfScriptTriggersAlertWhichTimesOut() {
@Ignore(IE)
@Ignore(FIREFOX)
@Ignore(value = SAFARI, reason = "Does not support alerts yet")
@NeedsLocalEnvironment(reason = "Relies on timing")
public void throwsIfAlertHappensDuringScriptWhichTimesOut() {
driver.get(pages.slowLoadingAlertPage);
driver.manage().timeouts().setScriptTimeout(Duration.ofMillis(5000));
Expand All @@ -381,7 +375,6 @@ public void throwsIfAlertHappensDuringScriptWhichTimesOut() {
@Ignore(IE)
@Ignore(FIREFOX)
@Ignore(value = SAFARI, reason = "Does not support alerts yet")
@NeedsLocalEnvironment(reason = "Relies on timing")
public void includesAlertTextInUnhandledAlertException() {
driver.manage().timeouts().setScriptTimeout(Duration.ofMillis(5000));
String alertText = "Look! An alert!";
Expand Down
2 changes: 0 additions & 2 deletions java/test/org/openqa/selenium/FrameSwitchingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import org.junit.Test;
import org.openqa.selenium.testing.Ignore;
import org.openqa.selenium.testing.JUnit4TestBase;
import org.openqa.selenium.testing.NeedsLocalEnvironment;
import org.openqa.selenium.testing.NotYetImplemented;

import java.util.Random;
Expand Down Expand Up @@ -71,7 +70,6 @@ public void testShouldNotAutomaticallySwitchFocusToAnIFrameWhenAPageContainingTh
}

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

Expand Down
3 changes: 0 additions & 3 deletions java/test/org/openqa/selenium/ImplicitWaitTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,11 @@
import org.openqa.selenium.support.ui.WebDriverWait;
import org.openqa.selenium.testing.Ignore;
import org.openqa.selenium.testing.JUnit4TestBase;
import org.openqa.selenium.testing.NeedsLocalEnvironment;
import org.openqa.selenium.testing.NotYetImplemented;

import java.time.Duration;
import java.util.List;

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

@Before
Expand Down
11 changes: 0 additions & 11 deletions java/test/org/openqa/selenium/PageLoadingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
import org.openqa.selenium.testing.Ignore;
import org.openqa.selenium.testing.JUnit4TestBase;
import org.openqa.selenium.testing.NeedsFreshDriver;
import org.openqa.selenium.testing.NeedsLocalEnvironment;
import org.openqa.selenium.testing.NoDriverAfterTest;
import org.openqa.selenium.testing.NoDriverBeforeTest;
import org.openqa.selenium.testing.NotYetImplemented;
Expand All @@ -67,7 +66,6 @@ public void shouldSetAndGetPageLoadTimeout() {
}

@Test
@NeedsLocalEnvironment
@NoDriverBeforeTest
@NoDriverAfterTest
public void testNoneStrategyShouldNotWaitForPageToLoad() {
Expand All @@ -86,7 +84,6 @@ public void testNoneStrategyShouldNotWaitForPageToLoad() {
}

@Test
@NeedsLocalEnvironment
@NoDriverBeforeTest
@NoDriverAfterTest
@Ignore(value = CHROME, reason = "Flaky")
Expand All @@ -111,7 +108,6 @@ public void testNoneStrategyShouldNotWaitForPageToRefresh() {
}

@Test
@NeedsLocalEnvironment
@NoDriverBeforeTest
@NoDriverAfterTest
public void testEagerStrategyShouldNotWaitForResources() {
Expand All @@ -133,7 +129,6 @@ public void testEagerStrategyShouldNotWaitForResources() {
}

@Test
@NeedsLocalEnvironment
@NoDriverBeforeTest
@NoDriverAfterTest
public void testEagerStrategyShouldNotWaitForResourcesOnRefresh() {
Expand Down Expand Up @@ -350,7 +345,6 @@ public void testShouldNotHangIfDocumentOpenCallIsNeverFollowedByDocumentCloseCal
@Test
@Ignore(LEGACY_FIREFOX_XPI)
@NotYetImplemented(SAFARI)
@NeedsLocalEnvironment
public void testPageLoadTimeoutCanBeChanged() {
testPageLoadTimeoutIsEnforced(2);
testPageLoadTimeoutIsEnforced(3);
Expand All @@ -359,7 +353,6 @@ public void testPageLoadTimeoutCanBeChanged() {
@Test
@Ignore(LEGACY_FIREFOX_XPI)
@NotYetImplemented(SAFARI)
@NeedsLocalEnvironment
public void testCanHandleSequentialPageLoadTimeouts() {
long pageLoadTimeout = 2;
long pageLoadTimeBuffer = 10;
Expand All @@ -369,7 +362,6 @@ public void testCanHandleSequentialPageLoadTimeouts() {
}

@Test
@NeedsLocalEnvironment
public void testShouldTimeoutIfAPageTakesTooLongToLoad() {
try {
testPageLoadTimeoutIsEnforced(2);
Expand All @@ -386,7 +378,6 @@ public void testShouldTimeoutIfAPageTakesTooLongToLoad() {
@Ignore(value = LEGACY_FIREFOX_XPI, travis = true)
@Ignore(HTMLUNIT)
@Ignore(value = SAFARI, reason = "Flaky")
@NeedsLocalEnvironment
public void testShouldTimeoutIfAPageTakesTooLongToLoadAfterClick() {
driver.manage().timeouts().pageLoadTimeout(Duration.ofSeconds(2));

Expand Down Expand Up @@ -415,7 +406,6 @@ public void testShouldTimeoutIfAPageTakesTooLongToLoadAfterClick() {
}

@Test
@NeedsLocalEnvironment
@Ignore(value = CHROME, reason = "Flaky")
@Ignore(value = EDGE, reason = "Flaky")
public void testShouldTimeoutIfAPageTakesTooLongToRefresh() {
Expand Down Expand Up @@ -452,7 +442,6 @@ public void testShouldTimeoutIfAPageTakesTooLongToRefresh() {
@NotYetImplemented(EDGE)
@NotYetImplemented(value = SAFARI)
@NotYetImplemented(HTMLUNIT)
@NeedsLocalEnvironment
public void testShouldNotStopLoadingPageAfterTimeout() {
try {
testPageLoadTimeoutIsEnforced(1);
Expand Down
5 changes: 0 additions & 5 deletions java/test/org/openqa/selenium/ProxySettingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
import org.openqa.selenium.remote.http.HttpResponse;
import org.openqa.selenium.testing.Ignore;
import org.openqa.selenium.testing.JUnit4TestBase;
import org.openqa.selenium.testing.NeedsLocalEnvironment;
import org.openqa.selenium.testing.NoDriverAfterTest;
import org.openqa.selenium.testing.NoDriverBeforeTest;
import org.openqa.selenium.testing.Safely;
Expand Down Expand Up @@ -78,7 +77,6 @@ public void tearDown() {

@Test
@Ignore(SAFARI)
@NeedsLocalEnvironment
@NoDriverBeforeTest
@NoDriverAfterTest
public void canConfigureManualHttpProxy() {
Expand All @@ -92,7 +90,6 @@ public void canConfigureManualHttpProxy() {

@Test
@Ignore(SAFARI)
@NeedsLocalEnvironment
@NoDriverBeforeTest
@NoDriverAfterTest
public void canConfigureNoProxy() {
Expand All @@ -110,7 +107,6 @@ public void canConfigureNoProxy() {

@Test
@Ignore(SAFARI)
@NeedsLocalEnvironment
@NoDriverBeforeTest
@NoDriverAfterTest
public void canConfigureProxyThroughPACFile() {
Expand All @@ -132,7 +128,6 @@ public void canConfigureProxyThroughPACFile() {

@Test
@Ignore(SAFARI)
@NeedsLocalEnvironment
@NoDriverBeforeTest
@NoDriverAfterTest
@Ignore(value = FIREFOX, travis = true)
Expand Down
8 changes: 0 additions & 8 deletions java/test/org/openqa/selenium/ReferrerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import org.openqa.selenium.remote.http.HttpResponse;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.openqa.selenium.testing.Ignore;
import org.openqa.selenium.testing.NeedsLocalEnvironment;
import org.openqa.selenium.testing.SeleniumTestRule;
import org.openqa.selenium.testing.SeleniumTestRunner;

Expand Down Expand Up @@ -138,7 +137,6 @@ private WebDriver createDriver(String pacUrl) {
* does not have a proxy configured.
*/
@Test
@NeedsLocalEnvironment
public void basicHistoryNavigationWithoutAProxy() {
String page1Url = server1.whereIs(PAGE_1 + "?next=" + encode(server1.whereIs(PAGE_2)));
String page2Url = server1.whereIs(PAGE_2 + "?next=" + encode(server1.whereIs(PAGE_3)));
Expand All @@ -155,7 +153,6 @@ public void basicHistoryNavigationWithoutAProxy() {
* Tests navigation across multiple domains when the browser does not have a proxy configured.
*/
@Test
@NeedsLocalEnvironment
@Ignore(value = CHROME, reason = "https://developers.google.com/web/updates/2020/07/referrer-policy-new-chrome-default")
@Ignore(value = FIREFOX, reason = "https://developers.google.com/web/updates/2020/07/referrer-policy-new-chrome-default")
public void crossDomainHistoryNavigationWithoutAProxy() {
Expand All @@ -177,7 +174,6 @@ public void crossDomainHistoryNavigationWithoutAProxy() {
* configured to use a proxy that permits direct access to that domain.
*/
@Test
@NeedsLocalEnvironment
public void basicHistoryNavigationWithADirectProxy() {
proxyServer.setPacFileContents("function FindProxyForURL(url, host) { return 'DIRECT'; }");
WebDriver driver = createDriver(proxyServer.whereIs("/pac.js"));
Expand All @@ -199,7 +195,6 @@ public void basicHistoryNavigationWithADirectProxy() {
* permits direct access to those domains.
*/
@Test
@NeedsLocalEnvironment
@Ignore(value = CHROME, reason = "https://developers.google.com/web/updates/2020/07/referrer-policy-new-chrome-default")
@Ignore(value = FIREFOX, reason = "https://developers.google.com/web/updates/2020/07/referrer-policy-new-chrome-default")
public void crossDomainHistoryNavigationWithADirectProxy() {
Expand All @@ -224,7 +219,6 @@ public void crossDomainHistoryNavigationWithADirectProxy() {
* redirects the second domain to another host.
*/
@Test
@NeedsLocalEnvironment
@Ignore(value = CHROME, reason = "https://developers.google.com/web/updates/2020/07/referrer-policy-new-chrome-default")
@Ignore(value = FIREFOX, reason = "https://developers.google.com/web/updates/2020/07/referrer-policy-new-chrome-default")
public void crossDomainHistoryNavigationWithAProxiedHost() {
Expand Down Expand Up @@ -256,7 +250,6 @@ public void crossDomainHistoryNavigationWithAProxiedHost() {
* to connect directly to the target server.
*/
@Test
@NeedsLocalEnvironment
@Ignore(value = CHROME, reason = "https://developers.google.com/web/updates/2020/07/referrer-policy-new-chrome-default")
@Ignore(value = FIREFOX, reason = "https://developers.google.com/web/updates/2020/07/referrer-policy-new-chrome-default")
public void crossDomainHistoryNavigationWhenProxyInterceptsHostRequests() {
Expand Down Expand Up @@ -291,7 +284,6 @@ public void crossDomainHistoryNavigationWhenProxyInterceptsHostRequests() {
reason = "IEDriver does not disable automatic proxy caching, causing this test to fail, issue 6629")
@Ignore(FIREFOX)
@Ignore(value = LEGACY_FIREFOX_XPI, travis = true)
@NeedsLocalEnvironment
@Ignore(value = CHROME, reason = "Flaky")
public void navigationWhenProxyInterceptsASpecificUrl() {
// Have our proxy intercept requests for page 2.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,10 @@
import org.openqa.selenium.support.ui.WebDriverWait;
import org.openqa.selenium.testing.Ignore;
import org.openqa.selenium.testing.JUnit4TestBase;
import org.openqa.selenium.testing.NeedsLocalEnvironment;
import org.openqa.selenium.testing.NoDriverBeforeTest;

import java.time.Duration;

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import org.openqa.selenium.support.ui.WebDriverWait;
import org.openqa.selenium.build.InProject;
import org.openqa.selenium.testing.JUnit4TestBase;
import org.openqa.selenium.testing.NeedsLocalEnvironment;
import org.openqa.selenium.testing.TestUtilities;

import java.io.IOException;
Expand All @@ -49,7 +48,6 @@ public void tearDown() {
}
}

@NeedsLocalEnvironment
@Test
public void canStartChromeWithCustomOptions() {
ChromeOptions options = new ChromeOptions();
Expand All @@ -64,7 +62,6 @@ public void canStartChromeWithCustomOptions() {
assertThat(userAgent).isEqualTo("foo;bar");
}

@NeedsLocalEnvironment
@Test
public void optionsStayEqualAfterSerialization() {
ChromeOptions options1 = new ChromeOptions();
Expand All @@ -74,7 +71,6 @@ public void optionsStayEqualAfterSerialization() {
assertThat(options2).isEqualTo(options1);
}

@NeedsLocalEnvironment
@Test
public void canSetAcceptInsecureCerts() {
ChromeOptions options = new ChromeOptions();
Expand All @@ -87,7 +83,6 @@ public void canSetAcceptInsecureCerts() {
assertThat(driver.getCapabilities().getCapability(ACCEPT_INSECURE_CERTS)).isEqualTo(true);
}

@NeedsLocalEnvironment
@Test
public void canAddExtensionFromFile() {
ChromeOptions options = new ChromeOptions();
Expand All @@ -106,7 +101,6 @@ public void canAddExtensionFromFile() {
new WebDriverWait(driver, Duration.ofSeconds(10)).until(titleIs("clicks"));
}

@NeedsLocalEnvironment
@Test
public void canAddExtensionFromStringEncodedInBase64() throws IOException {
ChromeOptions options = new ChromeOptions();
Expand Down
2 changes: 0 additions & 2 deletions java/test/org/openqa/selenium/firefox/FirefoxDriverTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
import org.openqa.selenium.testing.Ignore;
import org.openqa.selenium.testing.JUnit4TestBase;
import org.openqa.selenium.testing.NeedsFreshDriver;
import org.openqa.selenium.testing.NeedsLocalEnvironment;
import org.openqa.selenium.testing.NoDriverAfterTest;
import org.openqa.selenium.testing.NotYetImplemented;
import org.openqa.selenium.testing.drivers.WebDriverBuilder;
Expand Down Expand Up @@ -75,7 +74,6 @@
import static org.openqa.selenium.support.ui.ExpectedConditions.titleIs;
import static org.openqa.selenium.testing.drivers.Browser.FIREFOX;

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

private FirefoxDriver localDriver;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.testing.JUnit4TestBase;
import org.openqa.selenium.testing.NeedsLocalEnvironment;
import org.openqa.selenium.testing.NoDriverAfterTest;
import org.openqa.selenium.testing.NoDriverBeforeTest;
import org.openqa.selenium.testing.drivers.WebDriverBuilder;
Expand All @@ -35,7 +34,6 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.openqa.selenium.ie.InternetExplorerDriver.ENABLE_PERSISTENT_HOVERING;

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

@Test
Expand Down Expand Up @@ -65,7 +63,6 @@ public void canStartMultipleIeDriverInstances() {

@NoDriverBeforeTest
@NoDriverAfterTest
@NeedsLocalEnvironment
@Test
public void testPersistentHoverCanBeTurnedOff() throws Exception {
createNewDriver(new ImmutableCapabilities(ENABLE_PERSISTENT_HOVERING, false));
Expand Down
2 changes: 0 additions & 2 deletions java/test/org/openqa/selenium/logging/GetLogsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.testing.Ignore;
import org.openqa.selenium.testing.JUnit4TestBase;
import org.openqa.selenium.testing.NeedsLocalEnvironment;
import org.openqa.selenium.testing.drivers.WebDriverBuilder;

import java.util.HashMap;
Expand Down Expand Up @@ -116,7 +115,6 @@ private static boolean hasOverlappingLogEntries(LogEntries firstLog, LogEntries
}

@Test
@NeedsLocalEnvironment
public void turningOffLogShouldMeanNoLogMessages() {
Set<String> logTypes = driver.manage().logs().getAvailableLogTypes();
for (String logType : logTypes) {
Expand Down
Loading

0 comments on commit fa37d18

Please sign in to comment.