summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnna Koskinen <anna@vaadin.com>2014-09-23 14:47:48 +0300
committerVaadin Code Review <review@vaadin.com>2014-10-07 12:42:07 +0000
commit0cd9540483262d0cded56fcc8c286c64a0b75631 (patch)
tree35faeb379a9ca42626ff5e87d89061935f1d5094
parenteb4a9638c6179cee09303613238c3d8cf35fb332 (diff)
downloadvaadin-framework-0cd9540483262d0cded56fcc8c286c64a0b75631.tar.gz
vaadin-framework-0cd9540483262d0cded56fcc8c286c64a0b75631.zip
Updated ComboboxSelectedItemTextTest to ensure popups have time to open.
Change-Id: I382c3a3d08019658dee6c1013d5da22276c1ab55
-rw-r--r--uitest/src/com/vaadin/tests/components/ui/ComboboxSelectedItemTextTest.java23
1 files changed, 18 insertions, 5 deletions
diff --git a/uitest/src/com/vaadin/tests/components/ui/ComboboxSelectedItemTextTest.java b/uitest/src/com/vaadin/tests/components/ui/ComboboxSelectedItemTextTest.java
index f826654022..ab398035ac 100644
--- a/uitest/src/com/vaadin/tests/components/ui/ComboboxSelectedItemTextTest.java
+++ b/uitest/src/com/vaadin/tests/components/ui/ComboboxSelectedItemTextTest.java
@@ -18,9 +18,11 @@ package com.vaadin.tests.components.ui;
import java.io.IOException;
import org.junit.Test;
-import org.openqa.selenium.By;
+import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
+import org.openqa.selenium.support.ui.ExpectedCondition;
+import com.vaadin.testbench.By;
import com.vaadin.tests.tb3.MultiBrowserTest;
/**
@@ -59,24 +61,26 @@ public class ComboboxSelectedItemTextTest extends MultiBrowserTest {
WebElement comboBoxFocus = vaadinElement("/VVerticalLayout[0]/Slot[2]/VVerticalLayout[0]/Slot["
+ indexToFocus + "]/VFilterSelect[0]");
- // Select an element from the first (editable) combobox.
+ // Select an element from the first (to test) combobox.
comboBox.findElement(By.className("v-filterselect-button")).click();
+ waitForPopup(comboBox);
WebElement comboBoxPopup = vaadinElement("/VVerticalLayout[0]/Slot[2]/VVerticalLayout[0]/Slot["
+ indexToTest + "]/VFilterSelect[0]#popup");
comboBoxPopup.findElements(By.tagName("td")).get(2).click();
- // Select an element from the second (non-editable combobox) to remove
+ // Select an element from the second (to focus) combobox to remove
// focus from the first combobox
comboBoxFocus.findElement(By.className("v-filterselect-button"))
.click();
+ waitForPopup(comboBoxFocus);
comboBoxPopup = vaadinElement("/VVerticalLayout[0]/Slot[2]/VVerticalLayout[0]/Slot["
+ indexToFocus + "]/VFilterSelect[0]#popup");
comboBoxPopup.findElements(By.tagName("td")).get(2).click();
- // click the popup on the first combobox. This would reveal the unwanted
- // behaviour.
+ // click the button of the first combobox. This would reveal the
+ // unwanted behaviour.
comboBox.findElement(By.className("v-filterselect-button")).click();
@@ -87,4 +91,13 @@ public class ComboboxSelectedItemTextTest extends MultiBrowserTest {
}
+ private void waitForPopup(final WebElement comboBox) {
+ waitUntilNot(new ExpectedCondition<Boolean>() {
+ @Override
+ public Boolean apply(WebDriver input) {
+ return comboBox.findElements(By.vaadin("#popup")).isEmpty();
+ }
+ }, 10);
+ }
+
} \ No newline at end of file