aboutsummaryrefslogtreecommitdiffstats
path: root/testbench-api
diff options
context:
space:
mode:
authorHenri Sara <henri.sara@gmail.com>2017-02-06 12:06:35 +0200
committerGitHub <noreply@github.com>2017-02-06 12:06:35 +0200
commit6e80f676f4c8d8db3ae3586b6b7184237e94ede3 (patch)
treee0c3dc9040501bcc42b10eaea824c685c0483cf0 /testbench-api
parent6af4ccdb9f2971819af2a936c1dfbd7d8d450e4c (diff)
downloadvaadin-framework-6e80f676f4c8d8db3ae3586b6b7184237e94ede3.tar.gz
vaadin-framework-6e80f676f4c8d8db3ae3586b6b7184237e94ede3.zip
Add Firefox 45 workaround in ComboBoxElement (#8449)
Diffstat (limited to 'testbench-api')
-rw-r--r--testbench-api/src/main/java/com/vaadin/testbench/elements/ComboBoxElement.java16
1 files changed, 13 insertions, 3 deletions
diff --git a/testbench-api/src/main/java/com/vaadin/testbench/elements/ComboBoxElement.java b/testbench-api/src/main/java/com/vaadin/testbench/elements/ComboBoxElement.java
index dc6a59d360..64023c7d69 100644
--- a/testbench-api/src/main/java/com/vaadin/testbench/elements/ComboBoxElement.java
+++ b/testbench-api/src/main/java/com/vaadin/testbench/elements/ComboBoxElement.java
@@ -25,6 +25,7 @@ import org.openqa.selenium.WebDriverException;
import org.openqa.selenium.WebElement;
import com.vaadin.testbench.By;
+import com.vaadin.testbench.TestBenchElement;
import com.vaadin.testbench.elementsbase.ServerClass;
@ServerClass("com.vaadin.ui.ComboBox")
@@ -86,7 +87,7 @@ public class ComboBoxElement extends AbstractSelectElement {
private boolean selectSuggestion(String text) {
for (WebElement suggestion : getPopupSuggestionElements()) {
if (text.equals(suggestion.getText())) {
- suggestion.click();
+ clickElement(suggestion);
return true;
}
}
@@ -181,7 +182,7 @@ public class ComboBoxElement extends AbstractSelectElement {
*/
public boolean openNextPage() {
try {
- getSuggestionPopup().findElement(byNextPage).click();
+ clickElement(getSuggestionPopup().findElement(byNextPage));
return true;
} catch (WebDriverException e) {
// PhantomJS driver can throw WDE instead of the more specific
@@ -197,7 +198,7 @@ public class ComboBoxElement extends AbstractSelectElement {
*/
public boolean openPrevPage() {
try {
- getSuggestionPopup().findElement(byPrevPage).click();
+ clickElement(getSuggestionPopup().findElement(byPrevPage));
return true;
} catch (WebDriverException e) {
// PhantomJS driver can throw WDE instead of the more specific
@@ -275,4 +276,13 @@ public class ComboBoxElement extends AbstractSelectElement {
}
}
}
+
+ private void clickElement(WebElement element) {
+ if (isFirefox()) {
+ // Workaround for Selenium/TB and Firefox 45 issue
+ ((TestBenchElement) (element)).clickHiddenElement();
+ } else {
+ element.click();
+ }
+ }
}