summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--WebContent/VAADIN/themes/base/common/reconnect-dialog.scss5
-rw-r--r--uitest/src/com/vaadin/tests/application/ReconnectDialogThemeTest.java40
-rw-r--r--uitest/src/com/vaadin/tests/application/ReconnectDialogUITest.java12
3 files changed, 42 insertions, 15 deletions
diff --git a/WebContent/VAADIN/themes/base/common/reconnect-dialog.scss b/WebContent/VAADIN/themes/base/common/reconnect-dialog.scss
index cde587cfe9..15b78800d0 100644
--- a/WebContent/VAADIN/themes/base/common/reconnect-dialog.scss
+++ b/WebContent/VAADIN/themes/base/common/reconnect-dialog.scss
@@ -20,13 +20,12 @@
background-image: url(img/reconnect-spinner.gif);
width: 31px;
height: 31px;
- display: inline-block;
- visibility: hidden;
+ display: none;
vertical-align: middle;
}
&.active .spinner {
- visibility: visible;
+ display: inline-block;
}
}
} \ No newline at end of file
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);