summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <teemusa@vaadin.com>2014-12-29 16:03:05 +0200
committerTeemu Suo-Anttila <teemusa@vaadin.com>2014-12-31 09:47:29 +0200
commit756189ef29dd8236ab42168ee3c041c65754ae7b (patch)
tree0aeec37d372003f41b5c83f5a7da6054a7964a51 /uitest
parent464cab6680a18bcac5fce702e8b1a1b87af4051e (diff)
downloadvaadin-framework-756189ef29dd8236ab42168ee3c041c65754ae7b.tar.gz
vaadin-framework-756189ef29dd8236ab42168ee3c041c65754ae7b.zip
Fix RpcDataProviderExtension to send initial data on reload (#15465)
Change-Id: I0a2edc9a9ba1f48299e165d398adf7b73972349f
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeaturesTest.java11
-rw-r--r--uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridStructureTest.java28
2 files changed, 39 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeaturesTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeaturesTest.java
index 91dff944cb..0e339ec0ae 100644
--- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeaturesTest.java
+++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeaturesTest.java
@@ -121,4 +121,15 @@ public abstract class GridBasicFeaturesTest extends MultiBrowserTest {
.findElement(
By.xpath("//div[contains(@class, \"v-grid-scroller-vertical\")]"));
}
+
+ /**
+ * Reloads the page without restartApplication. This occasionally breaks
+ * stuff.
+ */
+ protected void reopenTestURL() {
+ String testUrl = getTestUrl();
+ testUrl = testUrl.replace("?restartApplication", "?");
+ testUrl = testUrl.replace("?&", "?");
+ driver.get(testUrl);
+ }
}
diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridStructureTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridStructureTest.java
index 9a9f85ccb9..97a4fb8f4a 100644
--- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridStructureTest.java
+++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridStructureTest.java
@@ -447,4 +447,32 @@ public class GridStructureTest extends GridBasicFeaturesTest {
assertEquals("Scroll position should've not have changed", scrollPos,
getGridVerticalScrollPos());
}
+
+ @Test
+ public void testReloadPage() throws InterruptedException {
+ setDebug(true);
+ openTestURL();
+
+ reopenTestURL();
+
+ // After opening the URL Grid can be stuck in a state where it thinks it
+ // should wait for something that's not going to happen.
+ testBench().disableWaitForVaadin();
+
+ // Wait until page is loaded completely.
+ int count = 0;
+ while (!isElementPresent(GridElement.class)) {
+ if (count == 100) {
+ fail("Reloading page failed");
+ }
+ sleep(100);
+ ++count;
+ }
+
+ // Wait a bit more for notification to occur.
+ sleep(1000);
+
+ assertFalse("Exception occurred when reloading page",
+ isElementPresent(NotificationElement.class));
+ }
}