summaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/components/combobox
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <teemusa@vaadin.com>2014-05-14 16:31:28 +0300
committerVaadin Code Review <review@vaadin.com>2014-05-15 10:01:08 +0000
commitcfbe3e213efed691cddc5f96cfe900544931658a (patch)
treece3b72fd92dc59717883486d02daacd97d768286 /uitest/src/com/vaadin/tests/components/combobox
parent40a80c51803a109083d3949039448beeefd7f9da (diff)
downloadvaadin-framework-cfbe3e213efed691cddc5f96cfe900544931658a.tar.gz
vaadin-framework-cfbe3e213efed691cddc5f96cfe900544931658a.zip
Make Vaadin TB3/4 tests work and run on PhantomJS (#13291)
Change-Id: I0d1747d41b3b9e0a32d995a5cea9081292c8c2c6
Diffstat (limited to 'uitest/src/com/vaadin/tests/components/combobox')
-rw-r--r--uitest/src/com/vaadin/tests/components/combobox/ComboBoxSetNullWhenNewItemsAllowedTest.java19
1 files changed, 9 insertions, 10 deletions
diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxSetNullWhenNewItemsAllowedTest.java b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxSetNullWhenNewItemsAllowedTest.java
index cfd5f46af1..54d355ab0a 100644
--- a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxSetNullWhenNewItemsAllowedTest.java
+++ b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxSetNullWhenNewItemsAllowedTest.java
@@ -20,9 +20,11 @@ import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebElement;
+import org.openqa.selenium.interactions.Actions;
import com.vaadin.testbench.By;
import com.vaadin.testbench.commands.TestBenchElementCommands;
+import com.vaadin.testbench.elements.ComboBoxElement;
import com.vaadin.tests.tb3.MultiBrowserTest;
/**
@@ -35,21 +37,18 @@ public class ComboBoxSetNullWhenNewItemsAllowedTest extends MultiBrowserTest {
throws InterruptedException {
setDebug(true);
openTestURL();
- Thread.sleep(1000);
- WebElement element = findElement();
+ WebElement element = $(ComboBoxElement.class).first().findElement(
+ By.vaadin("#textbox"));
((TestBenchElementCommands) element).click(8, 7);
element.clear();
element.sendKeys("New value");
assertEquals("New value", element.getAttribute("value"));
- element.sendKeys(Keys.RETURN);
+ if (BrowserUtil.isPhantomJS(getDesiredCapabilities())) {
+ new Actions(getDriver()).sendKeys(Keys.ENTER).perform();
+ } else {
+ element.sendKeys(Keys.RETURN);
+ }
assertEquals("", element.getAttribute("value"));
}
-
- private WebElement findElement() {
- return getDriver()
- .findElement(
- By.vaadin("runcomvaadintestscomponentscomboboxComboBoxSetNullWhenNewItemsAllowed::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VFilterSelect[0]#textbox"));
- }
-
}