From 52bf3a17814231672b0a4fc4a17eeb682cb6b451 Mon Sep 17 00:00:00 2001 From: Alexei Barantsev Date: Wed, 29 Apr 2020 20:56:39 +0300 Subject: [PATCH] [java] Deleting test guards for ancient drivers. --- .../selenium/corebased/TestBasicAuth.java | 8 ------ .../selenium/CorrectEventFiringTest.java | 6 ----- .../openqa/selenium/ElementAttributeTest.java | 6 ----- .../openqa/selenium/ElementFindingTest.java | 14 ---------- .../org/openqa/selenium/FormHandlingTest.java | 9 ------- .../openqa/selenium/PositionAndSizeTest.java | 3 --- .../org/openqa/selenium/SvgDocumentTest.java | 9 ------- .../org/openqa/selenium/SvgElementTest.java | 5 ---- .../org/openqa/selenium/TextHandlingTest.java | 4 --- .../test/org/openqa/selenium/TypingTest.java | 3 --- .../openqa/selenium/WindowSwitchingTest.java | 6 ++--- .../selenium/logging/AvailableLogsTest.java | 7 ----- .../openqa/selenium/logging/GetLogsTest.java | 6 ----- .../logging/PerformanceLogTypeTest.java | 6 ----- .../selenium/testing/TestUtilities.java | 27 ------------------- 15 files changed, 2 insertions(+), 117 deletions(-) diff --git a/java/client/test/com/thoughtworks/selenium/corebased/TestBasicAuth.java b/java/client/test/com/thoughtworks/selenium/corebased/TestBasicAuth.java index eb5275f803283..7bc2366efdf2f 100644 --- a/java/client/test/com/thoughtworks/selenium/corebased/TestBasicAuth.java +++ b/java/client/test/com/thoughtworks/selenium/corebased/TestBasicAuth.java @@ -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; @@ -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"); } diff --git a/java/client/test/org/openqa/selenium/CorrectEventFiringTest.java b/java/client/test/org/openqa/selenium/CorrectEventFiringTest.java index 9a2b3bbb205c3..f6196c50d3790 100644 --- a/java/client/test/org/openqa/selenium/CorrectEventFiringTest.java +++ b/java/client/test/org/openqa/selenium/CorrectEventFiringTest.java @@ -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; @@ -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")); @@ -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 @@ -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)); @@ -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()) @@ -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()) diff --git a/java/client/test/org/openqa/selenium/ElementAttributeTest.java b/java/client/test/org/openqa/selenium/ElementAttributeTest.java index 366e75eae190d..0e338edf803f9 100644 --- a/java/client/test/org/openqa/selenium/ElementAttributeTest.java +++ b/java/client/test/org/openqa/selenium/ElementAttributeTest.java @@ -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; @@ -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"); @@ -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")); @@ -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)"); diff --git a/java/client/test/org/openqa/selenium/ElementFindingTest.java b/java/client/test/org/openqa/selenium/ElementFindingTest.java index f5b60f09b544f..9a180b19ec96d 100644 --- a/java/client/test/org/openqa/selenium/ElementFindingTest.java +++ b/java/client/test/org/openqa/selenium/ElementFindingTest.java @@ -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; @@ -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"))); @@ -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) @@ -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)"))); @@ -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) @@ -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']"))); @@ -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)); diff --git a/java/client/test/org/openqa/selenium/FormHandlingTest.java b/java/client/test/org/openqa/selenium/FormHandlingTest.java index 8ddcee6dfd5d5..e5bcdb9830e80 100644 --- a/java/client/test/org/openqa/selenium/FormHandlingTest.java +++ b/java/client/test/org/openqa/selenium/FormHandlingTest.java @@ -19,7 +19,6 @@ 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; @@ -27,15 +26,12 @@ 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; @@ -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(""); @@ -283,7 +275,6 @@ public void testCanClickOnASubmitButtonNestedSpan() { @Test public void testCanClickOnAnImplicitSubmitButton() { - assumeFalse(isIe6(driver) || isIe7(driver) ); checkSubmitButton("internal_implicit_submit"); } diff --git a/java/client/test/org/openqa/selenium/PositionAndSizeTest.java b/java/client/test/org/openqa/selenium/PositionAndSizeTest.java index 959f02d30b392..a4a603bc8675c 100644 --- a/java/client/test/org/openqa/selenium/PositionAndSizeTest.java +++ b/java/client/test/org/openqa/selenium/PositionAndSizeTest.java @@ -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; @@ -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") @@ -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); diff --git a/java/client/test/org/openqa/selenium/SvgDocumentTest.java b/java/client/test/org/openqa/selenium/SvgDocumentTest.java index de4a177401ce7..0160e8114611f 100644 --- a/java/client/test/org/openqa/selenium/SvgDocumentTest.java +++ b/java/client/test/org/openqa/selenium/SvgDocumentTest.java @@ -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; @@ -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")); @@ -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")); diff --git a/java/client/test/org/openqa/selenium/SvgElementTest.java b/java/client/test/org/openqa/selenium/SvgElementTest.java index 438818488f186..f2b824cd3d818 100644 --- a/java/client/test/org/openqa/selenium/SvgElementTest.java +++ b/java/client/test/org/openqa/selenium/SvgElementTest.java @@ -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; @@ -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")); @@ -73,8 +70,6 @@ private static WebElement findAppleElement(List 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 textElements = svg.findElements(By.cssSelector("text")); diff --git a/java/client/test/org/openqa/selenium/TextHandlingTest.java b/java/client/test/org/openqa/selenium/TextHandlingTest.java index 35c3fbfe3bf79..d59d66f954545 100644 --- a/java/client/test/org/openqa/selenium/TextHandlingTest.java +++ b/java/client/test/org/openqa/selenium/TextHandlingTest.java @@ -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; @@ -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 { @@ -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(); diff --git a/java/client/test/org/openqa/selenium/TypingTest.java b/java/client/test/org/openqa/selenium/TypingTest.java index 220c62ce4f85e..18269dc07e35d 100644 --- a/java/client/test/org/openqa/selenium/TypingTest.java +++ b/java/client/test/org/openqa/selenium/TypingTest.java @@ -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; @@ -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")); diff --git a/java/client/test/org/openqa/selenium/WindowSwitchingTest.java b/java/client/test/org/openqa/selenium/WindowSwitchingTest.java index f592a3066c232..8e6c778284fe3 100644 --- a/java/client/test/org/openqa/selenium/WindowSwitchingTest.java +++ b/java/client/test/org/openqa/selenium/WindowSwitchingTest.java @@ -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; @@ -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(); } @@ -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); @@ -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(); } diff --git a/java/client/test/org/openqa/selenium/logging/AvailableLogsTest.java b/java/client/test/org/openqa/selenium/logging/AvailableLogsTest.java index 43307e5cff7f2..93e8d8729fd3c 100644 --- a/java/client/test/org/openqa/selenium/logging/AvailableLogsTest.java +++ b/java/client/test/org/openqa/selenium/logging/AvailableLogsTest.java @@ -20,8 +20,6 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assume.assumeTrue; import static org.openqa.selenium.remote.CapabilityType.ENABLE_PROFILING_CAPABILITY; -import static org.openqa.selenium.testing.TestUtilities.getChromeVersion; -import static org.openqa.selenium.testing.TestUtilities.isChrome; import static org.openqa.selenium.testing.drivers.Browser.EDGE; import static org.openqa.selenium.testing.drivers.Browser.HTMLUNIT; import static org.openqa.selenium.testing.drivers.Browser.IE; @@ -58,7 +56,6 @@ public void quitDriver() { @Test public void browserLogShouldBeEnabledByDefault() { - assumeTrue(!isChrome(driver) || getChromeVersion(driver) > 20); Set logTypes = driver.manage().logs().getAvailableLogTypes(); assertThat(logTypes.contains(LogType.BROWSER)) .describedAs("Browser logs should be enabled by default").isTrue(); @@ -66,7 +63,6 @@ public void browserLogShouldBeEnabledByDefault() { @Test public void clientLogShouldBeEnabledByDefault() { - assumeTrue(!isChrome(driver) || getChromeVersion(driver) > 20); // Do one action to have *something* in the client logs. driver.get(pages.formPage); Set logTypes = driver.manage().logs().getAvailableLogTypes(); @@ -85,7 +81,6 @@ public void clientLogShouldBeEnabledByDefault() { @Test public void driverLogShouldBeEnabledByDefault() { - assumeTrue(!isChrome(driver) || getChromeVersion(driver) > 20); Set logTypes = driver.manage().logs().getAvailableLogTypes(); assertThat(logTypes.contains(LogType.DRIVER)) .describedAs("Remote driver logs should be enabled by default").isTrue(); @@ -93,7 +88,6 @@ public void driverLogShouldBeEnabledByDefault() { @Test public void profilerLogShouldBeDisabledByDefault() { - assumeTrue(!isChrome(driver) || getChromeVersion(driver) > 20); Set logTypes = driver.manage().logs().getAvailableLogTypes(); assertThat(logTypes.contains(LogType.PROFILER)) .describedAs("Profiler logs should not be enabled by default").isFalse(); @@ -102,7 +96,6 @@ public void profilerLogShouldBeDisabledByDefault() { @Test @Ignore(value = SAFARI, reason = "Safari does not support profiler logs") public void shouldBeAbleToEnableProfilerLog() { - assumeTrue(!isChrome(driver) || getChromeVersion(driver) > 20); Capabilities caps = new ImmutableCapabilities(ENABLE_PROFILING_CAPABILITY, true); localDriver = new WebDriverBuilder().get(caps); Set logTypes = localDriver.manage().logs().getAvailableLogTypes(); diff --git a/java/client/test/org/openqa/selenium/logging/GetLogsTest.java b/java/client/test/org/openqa/selenium/logging/GetLogsTest.java index 2ffdba03979ef..9831066c474e5 100644 --- a/java/client/test/org/openqa/selenium/logging/GetLogsTest.java +++ b/java/client/test/org/openqa/selenium/logging/GetLogsTest.java @@ -18,9 +18,6 @@ package org.openqa.selenium.logging; import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assume.assumeTrue; -import static org.openqa.selenium.testing.TestUtilities.getChromeVersion; -import static org.openqa.selenium.testing.TestUtilities.isChrome; import static org.openqa.selenium.testing.drivers.Browser.EDGE; import static org.openqa.selenium.testing.drivers.Browser.HTMLUNIT; import static org.openqa.selenium.testing.drivers.Browser.IE; @@ -63,7 +60,6 @@ public void quitDriver() { @Test public void logBufferShouldBeResetAfterEachGetLogCall() { - assumeTrue(!isChrome(driver) || getChromeVersion(driver) > 20); driver.get(pages.errorsPage); driver.findElement(By.cssSelector("input")).click(); @@ -81,7 +77,6 @@ public void logBufferShouldBeResetAfterEachGetLogCall() { @Test public void differentLogsShouldNotContainTheSameLogEntries() { - assumeTrue(!isChrome(driver) || getChromeVersion(driver) > 20); driver.get(pages.errorsPage); driver.findElement(By.cssSelector("input")).click(); @@ -124,7 +119,6 @@ private static boolean hasOverlappingLogEntries(LogEntries firstLog, LogEntries @Test @NeedsLocalEnvironment public void turningOffLogShouldMeanNoLogMessages() { - assumeTrue(!isChrome(driver) || getChromeVersion(driver) > 20); Set logTypes = driver.manage().logs().getAvailableLogTypes(); for (String logType : logTypes) { createWebDriverWithLogging(logType, Level.OFF); diff --git a/java/client/test/org/openqa/selenium/logging/PerformanceLogTypeTest.java b/java/client/test/org/openqa/selenium/logging/PerformanceLogTypeTest.java index dad906c517e18..71d3f20865e21 100644 --- a/java/client/test/org/openqa/selenium/logging/PerformanceLogTypeTest.java +++ b/java/client/test/org/openqa/selenium/logging/PerformanceLogTypeTest.java @@ -18,15 +18,12 @@ package org.openqa.selenium.logging; import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assume.assumeTrue; -import static org.openqa.selenium.testing.TestUtilities.getChromeVersion; import static org.openqa.selenium.testing.drivers.Browser.EDGE; import static org.openqa.selenium.testing.drivers.Browser.FIREFOX; import static org.openqa.selenium.testing.drivers.Browser.HTMLUNIT; 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.isChrome; import org.junit.After; import org.junit.Test; @@ -61,7 +58,6 @@ public void quitDriver() { @Test public void performanceLogShouldBeDisabledByDefault() { - assumeTrue(!isChrome(driver) || getChromeVersion(driver) > 20); Set logTypes = driver.manage().logs().getAvailableLogTypes(); assertThat(logTypes.contains(LogType.PERFORMANCE)) .describedAs("Performance log should not be enabled by default").isFalse(); @@ -76,7 +72,6 @@ void createLocalDriverWithPerformanceLogType() { @Test public void shouldBeAbleToEnablePerformanceLog() { - assumeTrue(!isChrome(driver) || getChromeVersion(driver) > 20); createLocalDriverWithPerformanceLogType(); Set logTypes = localDriver.manage().logs().getAvailableLogTypes(); assertThat(logTypes.contains(LogType.PERFORMANCE)) @@ -85,7 +80,6 @@ public void shouldBeAbleToEnablePerformanceLog() { @Test public void pageLoadShouldProducePerformanceLogEntries() { - assumeTrue(!isChrome(driver) || getChromeVersion(driver) > 20); createLocalDriverWithPerformanceLogType(); localDriver.get(pages.simpleTestPage); LogEntries entries = localDriver.manage().logs().get(LogType.PERFORMANCE); diff --git a/java/client/test/org/openqa/selenium/testing/TestUtilities.java b/java/client/test/org/openqa/selenium/testing/TestUtilities.java index 7f317f208b625..e9a006b1c5172 100644 --- a/java/client/test/org/openqa/selenium/testing/TestUtilities.java +++ b/java/client/test/org/openqa/selenium/testing/TestUtilities.java @@ -63,33 +63,6 @@ public static boolean isInternetExplorer(WebDriver driver) { return userAgent.contains("MSIE") || userAgent.contains("Trident"); } - public static boolean isIe6(WebDriver driver) { - return isInternetExplorer(driver) - && getUserAgent(driver).contains("MSIE 6"); - } - - public static boolean isIe7(WebDriver driver) { - return isInternetExplorer(driver) - && getUserAgent(driver).contains("MSIE 7"); - } - - public static boolean isOldIe(WebDriver driver) { - if (!isInternetExplorer(driver)) { - return false; - } - if (driver instanceof HtmlUnitDriver) { - String applicationVersion = ((HtmlUnitDriver) driver).getBrowserVersion().getApplicationVersion(); - return Double.parseDouble(applicationVersion.split(" ")[0]) < 5; - } - try { - String jsToExecute = "return parseInt(window.navigator.appVersion.split(' ')[0]);"; - // IE9 is trident version 5. IE9 is the start of new IE. - return ((Long)((JavascriptExecutor)driver).executeScript(jsToExecute)).intValue() < 5; - } catch (Throwable t) { - return false; - } - } - public static boolean isChrome(WebDriver driver) { return !(driver instanceof HtmlUnitDriver) && getUserAgent(driver).contains("Chrome"); }