summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorSun Zhe <31067185+ZheSun88@users.noreply.github.com>2019-03-06 16:18:40 +0200
committerGitHub <noreply@github.com>2019-03-06 16:18:40 +0200
commit41ef058ba8a99d7603e98e122b9e60fa2dbf33c9 (patch)
tree97e9899ab27b864102c73ffff95beba850ccceaf /uitest
parent6854108f316d04b8c5c10cc0add38f6158b43845 (diff)
downloadvaadin-framework-41ef058ba8a99d7603e98e122b9e60fa2dbf33c9.tar.gz
vaadin-framework-41ef058ba8a99d7603e98e122b9e60fa2dbf33c9.zip
Fix ComboBoxElement clear method (#11483)
Explicitly reset the value in case if it was cleared. Ignore the case for selecting a suggestion. Fixes vaadin/testbench#1122
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/ErrorLevelsTest.java12
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxSelectingNewItemValueChangeTest.java4
2 files changed, 4 insertions, 12 deletions
diff --git a/uitest/src/test/java/com/vaadin/tests/components/ErrorLevelsTest.java b/uitest/src/test/java/com/vaadin/tests/components/ErrorLevelsTest.java
index 647c9601e4..942e23f061 100644
--- a/uitest/src/test/java/com/vaadin/tests/components/ErrorLevelsTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/components/ErrorLevelsTest.java
@@ -147,17 +147,7 @@ public class ErrorLevelsTest extends SingleBrowserTest {
}
private void selectErrorLevel(ErrorLevel errorLevel) {
- errorLevelSelector.clear();
errorLevelSelector
- .sendKeys(errorLevel.toString().toLowerCase(Locale.ROOT));
- errorLevelSelector.sendKeys(getReturn());
- }
-
- private Keys getReturn() {
- if (BrowserUtil.isPhantomJS(getDesiredCapabilities())) {
- return Keys.ENTER;
- } else {
- return Keys.RETURN;
- }
+ .selectByText(errorLevel.toString().toUpperCase(Locale.ROOT));
}
}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxSelectingNewItemValueChangeTest.java b/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxSelectingNewItemValueChangeTest.java
index 1e2869df61..6f6d45cd2a 100644
--- a/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxSelectingNewItemValueChangeTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxSelectingNewItemValueChangeTest.java
@@ -137,7 +137,9 @@ public class ComboBoxSelectingNewItemValueChangeTest extends MultiBrowserTest {
protected void typeInputAndSelect(String input,
SelectionType selectionType) {
- comboBoxElement.clear();
+ // clear() would cause an additional value change in chrome 70+
+ // since it always makes blur after clear()
+ comboBoxElement.sendKeys(Keys.BACK_SPACE, Keys.BACK_SPACE, Keys.BACK_SPACE);
sendKeysToInput(input);
switch (selectionType) {
case ENTER: