]> source.dussan.org Git - vaadin-framework.git/commitdiff
Make CalendarNotificationsTestIE work on IE8.
authorSauli Tähkäpää <sauli@vaadin.com>
Thu, 18 Sep 2014 05:10:20 +0000 (08:10 +0300)
committerVaadin Code Review <review@vaadin.com>
Fri, 19 Sep 2014 08:01:26 +0000 (08:01 +0000)
Change-Id: I395a03fe2c1815004a72e2bb3ecde937d504e969

uitest/src/com/vaadin/tests/components/calendar/CalendarNotificationsTestIE.java
uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java

index 7ab6f011130b509da31fb2fa88fe36978decd7d1..933bca8c7d65d39db1313cf220072d890b807dc3 100644 (file)
@@ -41,24 +41,18 @@ public class CalendarNotificationsTestIE extends MultiBrowserTest {
     }
 
     @Override
-    protected DesiredCapabilities getDesiredCapabilities() {
-        DesiredCapabilities desiredCapabilities = new DesiredCapabilities(
-                super.getDesiredCapabilities());
-        desiredCapabilities.setCapability("enablePersistentHover", false);
-        desiredCapabilities.setCapability("requireWindowFocus", true);
+    protected boolean requireWindowFocusForIE() {
+        return true;
+    }
 
-        return desiredCapabilities;
+    @Override
+    protected boolean usePersistentHoverForIE() {
+        return false;
     }
 
     @Override
     public List<DesiredCapabilities> getBrowsersToTest() {
-        List<DesiredCapabilities> browsers = super.getBrowsersToTest();
-        browsers.remove(Browser.CHROME.getDesiredCapabilities());
-        browsers.remove(Browser.FIREFOX.getDesiredCapabilities());
-        browsers.remove(Browser.OPERA.getDesiredCapabilities());
-        browsers.remove(Browser.PHANTOMJS.getDesiredCapabilities());
-        browsers.remove(Browser.SAFARI.getDesiredCapabilities());
-        return browsers;
+        return getIEBrowsersOnly();
     }
 
     @Test
@@ -68,7 +62,7 @@ public class CalendarNotificationsTestIE extends MultiBrowserTest {
         WebElement day = findElements(By.className("v-calendar-day-number"))
                 .get(2);
         // IE8 requires you to click on the text part to fire the event
-        new Actions(getDriver()).moveToElement(day, 83, 11).click().perform();
+        new Actions(getDriver()).moveToElement(day, day.getSize().getWidth() - 3, day.getSize().getHeight() / 2).click().perform();
 
         // check that a notification was opened, this is done with a log instead
         // of a screenshot or element presence check due to problems with IE
index 414aebbd33111fd0d4dd90b0c098d3913fa02db6..72fb2c18d1df7005ddebd56fb7a7ef188b44e44d 100644 (file)
@@ -58,6 +58,16 @@ public abstract class MultiBrowserTest extends PrivateTB3Configuration {
         browsers.remove(Browser.FIREFOX.getDesiredCapabilities());
         browsers.remove(Browser.PHANTOMJS.getDesiredCapabilities());
 
+               return browsers;
+       }
+
+    protected List<DesiredCapabilities> getIEBrowsersOnly() {
+        List<DesiredCapabilities> browsers = new ArrayList<DesiredCapabilities>();
+        browsers.add(Browser.IE8.getDesiredCapabilities());
+        browsers.add(Browser.IE9.getDesiredCapabilities());
+        browsers.add(Browser.IE10.getDesiredCapabilities());
+        browsers.add(Browser.IE11.getDesiredCapabilities());
+
         return browsers;
     }