diff options
author | Denis Anisimov <denis@vaadin.com> | 2016-11-07 16:31:59 +0200 |
---|---|---|
committer | Pekka Hyvönen <pekka@vaadin.com> | 2016-12-09 09:39:00 +0200 |
commit | cde003e7448110aa2e6b229ef4d4679f515c32b3 (patch) | |
tree | 30b3b07c51828a831f964eb4ec81300f58441107 /test/widget-set-testutil | |
parent | 247a64ee5f3dccbdd916b7e26df68cb962f50cd6 (diff) | |
download | vaadin-framework-cde003e7448110aa2e6b229ef4d4679f515c32b3.tar.gz vaadin-framework-cde003e7448110aa2e6b229ef4d4679f515c32b3.zip |
Correct addon init param widgetset IT test.
Change-Id: I413481a325ebad15aa16dd639c788cc72f18dc52
Diffstat (limited to 'test/widget-set-testutil')
-rw-r--r-- | test/widget-set-testutil/src/test/java/com/vaadin/test/defaultwidgetset/AbstractWidgetSetIT.java | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/test/widget-set-testutil/src/test/java/com/vaadin/test/defaultwidgetset/AbstractWidgetSetIT.java b/test/widget-set-testutil/src/test/java/com/vaadin/test/defaultwidgetset/AbstractWidgetSetIT.java index e84296819c..c6d4f1756b 100644 --- a/test/widget-set-testutil/src/test/java/com/vaadin/test/defaultwidgetset/AbstractWidgetSetIT.java +++ b/test/widget-set-testutil/src/test/java/com/vaadin/test/defaultwidgetset/AbstractWidgetSetIT.java @@ -1,5 +1,7 @@ package com.vaadin.test.defaultwidgetset; +import java.util.List; + import org.junit.Assert; import org.junit.Before; import org.junit.Rule; @@ -26,7 +28,16 @@ public abstract class AbstractWidgetSetIT extends TestBenchTestCase { } protected void testAppStartsUserCanInteract(String expectedWidgetSet) { - getDriver().get("http://localhost:8080"); + testAppStartsUserCanInteract(expectedWidgetSet, false); + } + + protected void testAppStartsUserCanInteract(String expectedWidgetSet, + boolean debug) { + String url = "http://localhost:8080"; + if (debug) { + url += "?debug"; + } + getDriver().get(url); TextFieldElement nameInput = $(TextFieldElement.class).first(); nameInput.setValue("John Dåe"); @@ -56,4 +67,19 @@ public abstract class AbstractWidgetSetIT extends TestBenchTestCase { "does not contain implementation for " + componentClass)); } -}
\ No newline at end of file + protected void assertHasDebugMessage(String message) { + List<WebElement> elements = getDriver().findElements( + By.xpath("//span[@class='v-debugwindow-message']")); + boolean found = false; + for (WebElement element : elements) { + if (element.getText().contains(message)) { + found = true; + break; + } + } + Assert.assertTrue( + "Cannot find debug message containing '" + message + "'", + found); + } + +} |