summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2015-09-07 14:37:44 +0300
committerArtur Signell <artur@vaadin.com>2015-09-08 08:41:33 +0300
commitac8822f6264dcca337dccf2ae8a4bc10f7be49bc (patch)
tree930b41ceebad20927d51f58aa64b6545bfffa8d6 /uitest
parent2c83814dc77124e509d480321bacfef4612c95fd (diff)
downloadvaadin-framework-ac8822f6264dcca337dccf2ae8a4bc10f7be49bc.tar.gz
vaadin-framework-ac8822f6264dcca337dccf2ae8a4bc10f7be49bc.zip
Hide reconnect spinner completely in all themes when giving up (#11733)
Change-Id: I5db94e40b56aa73c15e9deccc86b0852ec45cde8
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/com/vaadin/tests/application/ReconnectDialogThemeTest.java40
-rw-r--r--uitest/src/com/vaadin/tests/application/ReconnectDialogUITest.java12
2 files changed, 40 insertions, 12 deletions
diff --git a/uitest/src/com/vaadin/tests/application/ReconnectDialogThemeTest.java b/uitest/src/com/vaadin/tests/application/ReconnectDialogThemeTest.java
index 2d263a7de9..eb55a7fb5e 100644
--- a/uitest/src/com/vaadin/tests/application/ReconnectDialogThemeTest.java
+++ b/uitest/src/com/vaadin/tests/application/ReconnectDialogThemeTest.java
@@ -80,6 +80,46 @@ public class ReconnectDialogThemeTest extends MultiBrowserThemeTestWithProxy {
}
+ @Test
+ public void gaveUpTheme() throws IOException {
+ openTestURL("reconnectAttempts=3");
+
+ waitUntil(new ExpectedCondition<Boolean>() {
+
+ @Override
+ public Boolean apply(WebDriver input) {
+ try {
+ return $(ButtonElement.class).first() != null;
+ } catch (Exception e) {
+ return false;
+ }
+ }
+ });
+
+ disconnectProxy();
+ $(ButtonElement.class).first().click();
+
+ waitForReconnectDialogWithText("Server connection lost.");
+ compareScreen("gaveupdialog");
+
+ }
+
+ private void waitForReconnectDialogWithText(final String text) {
+ waitUntil(new ExpectedCondition<Boolean>() {
+ @Override
+ public Boolean apply(WebDriver input) {
+ try {
+ final WebElement reconnectDialog = findElement(ReconnectDialogThemeTest.reconnectDialogBy);
+ return reconnectDialog.findElement(By.className("text"))
+ .getText().equals(text);
+ } catch (Exception e) {
+ return false;
+ }
+ }
+ }, 10);
+
+ }
+
private void assertHasManyColors(String message, BufferedImage spinnerImage) {
int backgroundColor = spinnerImage.getRGB(0, 0);
for (int x = 0; x < spinnerImage.getWidth(); x++) {
diff --git a/uitest/src/com/vaadin/tests/application/ReconnectDialogUITest.java b/uitest/src/com/vaadin/tests/application/ReconnectDialogUITest.java
index 34660720d1..19d88350b7 100644
--- a/uitest/src/com/vaadin/tests/application/ReconnectDialogUITest.java
+++ b/uitest/src/com/vaadin/tests/application/ReconnectDialogUITest.java
@@ -43,18 +43,6 @@ public class ReconnectDialogUITest extends MultiBrowserTestWithProxy {
Assert.assertEquals("2. Hello from the server", getLogRow(0));
}
- @Test
- public void gaveUpMessageShown() {
- openTestURL("reconnectAttempts=3");
- getButton().click();
- Assert.assertEquals("1. Hello from the server", getLogRow(0));
-
- disconnectProxy();
- getButton().click();
-
- waitForReconnectDialogWithText("Server connection lost.");
- }
-
private void waitForReconnectDialogWithText(final String text) {
waitForReconnectDialogPresent();
final WebElement reconnectDialog = findElement(ReconnectDialogThemeTest.reconnectDialogBy);