aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlia Motornyi <elmot@vaadin.com>2018-05-08 15:11:34 +0300
committerTeemu Suo-Anttila <tsuoanttila@users.noreply.github.com>2018-05-16 07:43:56 +0300
commit9873cf193bbaff05e1333b919fe840882268e107 (patch)
treeacad9d420456a571ce392685b8bfeba4ffca98d9
parent77a00411c99accdde2a27e29d905c977c5031acc (diff)
downloadvaadin-framework-9873cf193bbaff05e1333b919fe840882268e107.tar.gz
vaadin-framework-9873cf193bbaff05e1333b919fe840882268e107.zip
Fix ColorPickerElement and ColorPicker test (#10903)
-rw-r--r--testbench-api/src/main/java/com/vaadin/testbench/elements/ColorPickerPreviewElement.java5
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/colorpicker/ValoColorPickerInputFormatsTest.java2
2 files changed, 3 insertions, 4 deletions
diff --git a/testbench-api/src/main/java/com/vaadin/testbench/elements/ColorPickerPreviewElement.java b/testbench-api/src/main/java/com/vaadin/testbench/elements/ColorPickerPreviewElement.java
index 632052e632..42f162fe11 100644
--- a/testbench-api/src/main/java/com/vaadin/testbench/elements/ColorPickerPreviewElement.java
+++ b/testbench-api/src/main/java/com/vaadin/testbench/elements/ColorPickerPreviewElement.java
@@ -36,9 +36,8 @@ public class ColorPickerPreviewElement extends CssLayoutElement {
public boolean getColorFieldContainsErrors() {
List<WebElement> caption = findElements(
By.className("v-caption-v-colorpicker-preview-textfield"));
- boolean noCaption = caption.isEmpty();
- return noCaption ? noCaption
- : caption.get(0).findElements(By.className("v-errorindicator"))
+ return !caption.isEmpty() &&
+ !caption.get(0).findElements(By.className("v-errorindicator"))
.isEmpty();
}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/colorpicker/ValoColorPickerInputFormatsTest.java b/uitest/src/test/java/com/vaadin/tests/components/colorpicker/ValoColorPickerInputFormatsTest.java
index e2dda5a87e..5c4207ddc4 100644
--- a/uitest/src/test/java/com/vaadin/tests/components/colorpicker/ValoColorPickerInputFormatsTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/components/colorpicker/ValoColorPickerInputFormatsTest.java
@@ -77,7 +77,7 @@ public class ValoColorPickerInputFormatsTest extends MultiBrowserTest {
public void testHSLAValue() {
setColorpickerValue("hsla(120, 0, 50%, 0.3)");
- assertEquals("#00ff00", previewElement.getColorFieldValue());
+ assertEquals("#808080", previewElement.getColorFieldValue());
}
@Test