diff options
Diffstat (limited to 'uitest/src/test/java/com/vaadin/tests/tb3/AbstractTB3Test.java')
-rw-r--r-- | uitest/src/test/java/com/vaadin/tests/tb3/AbstractTB3Test.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/uitest/src/test/java/com/vaadin/tests/tb3/AbstractTB3Test.java b/uitest/src/test/java/com/vaadin/tests/tb3/AbstractTB3Test.java index d825f2959f..6459b6affb 100644 --- a/uitest/src/test/java/com/vaadin/tests/tb3/AbstractTB3Test.java +++ b/uitest/src/test/java/com/vaadin/tests/tb3/AbstractTB3Test.java @@ -16,6 +16,7 @@ import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; +import java.util.TimeZone; import java.util.logging.Level; import org.apache.commons.io.IOUtils; @@ -1171,6 +1172,11 @@ public abstract class AbstractTB3Test extends ParallelTest { element)).intValue(); } + protected int getScrollTop(WebElement element) { + return ((Number) executeScript("return arguments[0].scrollTop;", + element)).intValue(); + } + /** * Returns client height rounded up instead of as double because of IE9 * issues: https://dev.vaadin.com/ticket/18469 @@ -1193,6 +1199,15 @@ public abstract class AbstractTB3Test extends ParallelTest { return ((Number) executeScript(script, e)).intValue(); } + protected TimeZone getBrowserTimeZone() { + // Ask TimeZone from browser + String browserTimeZone = ((JavascriptExecutor) getDriver()) + .executeScript( + "return Intl.DateTimeFormat().resolvedOptions().timeZone;") + .toString(); + return TimeZone.getTimeZone(browserTimeZone); + } + protected void assertElementsEquals(WebElement expectedElement, WebElement actualElement) { while (expectedElement instanceof WrapsElement) { |