Skip to content

Commit

Permalink
[java] Don't restart browser without strong need
Browse files Browse the repository at this point in the history
  • Loading branch information
barancev committed Sep 27, 2018
1 parent 657e5ae commit eb1d743
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 24 deletions.
1 change: 0 additions & 1 deletion java/client/test/org/openqa/selenium/AlertsTest.java
Expand Up @@ -77,7 +77,6 @@ private String promptPage(String defaultText) {
"<div id='text'>acceptor</div>"));
}

@NoDriverAfterTest
@Test
public void testShouldBeAbleToOverrideTheWindowAlertMethod() {
driver.get(alertPage("cheese"));
Expand Down
2 changes: 1 addition & 1 deletion java/client/test/org/openqa/selenium/ClickTest.java
Expand Up @@ -148,7 +148,7 @@ public void testShouldClickOnFirstBoundingClientRectWithNonZeroSize() {
wait.until(titleIs("XHTML Test Page"));
}

@NoDriverAfterTest
@NoDriverAfterTest(failedOnly = true)
@Test
public void testShouldOnlyFollowHrefOnce() {
driver.get(pages.clicksPage);
Expand Down
Expand Up @@ -39,7 +39,6 @@
import org.openqa.selenium.testing.InProject;
import org.openqa.selenium.testing.JUnit4TestBase;
import org.openqa.selenium.testing.NeedsFreshDriver;
import org.openqa.selenium.testing.NoDriverAfterTest;
import org.openqa.selenium.testing.NotYetImplemented;

import java.io.IOException;
Expand Down Expand Up @@ -421,7 +420,6 @@ public void testShouldBeAbleToExecuteScriptAndReturnElementsList() {
}

@NeedsFreshDriver
@NoDriverAfterTest
@Test
@NotYetImplemented(value = HTMLUNIT,
reason = "HtmlUnit: can't execute JavaScript before a page is loaded")
Expand Down
2 changes: 0 additions & 2 deletions java/client/test/org/openqa/selenium/FrameSwitchingTest.java
Expand Up @@ -35,7 +35,6 @@
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.NotYetImplemented;

import java.util.Random;
Expand Down Expand Up @@ -510,7 +509,6 @@ public void testShouldNotSwitchMagicallyToTheTopWindow() {
}
}

@NoDriverAfterTest // Subsequent tests sometimes fail on Firefox.
@Test
public void testGetShouldSwitchToDefaultContext() {
driver.get(pages.iframePage);
Expand Down
4 changes: 0 additions & 4 deletions java/client/test/org/openqa/selenium/I18nTest.java
Expand Up @@ -25,13 +25,11 @@
import static org.openqa.selenium.testing.Driver.HTMLUNIT;
import static org.openqa.selenium.testing.Driver.IE;
import static org.openqa.selenium.testing.Driver.MARIONETTE;
import static org.openqa.selenium.testing.Driver.SAFARI;

import org.junit.Test;
import org.openqa.selenium.environment.GlobalTestEnvironment;
import org.openqa.selenium.testing.Ignore;
import org.openqa.selenium.testing.JUnit4TestBase;
import org.openqa.selenium.testing.NeedsFreshDriver;
import org.openqa.selenium.testing.NotYetImplemented;
import org.openqa.selenium.testing.TestUtilities;

Expand Down Expand Up @@ -103,7 +101,6 @@ public void testEnteringSupplementaryCharacters() {
assertThat(el.getAttribute("value")).isEqualTo(input);
}

@NeedsFreshDriver
@Test
public void testShouldBeAbleToReturnTheTextInAPage() {
String url = GlobalTestEnvironment.get()
Expand All @@ -116,7 +113,6 @@ public void testShouldBeAbleToReturnTheTextInAPage() {
assertThat(text).isEqualTo(shalom);
}

@NeedsFreshDriver
@Test
@Ignore(IE)
@Ignore(CHROME)
Expand Down
Expand Up @@ -30,7 +30,6 @@
import org.openqa.selenium.interactions.Locatable;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.testing.JUnit4TestBase;
import org.openqa.selenium.testing.NeedsFreshDriver;
import org.openqa.selenium.testing.NoDriverAfterTest;
import org.openqa.selenium.testing.NotYetImplemented;

Expand Down Expand Up @@ -210,7 +209,6 @@ public void testShouldBeAbleToGetTheLocationOfAnElement() {
* running: "ImplicitWaitTest", "TemporaryFilesystemTest", "JavascriptEnabledDriverTest".
* SimonStewart 2010-10-04
*/
@NeedsFreshDriver
@NoDriverAfterTest
@Test
@NotYetImplemented(SAFARI)
Expand Down
9 changes: 0 additions & 9 deletions java/client/test/org/openqa/selenium/PageLoadingTest.java
Expand Up @@ -202,7 +202,6 @@ public void testShouldReturnWhenGettingAUrlThatDoesNotResolve() {
}

@Test
@NeedsFreshDriver
public void testShouldThrowIfUrlIsMalformed() {
assumeFalse("Fails in Sauce Cloud", shouldUseSauce());
assertThatExceptionOfType(WebDriverException.class)
Expand All @@ -211,7 +210,6 @@ public void testShouldThrowIfUrlIsMalformed() {

@Test
@NotYetImplemented(value = SAFARI)
@NeedsFreshDriver
public void testShouldThrowIfUrlIsMalformedInPortPart() {
assumeFalse("Fails in Sauce Cloud", shouldUseSauce());
assertThatExceptionOfType(WebDriverException.class)
Expand Down Expand Up @@ -247,7 +245,6 @@ public void testShouldBeAbleToLoadAPageWithFramesetsAndWaitUntilAllFramesAreLoad
}

@NeedsFreshDriver
@NoDriverAfterTest
@Test
@NotYetImplemented(value = HTMLUNIT,
reason = "HtmlUnit: can't execute JavaScript before a page is loaded")
Expand Down Expand Up @@ -343,7 +340,6 @@ public void testShouldNotHangIfDocumentOpenCallIsNeverFollowedByDocumentCloseCal

// Note: If this test ever fixed/enabled on Firefox, check if it also needs @NoDriverAfterTest OR
// if @NoDriverAfterTest can be removed from some other tests in this class.
@NoDriverAfterTest
@Test
@Ignore(FIREFOX)
@NotYetImplemented(SAFARI)
Expand All @@ -353,7 +349,6 @@ public void testPageLoadTimeoutCanBeChanged() {
testPageLoadTimeoutIsEnforced(3);
}

@NoDriverAfterTest
@Test
@Ignore(FIREFOX)
@NotYetImplemented(SAFARI)
Expand All @@ -366,7 +361,6 @@ public void testCanHandleSequentialPageLoadTimeouts() {
assertPageLoadTimeoutIsEnforced(pageLoadTimeout, pageLoadTimeBuffer);
}

@NoDriverAfterTest // Subsequent tests sometimes fail on Firefox.
@Test
@NeedsLocalEnvironment
public void testShouldTimeoutIfAPageTakesTooLongToLoad() {
Expand All @@ -381,7 +375,6 @@ public void testShouldTimeoutIfAPageTakesTooLongToLoad() {
wait.until(titleIs("XHTML Test Page"));
}

@NoDriverAfterTest // Subsequent tests sometimes fail on Firefox.
@Test
@NotYetImplemented(value = SAFARI)
@Ignore(value = FIREFOX, travis = true)
Expand Down Expand Up @@ -414,7 +407,6 @@ public void testShouldTimeoutIfAPageTakesTooLongToLoadAfterClick() {
wait.until(titleIs("XHTML Test Page"));
}

@NoDriverAfterTest // Subsequent tests sometimes fail on Firefox.
@Test
@NeedsLocalEnvironment
public void testShouldTimeoutIfAPageTakesTooLongToRefresh() {
Expand Down Expand Up @@ -446,7 +438,6 @@ public void testShouldTimeoutIfAPageTakesTooLongToRefresh() {
wait.until(titleIs("XHTML Test Page"));
}

@NoDriverAfterTest // Subsequent tests sometimes fail on Firefox.
@Test
@Ignore(CHROME)
@NotYetImplemented(value = SAFARI)
Expand Down
Expand Up @@ -66,7 +66,6 @@ public void callingAnyOperationAfterQuitShouldThrowAnException() {
assertThatExceptionOfType(NoSuchSessionException.class).isThrownBy(driver::getCurrentUrl);
}

@NoDriverAfterTest
@Test
public void shouldContinueAfterSleep() {
sleepTight(10000);
Expand Down
Expand Up @@ -37,7 +37,6 @@
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.testing.Ignore;
import org.openqa.selenium.testing.JUnit4TestBase;
import org.openqa.selenium.testing.NeedsFreshDriver;
import org.openqa.selenium.testing.NoDriverAfterTest;
import org.openqa.selenium.testing.NotYetImplemented;
import org.openqa.selenium.testing.SwitchToTopAfterTest;
Expand Down Expand Up @@ -108,7 +107,6 @@ public void testDragAndDropElementWithOffsetInIframeAtBottom() {
assertThat(img1.getLocation()).isEqualTo(initial.moveBy(20, 20));
}

@NeedsFreshDriver // fails in Sauce if run in a dirty state; to be investigated
@Test
@Ignore(value = IE, reason = "IE fails this test if requireWindowFocus=true")
@Ignore(MARIONETTE)
Expand Down

0 comments on commit eb1d743

Please sign in to comment.