Skip to content

Commit

Permalink
[java] Deleting test guards for ancient drivers.
Browse files Browse the repository at this point in the history
  • Loading branch information
barancev committed May 1, 2020
1 parent 7a375e1 commit 52bf3a1
Show file tree
Hide file tree
Showing 15 changed files with 2 additions and 117 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,12 @@

package com.thoughtworks.selenium.corebased;

import static org.junit.Assume.assumeFalse;

import com.thoughtworks.selenium.InternalSelenseTestBase;

import org.junit.Ignore;
import org.junit.Test;
import org.openqa.selenium.WrapsDriver;
import org.openqa.selenium.environment.GlobalTestEnvironment;
import org.openqa.selenium.environment.webserver.AppServer;
import org.openqa.selenium.testing.TestUtilities;

import java.net.MalformedURLException;
import java.net.URL;
Expand All @@ -35,10 +31,6 @@
public class TestBasicAuth extends InternalSelenseTestBase {
@Test
public void testBasicAuth() throws Exception {
assumeFalse(
"Geckodriver does not support basic auth without user interaction.",
selenium instanceof WrapsDriver &&
TestUtilities.isFirefox(((WrapsDriver) selenium).getWrappedDriver()));
selenium.open(getUrl());
assertEquals(selenium.getTitle(), "Welcome");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import static org.openqa.selenium.testing.drivers.Browser.IE;
import static org.openqa.selenium.testing.drivers.Browser.MARIONETTE;
import static org.openqa.selenium.testing.drivers.Browser.SAFARI;
import static org.openqa.selenium.testing.TestUtilities.isOldIe;

import org.junit.Test;
import org.openqa.selenium.interactions.Actions;
Expand Down Expand Up @@ -390,7 +389,6 @@ public void testSendingKeysToAFocusedElementShouldNotBlurThatElement() {
@NotYetImplemented(IE)
@NotYetImplemented(SAFARI)
public void testClickingAnUnfocusableChildShouldNotBlurTheParent() {
assumeFalse(isOldIe(driver));
driver.get(pages.javascriptPage);
// Click on parent, giving it the focus.
WebElement parent = driver.findElement(By.id("hideOnBlur"));
Expand Down Expand Up @@ -476,7 +474,6 @@ public void testClickEventsShouldBubble() {
@Test
@Ignore(HTMLUNIT)
public void testClickOverlappingElements() {
assumeFalse(isOldIe(driver));
driver.get(appServer.whereIs("click_tests/overlapping_elements.html"));
WebElement element = driver.findElement(By.id("under"));
// TODO: change to ElementClickInterceptedException
Expand All @@ -493,7 +490,6 @@ public void testClickOverlappingElements() {
@Ignore(HTMLUNIT)
@NotYetImplemented(EDGE)
public void testClickPartiallyOverlappingElements() {
assumeFalse(isOldIe(driver));
for (int i = 1; i < 6; i++) {
driver.get(appServer.whereIs("click_tests/partially_overlapping_elements.html"));
WebElement over = driver.findElement(By.id("over" + i));
Expand All @@ -520,7 +516,6 @@ public void testClickPartiallyOverlappingElements() {
@Ignore(value = IE, reason = "Checks overlapping by default")
@Ignore(EDGE)
public void testNativelyClickOverlappingElements() {
assumeFalse(isOldIe(driver));
driver.get(appServer.whereIs("click_tests/overlapping_elements.html"));
driver.findElement(By.id("under")).click();
assertThat(driver.findElement(By.id("log")).getText())
Expand All @@ -537,7 +532,6 @@ public void testNativelyClickOverlappingElements() {
@Ignore(HTMLUNIT)
@NotYetImplemented(SAFARI)
public void testClickAnElementThatDisappear() {
assumeFalse(isOldIe(driver));
driver.get(appServer.whereIs("click_tests/disappearing_element.html"));
driver.findElement(By.id("over")).click();
assertThat(driver.findElement(By.id("log")).getText())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import org.openqa.selenium.testing.Ignore;
import org.openqa.selenium.testing.JUnit4TestBase;
import org.openqa.selenium.testing.NotYetImplemented;
import org.openqa.selenium.testing.TestUtilities;

import java.util.List;

Expand Down Expand Up @@ -218,7 +217,6 @@ public void testShouldReturnTheContentsOfATextAreaAsItsValue() {

@Test
public void testShouldReturnInnerHtml() {
assumeFalse("IE before 10 returns innerHTML with uppercase tag names", TestUtilities.getIEVersion(driver) < 10);
driver.get(pages.simpleTestPage);

String html = driver.findElement(By.id("wrappingtext")).getAttribute("innerHTML");
Expand All @@ -242,8 +240,6 @@ public void testShouldTreatReadonlyAsAValue() {

@Test
public void testShouldReturnHiddenTextForTextContentAttribute() {
assumeFalse("IE before 9 doesn't handle textContent attribute; IE9 loads page in quirks mode, so no textContent attribute", TestUtilities.getIEVersion(driver) < 10);

driver.get(pages.simpleTestPage);

WebElement element = driver.findElement(By.id("hiddenline"));
Expand Down Expand Up @@ -308,8 +304,6 @@ public void testShouldReturnValueOfOnClickAttribute() {

@Test
public void testGetAttributeDoesNotReturnAnObjectForSvgProperties() {
assumeFalse("IE before 9 doesn't support SVG", TestUtilities.isOldIe(driver));

driver.get(pages.svgPage);
WebElement svgElement = driver.findElement(By.id("rotate"));
assertThat(svgElement.getAttribute("transform")).isEqualTo("rotate(30)");
Expand Down
14 changes: 0 additions & 14 deletions java/client/test/org/openqa/selenium/ElementFindingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
import static org.openqa.selenium.testing.drivers.Browser.IE;
import static org.openqa.selenium.testing.drivers.Browser.MARIONETTE;
import static org.openqa.selenium.testing.drivers.Browser.SAFARI;
import static org.openqa.selenium.testing.TestUtilities.isIe6;
import static org.openqa.selenium.testing.TestUtilities.isOldIe;

import org.junit.Test;
import org.openqa.selenium.testing.Ignore;
Expand Down Expand Up @@ -470,8 +468,6 @@ public void testShouldThrowInvalidSelectorExceptionWhenXPathIsSyntacticallyInval

@Test
public void testShouldThrowInvalidSelectorExceptionWhenXPathIsSyntacticallyInvalidInDriverFindElements() {
assumeFalse("Ignoring xpath error test in IE6", isIe6(driver));

driver.get(pages.formPage);
assertThatExceptionOfType(InvalidSelectorException.class)
.isThrownBy(() -> driver.findElements(By.xpath("this][isnot][valid")));
Expand All @@ -487,8 +483,6 @@ public void testShouldThrowInvalidSelectorExceptionWhenXPathIsSyntacticallyInval

@Test
public void testShouldThrowInvalidSelectorExceptionWhenXPathIsSyntacticallyInvalidInElementFindElements() {
assumeFalse("Ignoring xpath error test in IE6", isIe6(driver));

driver.get(pages.formPage);
WebElement body = driver.findElement(By.tagName("body"));
assertThatExceptionOfType(InvalidSelectorException.class)
Expand All @@ -504,8 +498,6 @@ public void testShouldThrowInvalidSelectorExceptionWhenXPathReturnsWrongTypeInDr

@Test
public void testShouldThrowInvalidSelectorExceptionWhenXPathReturnsWrongTypeInDriverFindElements() {
assumeFalse("Ignoring xpath error test in IE6", isIe6(driver));

driver.get(pages.formPage);
assertThatExceptionOfType(InvalidSelectorException.class)
.isThrownBy(() -> driver.findElements(By.xpath("count(//input)")));
Expand All @@ -522,8 +514,6 @@ public void testShouldThrowInvalidSelectorExceptionWhenXPathReturnsWrongTypeInEl

@Test
public void testShouldThrowInvalidSelectorExceptionWhenXPathReturnsWrongTypeInElementFindElements() {
assumeFalse("Ignoring xpath error test in IE6", isIe6(driver));

driver.get(pages.formPage);
WebElement body = driver.findElement(By.tagName("body"));
assertThatExceptionOfType(InvalidSelectorException.class)
Expand Down Expand Up @@ -626,7 +616,6 @@ public void testFindingASingleElementByInvalidCssSelectorShouldThrow() {
@Test
@NotYetImplemented(EDGE)
public void testFindingMultipleElementsByInvalidCssSelectorShouldThrow() {
assumeFalse("Ignoring test for lack of error in CSS in IE6", isIe6(driver));
driver.get(pages.xhtmlTestPage);
assertThatExceptionOfType(NoSuchElementException.class)
.isThrownBy(() -> driver.findElements(By.cssSelector("//a/b/c[@id='1']")));
Expand Down Expand Up @@ -665,9 +654,6 @@ public void testShouldFindMultipleElementsByLinkTextContainingEqualsSign() {

@Test
public void findsByLinkTextOnXhtmlPage() {
assumeFalse("Old IE doesn't render XHTML pages, don't try loading XHTML pages in it",
isOldIe(driver));

driver.get(appServer.whereIs("actualXhtmlPage.xhtml"));
String linkText = "Foo";
WebElement element = driver.findElement(By.linkText(linkText));
Expand Down
9 changes: 0 additions & 9 deletions java/client/test/org/openqa/selenium/FormHandlingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,19 @@

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import static org.junit.Assume.assumeFalse;
import static org.openqa.selenium.support.ui.ExpectedConditions.alertIsPresent;
import static org.openqa.selenium.support.ui.ExpectedConditions.titleIs;
import static org.openqa.selenium.testing.drivers.Browser.CHROME;
import static org.openqa.selenium.testing.drivers.Browser.EDGE;
import static org.openqa.selenium.testing.drivers.Browser.IE;
import static org.openqa.selenium.testing.drivers.Browser.MARIONETTE;
import static org.openqa.selenium.testing.drivers.Browser.SAFARI;
import static org.openqa.selenium.testing.TestUtilities.isIe6;
import static org.openqa.selenium.testing.TestUtilities.isIe7;

import org.junit.Test;
import org.openqa.selenium.environment.webserver.Page;
import org.openqa.selenium.testing.Ignore;
import org.openqa.selenium.testing.JUnit4TestBase;
import org.openqa.selenium.testing.NotYetImplemented;
import org.openqa.selenium.testing.TestUtilities;

import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -174,10 +170,6 @@ public void testShouldBeAbleToAlterTheContentsOfAFileUploadInputElement() throws
@Test
public void testShouldBeAbleToSendKeysToAFileUploadInputElementInAnXhtmlDocument()
throws IOException {
assumeFalse("IE before 9 doesn't handle pages served with an XHTML content type,"
+ " and just prompts for to download it",
TestUtilities.isOldIe(driver));

driver.get(pages.xhtmlFormPage);
WebElement uploadElement = driver.findElement(By.id("file"));
assertThat(uploadElement.getAttribute("value")).isEqualTo("");
Expand Down Expand Up @@ -283,7 +275,6 @@ public void testCanClickOnASubmitButtonNestedSpan() {

@Test
public void testCanClickOnAnImplicitSubmitButton() {
assumeFalse(isIe6(driver) || isIe7(driver) );
checkSubmitButton("internal_implicit_submit");
}

Expand Down
3 changes: 0 additions & 3 deletions java/client/test/org/openqa/selenium/PositionAndSizeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package org.openqa.selenium;

import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assume.assumeFalse;
import static org.openqa.selenium.testing.drivers.Browser.CHROME;
import static org.openqa.selenium.testing.drivers.Browser.CHROMIUMEDGE;
import static org.openqa.selenium.testing.drivers.Browser.EDGE;
Expand All @@ -34,7 +33,6 @@
import org.openqa.selenium.testing.JUnit4TestBase;
import org.openqa.selenium.testing.NotYetImplemented;
import org.openqa.selenium.testing.SwitchToTopAfterTest;
import org.openqa.selenium.testing.TestUtilities;

@Ignore(value = HTMLUNIT,
reason = "Getting coordinates requires rendering, others: not tested")
Expand Down Expand Up @@ -144,7 +142,6 @@ public void testShouldGetCoordinatesInViewPortOfAnElementInANestedFrame() {
@Ignore(FIREFOX)
@NotYetImplemented(EDGE)
public void testShouldGetCoordinatesOfAnElementWithFixedPosition() {
assumeFalse("Ignoring fixed-position elements in IE6", TestUtilities.isIe6(driver));
driver.get(appServer.whereIs("coordinates_tests/page_with_fixed_element.html"));
assertThat(getLocationInViewPort(By.id("fixed")).getY()).isEqualTo(0);
assertThat(getLocationOnPage(By.id("fixed")).getY()).isEqualTo(0);
Expand Down
9 changes: 0 additions & 9 deletions java/client/test/org/openqa/selenium/SvgDocumentTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,8 @@
package org.openqa.selenium;

import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assume.assumeFalse;
import static org.openqa.selenium.testing.drivers.Browser.HTMLUNIT;
import static org.openqa.selenium.testing.drivers.Browser.SAFARI;
import static org.openqa.selenium.testing.TestUtilities.getFirefoxVersion;
import static org.openqa.selenium.testing.TestUtilities.isFirefox;
import static org.openqa.selenium.testing.TestUtilities.isOldIe;

import org.junit.Test;
import org.openqa.selenium.testing.Ignore;
Expand All @@ -36,9 +32,6 @@ public class SvgDocumentTest extends JUnit4TestBase {
@Ignore(value = HTMLUNIT, reason = "test should enable JavaScript")
@NotYetImplemented(SAFARI)
public void testClickOnSvgElement() {
assumeFalse("IE version < 9 doesn't support SVG", isOldIe(driver));
assumeFalse("Firefox < 21 fails this test", isFirefox(driver) && (getFirefoxVersion(driver) < 21));

driver.get(pages.svgTestPage);
WebElement rect = driver.findElement(By.id("rect"));

Expand All @@ -50,8 +43,6 @@ public void testClickOnSvgElement() {
@Test
@Ignore(value = HTMLUNIT, reason="test should enable JavaScript")
public void testExecuteScriptInSvgDocument() {
assumeFalse("IE version < 9 doesn't support SVG", isOldIe(driver));

driver.get(pages.svgTestPage);
WebElement rect = driver.findElement(By.id("rect"));

Expand Down
5 changes: 0 additions & 5 deletions java/client/test/org/openqa/selenium/SvgElementTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import static org.openqa.selenium.testing.drivers.Browser.HTMLUNIT;
import static org.openqa.selenium.testing.drivers.Browser.MARIONETTE;
import static org.openqa.selenium.testing.drivers.Browser.SAFARI;
import static org.openqa.selenium.testing.TestUtilities.isOldIe;

import org.junit.Test;
import org.openqa.selenium.testing.Ignore;
Expand All @@ -39,8 +38,6 @@ public class SvgElementTest extends JUnit4TestBase {
@NotYetImplemented(value = MARIONETTE, reason = "https://bugzilla.mozilla.org/show_bug.cgi?id=1415068")
@NotYetImplemented(SAFARI)
public void testShouldClickOnGraphVisualElements() {
assumeFalse("IE version < 9 doesn't support SVG", isOldIe(driver));

driver.get(pages.svgPage);
WebElement svg = driver.findElement(By.cssSelector("svg"));

Expand Down Expand Up @@ -73,8 +70,6 @@ private static WebElement findAppleElement(List<WebElement> textElements) {
@Test
@Ignore(value = HTMLUNIT, reason="test should enable JavaScript")
public void testShouldClickOnGraphTextElements() {
assumeFalse("IE version < 9 doesn't support SVG", isOldIe(driver));

driver.get(pages.svgPage);
WebElement svg = driver.findElement(By.cssSelector("svg"));
List<WebElement> textElements = svg.findElements(By.cssSelector("text"));
Expand Down
4 changes: 0 additions & 4 deletions java/client/test/org/openqa/selenium/TextHandlingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package org.openqa.selenium;

import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assume.assumeFalse;
import static org.openqa.selenium.testing.TestUtilities.isFirefox;
import static org.openqa.selenium.testing.drivers.Browser.ALL;
import static org.openqa.selenium.testing.drivers.Browser.EDGE;
Expand All @@ -31,7 +30,6 @@
import org.openqa.selenium.testing.Ignore;
import org.openqa.selenium.testing.JUnit4TestBase;
import org.openqa.selenium.testing.NotYetImplemented;
import org.openqa.selenium.testing.TestUtilities;

public class TextHandlingTest extends JUnit4TestBase {

Expand Down Expand Up @@ -233,8 +231,6 @@ public void testShouldReturnEmptyStringWhenTextIsEmpty() {

@Test
public void testShouldReturnEmptyStringWhenTagIsSelfClosing() {
assumeFalse("IE version < 9 doesn't support application/xhtml+xml mime type", TestUtilities.isOldIe(driver));

driver.get(pages.xhtmlFormPage);
String text = driver.findElement(By.id("self-closed")).getText();

Expand Down
3 changes: 0 additions & 3 deletions java/client/test/org/openqa/selenium/TypingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
import static org.openqa.selenium.testing.drivers.Browser.MARIONETTE;
import static org.openqa.selenium.testing.drivers.Browser.SAFARI;
import static org.openqa.selenium.testing.TestUtilities.getEffectivePlatform;
import static org.openqa.selenium.testing.TestUtilities.getFirefoxVersion;
import static org.openqa.selenium.testing.TestUtilities.isFirefox;

import org.junit.Test;
import org.openqa.selenium.support.ui.ExpectedConditions;
Expand Down Expand Up @@ -585,7 +583,6 @@ public void testShouldNotTypeIntoElementsThatPreventKeyDownEvents() {
@Test
@NotYetImplemented(value = SAFARI, reason = "getText does not normalize spaces")
public void testGenerateKeyPressEventEvenWhenElementPreventsDefault() {
assumeFalse(isFirefox(driver) && getFirefoxVersion(driver) < 25);
driver.get(pages.javascriptPage);

WebElement silent = driver.findElement(By.name("suppress"));
Expand Down
6 changes: 2 additions & 4 deletions java/client/test/org/openqa/selenium/WindowSwitchingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import static org.openqa.selenium.testing.drivers.Browser.OPERA;
import static org.openqa.selenium.testing.drivers.Browser.OPERABLINK;
import static org.openqa.selenium.testing.drivers.Browser.SAFARI;
import static org.openqa.selenium.testing.TestUtilities.isIe6;
import static org.openqa.selenium.testing.TestUtilities.isInternetExplorer;

import org.junit.Rule;
Expand Down Expand Up @@ -205,7 +204,7 @@ public void testClickingOnAButtonThatClosesAnOpenWindowDoesNotCauseTheBrowserToH

wait.until(ExpectedConditions.presenceOfElementLocated(By.id("close"))).click();

if (isInternetExplorer(driver) && !isIe6(driver)) {
if (isInternetExplorer(driver)) {
Alert alert = wait.until(alertIsPresent());
alert.accept();
}
Expand All @@ -219,7 +218,6 @@ public void testClickingOnAButtonThatClosesAnOpenWindowDoesNotCauseTheBrowserToH
public void testCanCallGetWindowHandlesAfterClosingAWindow() {
assumeFalse(Browser.detect() == Browser.OPERA &&
getEffectivePlatform(driver).is(Platform.WINDOWS));
boolean isNewIE = isInternetExplorer(driver) && !isIe6(driver);

driver.get(pages.xhtmlTestPage);

Expand All @@ -235,7 +233,7 @@ public void testCanCallGetWindowHandlesAfterClosingAWindow() {

wait.until(ExpectedConditions.presenceOfElementLocated(By.id("close"))).click();

if (isNewIE) {
if (isInternetExplorer(driver)) {
Alert alert = wait.until(alertIsPresent());
alert.accept();
}
Expand Down
Loading

0 comments on commit 52bf3a1

Please sign in to comment.