summaryrefslogtreecommitdiffstats
path: root/uitest-common
diff options
context:
space:
mode:
Diffstat (limited to 'uitest-common')
-rw-r--r--uitest-common/src/main/java/com/vaadin/tests/tb3/AbstractTB3Test.java25
-rw-r--r--uitest-common/src/main/java/com/vaadin/tests/tb3/BrowserStackBrowserFactory.java24
-rw-r--r--uitest-common/src/main/java/com/vaadin/tests/tb3/CustomTestBenchCommandExecutor.java20
-rw-r--r--uitest-common/src/main/java/com/vaadin/tests/tb3/MultiBrowserTest.java38
-rw-r--r--uitest-common/src/main/java/com/vaadin/tests/tb3/SauceLabsBrowserFactory.java18
-rw-r--r--uitest-common/src/main/java/com/vaadin/tests/tb3/ScreenshotTB3Test.java4
-rw-r--r--uitest-common/src/main/java/com/vaadin/tests/tb3/VaadinBrowserFactory.java6
7 files changed, 26 insertions, 109 deletions
diff --git a/uitest-common/src/main/java/com/vaadin/tests/tb3/AbstractTB3Test.java b/uitest-common/src/main/java/com/vaadin/tests/tb3/AbstractTB3Test.java
index 8d955baf1b..1c9982886d 100644
--- a/uitest-common/src/main/java/com/vaadin/tests/tb3/AbstractTB3Test.java
+++ b/uitest-common/src/main/java/com/vaadin/tests/tb3/AbstractTB3Test.java
@@ -149,11 +149,6 @@ public abstract class AbstractTB3Test extends ParallelTest {
int w = SCREENSHOT_WIDTH;
int h = SCREENSHOT_HEIGHT;
- if (BrowserUtil.isIE8(super.getDesiredCapabilities())) {
- // IE8 gets size wrong, who would have guessed...
- w += 4;
- h += 4;
- }
try {
testBench().resizeViewPortTo(w, h);
} catch (UnsupportedOperationException e) {
@@ -1206,13 +1201,8 @@ public abstract class AbstractTB3Test extends ParallelTest {
* issues: https://dev.vaadin.com/ticket/18469
*/
protected int getClientHeight(WebElement e) {
- String script;
- if (BrowserUtil.isIE8(getDesiredCapabilities())) {
- script = "return arguments[0].clientHeight;"; //
- } else {
- script = "var cs = window.getComputedStyle(arguments[0]);"
- + "return Math.ceil(parseFloat(cs.height)+parseFloat(cs.paddingTop)+parseFloat(cs.paddingBottom));";
- }
+ String script = "var cs = window.getComputedStyle(arguments[0]);"
+ + "return Math.ceil(parseFloat(cs.height)+parseFloat(cs.paddingTop)+parseFloat(cs.paddingBottom));";
return ((Number) executeScript(script, e)).intValue();
}
@@ -1221,14 +1211,9 @@ public abstract class AbstractTB3Test extends ParallelTest {
* issues: https://dev.vaadin.com/ticket/18469
*/
protected int getClientWidth(WebElement e) {
- String script;
- if (BrowserUtil.isIE8(getDesiredCapabilities())) {
- script = "return arguments[0].clientWidth;";
- } else {
- script = "var cs = window.getComputedStyle(arguments[0]);"
- + "var h = parseFloat(cs.width)+parseFloat(cs.paddingLeft)+parseFloat(cs.paddingRight);"
- + "return Math.ceil(h);";
- }
+ String script = "var cs = window.getComputedStyle(arguments[0]);"
+ + "var h = parseFloat(cs.width)+parseFloat(cs.paddingLeft)+parseFloat(cs.paddingRight);"
+ + "return Math.ceil(h);";
return ((Number) executeScript(script, e)).intValue();
}
diff --git a/uitest-common/src/main/java/com/vaadin/tests/tb3/BrowserStackBrowserFactory.java b/uitest-common/src/main/java/com/vaadin/tests/tb3/BrowserStackBrowserFactory.java
index 82fce49634..7ab0c33c8a 100644
--- a/uitest-common/src/main/java/com/vaadin/tests/tb3/BrowserStackBrowserFactory.java
+++ b/uitest-common/src/main/java/com/vaadin/tests/tb3/BrowserStackBrowserFactory.java
@@ -52,30 +52,6 @@ public class BrowserStackBrowserFactory extends DefaultBrowserFactory {
caps = DesiredCapabilities.safari();
caps.setVersion(version);
break;
- case IE8:
- caps = DesiredCapabilities.internetExplorer();
- caps.setVersion("8");
- caps.setCapability("browser", "IE");
- caps.setCapability("browser_version", "8.0");
- caps.setCapability(InternetExplorerDriver.IE_ENSURE_CLEAN_SESSION,
- true);
- break;
- case IE9:
- caps = DesiredCapabilities.internetExplorer();
- caps.setVersion("9");
- caps.setCapability("browser", "IE");
- caps.setCapability("browser_version", "9.0");
- caps.setCapability(InternetExplorerDriver.IE_ENSURE_CLEAN_SESSION,
- true);
- break;
- case IE10:
- caps = DesiredCapabilities.internetExplorer();
- caps.setVersion("10");
- caps.setCapability("browser", "IE");
- caps.setCapability("browser_version", "10.0");
- caps.setCapability(InternetExplorerDriver.IE_ENSURE_CLEAN_SESSION,
- true);
- break;
case IE11:
caps = DesiredCapabilities.internetExplorer();
caps.setVersion("11");
diff --git a/uitest-common/src/main/java/com/vaadin/tests/tb3/CustomTestBenchCommandExecutor.java b/uitest-common/src/main/java/com/vaadin/tests/tb3/CustomTestBenchCommandExecutor.java
index c2296e650d..ad5988d571 100644
--- a/uitest-common/src/main/java/com/vaadin/tests/tb3/CustomTestBenchCommandExecutor.java
+++ b/uitest-common/src/main/java/com/vaadin/tests/tb3/CustomTestBenchCommandExecutor.java
@@ -57,8 +57,8 @@ public class CustomTestBenchCommandExecutor {
*
* Copied from TestBenchCommandExecutor
*/
- public boolean compareScreen(WebElement element, File reference,
- boolean isIE8) throws IOException {
+ public boolean compareScreen(WebElement element, File reference)
+ throws IOException {
BufferedImage image = null;
try {
image = ImageIO.read(reference);
@@ -66,7 +66,7 @@ public class CustomTestBenchCommandExecutor {
// Don't worry, an error screen shot will be generated that later
// can be used as the reference
}
- return compareScreen(element, image, reference.getName(), isIE8);
+ return compareScreen(element, image, reference.getName());
}
/**
@@ -75,14 +75,13 @@ public class CustomTestBenchCommandExecutor {
* Copied from TestBenchCommandExecutor and added cropToElement
*/
public boolean compareScreen(WebElement element, BufferedImage reference,
- String referenceName, boolean isIE8) throws IOException {
+ String referenceName) throws IOException {
for (int times = 0; times < Parameters
.getMaxScreenshotRetries(); times++) {
BufferedImage screenshotImage = cropToElement(element,
ImageIO.read(new ByteArrayInputStream(
((TakesScreenshot) actualDriver)
- .getScreenshotAs(OutputType.BYTES))),
- isIE8);
+ .getScreenshotAs(OutputType.BYTES))));
if (reference == null) {
// Store the screenshot in the errors directory and fail the
// test
@@ -112,24 +111,17 @@ public class CustomTestBenchCommandExecutor {
* the element to retain in the screenshot
* @param fullScreen
* the full screen image
- * @param isIE8
- * true if the browser is IE8
* @return
* @throws IOException
*/
public static BufferedImage cropToElement(WebElement element,
- BufferedImage fullScreen, boolean isIE8) throws IOException {
+ BufferedImage fullScreen) throws IOException {
Point loc = element.getLocation();
Dimension size = element.getSize();
int x = loc.x, y = loc.y;
int w = size.width;
int h = size.height;
- if (isIE8) {
- // IE8 border...
- x += 2;
- y += 2;
- }
if (x >= 0 && x < fullScreen.getWidth()) {
// X loc on screen
// Get the part of the element which is on screen
diff --git a/uitest-common/src/main/java/com/vaadin/tests/tb3/MultiBrowserTest.java b/uitest-common/src/main/java/com/vaadin/tests/tb3/MultiBrowserTest.java
index a4b2e10fda..cef11a69bd 100644
--- a/uitest-common/src/main/java/com/vaadin/tests/tb3/MultiBrowserTest.java
+++ b/uitest-common/src/main/java/com/vaadin/tests/tb3/MultiBrowserTest.java
@@ -42,14 +42,14 @@ import com.vaadin.testbench.parallel.Browser;
public abstract class MultiBrowserTest extends PrivateTB3Configuration {
protected List<DesiredCapabilities> getBrowsersSupportingWebSocket() {
- // No WebSocket support in IE8-9 and PhantomJS
- return getBrowserCapabilities(Browser.IE10, Browser.IE11,
- Browser.FIREFOX, Browser.CHROME);
+ // No WebSocket support in PhantomJS 1
+ return getBrowserCapabilities(Browser.IE11, Browser.FIREFOX,
+ Browser.CHROME);
}
protected List<DesiredCapabilities> getBrowsersExcludingPhantomJS() {
- return getBrowserCapabilities(Browser.IE8, Browser.IE9, Browser.IE10,
- Browser.IE11, Browser.CHROME, Browser.FIREFOX);
+ return getBrowserCapabilities(Browser.IE11, Browser.CHROME,
+ Browser.FIREFOX);
}
protected List<DesiredCapabilities> getBrowsersExcludingIE() {
@@ -60,30 +60,22 @@ public abstract class MultiBrowserTest extends PrivateTB3Configuration {
protected List<DesiredCapabilities> getBrowsersExcludingFirefox() {
// this is sometimes needed as the Firefox driver causes extra mouseOut
// events that make tooltips disappear etc.
- return getBrowserCapabilities(Browser.IE8, Browser.IE9, Browser.IE10,
- Browser.IE11, Browser.CHROME, Browser.PHANTOMJS);
- }
-
- protected List<DesiredCapabilities> getBrowsersExcludingIE8() {
- return getBrowserCapabilities(Browser.IE9, Browser.IE10, Browser.IE11,
- Browser.FIREFOX, Browser.CHROME, Browser.PHANTOMJS);
+ return getBrowserCapabilities(Browser.IE11, Browser.CHROME,
+ Browser.PHANTOMJS);
}
protected List<DesiredCapabilities> getBrowsersSupportingShiftClick() {
- return getBrowserCapabilities(Browser.IE8, Browser.IE9, Browser.IE10,
- Browser.IE11, Browser.CHROME);
+ return getBrowserCapabilities(Browser.IE11, Browser.CHROME);
}
protected List<DesiredCapabilities> getIEBrowsersOnly() {
- return getBrowserCapabilities(Browser.IE8, Browser.IE9, Browser.IE10,
- Browser.IE11);
+ return getBrowserCapabilities(Browser.IE11);
}
protected List<DesiredCapabilities> getBrowsersSupportingContextMenu() {
- // context menu doesn't work in phantom JS and works weirdly with IE8
- // and selenium.
- return getBrowserCapabilities(Browser.IE9, Browser.IE10, Browser.IE11,
- Browser.FIREFOX, Browser.CHROME);
+ // context menu doesn't work in phantom JS
+ return getBrowserCapabilities(Browser.IE11, Browser.FIREFOX,
+ Browser.CHROME);
}
protected List<DesiredCapabilities> getBrowsersSupportingTooltip() {
@@ -99,10 +91,8 @@ public abstract class MultiBrowserTest extends PrivateTB3Configuration {
@Override
public List<DesiredCapabilities> getBrowsersToTest() {
- // Uncomment Safari and Opera if those become tested browsers again.
- return getBrowserCapabilities(Browser.IE8, Browser.IE9, Browser.IE10,
- Browser.IE11, Browser.FIREFOX, Browser.CHROME,
- Browser.PHANTOMJS /* , Browser.SAFARI, Browser.OPERA */);
+ return getBrowserCapabilities(Browser.IE11, Browser.FIREFOX,
+ Browser.CHROME, Browser.PHANTOMJS);
}
protected List<DesiredCapabilities> getBrowserCapabilities(
diff --git a/uitest-common/src/main/java/com/vaadin/tests/tb3/SauceLabsBrowserFactory.java b/uitest-common/src/main/java/com/vaadin/tests/tb3/SauceLabsBrowserFactory.java
index e95dad38b3..e95195d061 100644
--- a/uitest-common/src/main/java/com/vaadin/tests/tb3/SauceLabsBrowserFactory.java
+++ b/uitest-common/src/main/java/com/vaadin/tests/tb3/SauceLabsBrowserFactory.java
@@ -59,24 +59,6 @@ public class SauceLabsBrowserFactory extends DefaultBrowserFactory {
caps = DesiredCapabilities.safari();
caps.setVersion(version);
break;
- case IE8:
- caps = DesiredCapabilities.internetExplorer();
- caps.setVersion("8.0");
- caps.setCapability(InternetExplorerDriver.IE_ENSURE_CLEAN_SESSION,
- true);
- break;
- case IE9:
- caps = DesiredCapabilities.internetExplorer();
- caps.setVersion("9.0");
- caps.setCapability(InternetExplorerDriver.IE_ENSURE_CLEAN_SESSION,
- true);
- break;
- case IE10:
- caps = DesiredCapabilities.internetExplorer();
- caps.setVersion("10.0");
- caps.setCapability(InternetExplorerDriver.IE_ENSURE_CLEAN_SESSION,
- true);
- break;
case IE11:
caps = DesiredCapabilities.internetExplorer();
caps.setVersion("11.0");
diff --git a/uitest-common/src/main/java/com/vaadin/tests/tb3/ScreenshotTB3Test.java b/uitest-common/src/main/java/com/vaadin/tests/tb3/ScreenshotTB3Test.java
index 0058b5bbdd..aea24c6727 100644
--- a/uitest-common/src/main/java/com/vaadin/tests/tb3/ScreenshotTB3Test.java
+++ b/uitest-common/src/main/java/com/vaadin/tests/tb3/ScreenshotTB3Test.java
@@ -36,7 +36,6 @@ import org.openqa.selenium.remote.DesiredCapabilities;
import com.vaadin.testbench.Parameters;
import com.vaadin.testbench.ScreenshotOnFailureRule;
-import com.vaadin.testbench.parallel.BrowserUtil;
import com.vaadin.testbench.screenshot.ImageFileUtil;
/**
@@ -144,8 +143,7 @@ public abstract class ScreenshotTB3Test extends AbstractTB3Test {
} else {
// Only the element
match = customTestBench(driver).compareScreen(element,
- referenceFile,
- BrowserUtil.isIE8(getDesiredCapabilities()));
+ referenceFile);
}
if (match) {
// There might be failure files because of retries in TestBench.
diff --git a/uitest-common/src/main/java/com/vaadin/tests/tb3/VaadinBrowserFactory.java b/uitest-common/src/main/java/com/vaadin/tests/tb3/VaadinBrowserFactory.java
index 839f7e2084..6b1fe5d55f 100644
--- a/uitest-common/src/main/java/com/vaadin/tests/tb3/VaadinBrowserFactory.java
+++ b/uitest-common/src/main/java/com/vaadin/tests/tb3/VaadinBrowserFactory.java
@@ -55,12 +55,6 @@ public class VaadinBrowserFactory extends DefaultBrowserFactory {
public DesiredCapabilities doCreate(Browser browser) {
switch (browser) {
- case IE8:
- return createIE(browser, "8");
- case IE9:
- return createIE(browser, "9");
- case IE10:
- return createIE(browser, "10");
case IE11:
return createIE(browser, "11");
case PHANTOMJS: