From 4c61090f2da4109f8455fd03df9c876a0286fc07 Mon Sep 17 00:00:00 2001 From: Henri Sara Date: Mon, 13 Feb 2017 16:48:15 +0200 Subject: Add workarounds for Firefox in context click tests (#8547) --- .../src/main/java/com/vaadin/tests/tb3/AbstractTB3Test.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'uitest-common/src') 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 6a82492da5..0322d76949 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 @@ -1012,6 +1012,17 @@ public abstract class AbstractTB3Test extends ParallelTest { } } + protected void contextClickElement(WebElement element) { + if (BrowserUtil.isFirefox(getDesiredCapabilities())) { + // Workaround for Selenium/TB and Firefox 45 issue + getCommandExecutor().executeScript( + "var ev = document.createEvent('HTMLEvents'); ev.initEvent('contextmenu', true, false); arguments[0].dispatchEvent(ev);", + element); + } else { + new Actions(getDriver()).contextClick(element).perform(); + } + } + protected boolean isLoadingIndicatorVisible() { WebElement loadingIndicator = findElement( By.className("v-loading-indicator")); -- cgit v1.2.3