aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <teemusa@vaadin.com>2016-01-12 13:36:02 +0200
committerTeemu Suo-Anttila <teemusa@vaadin.com>2016-01-12 16:16:28 +0200
commitabac2fc8217f1c07d540134058fc4f4798de948b (patch)
treedbf764cf252478ddc86bbdfb65cb45356997a570
parent94c8049e5dcdc35248197783265c466f2bbbcddd (diff)
downloadvaadin-framework-abac2fc8217f1c07d540134058fc4f4798de948b.tar.gz
vaadin-framework-abac2fc8217f1c07d540134058fc4f4798de948b.zip
Add a simple waitForApplication for servlet integration tests
This waitForApplication checks if an UI element exists on the page. If not, then it will wait 10 seconds in order for it to appear. This should reduce the amount of false negatives in server tests. Change-Id: I9409f5a9ebcaa5511e7a250f49070f38cad2ff5e
-rw-r--r--uitest/src/com/vaadin/tests/integration/AbstractIntegrationTest.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/integration/AbstractIntegrationTest.java b/uitest/src/com/vaadin/tests/integration/AbstractIntegrationTest.java
index 5dd59a8245..f035ef35f6 100644
--- a/uitest/src/com/vaadin/tests/integration/AbstractIntegrationTest.java
+++ b/uitest/src/com/vaadin/tests/integration/AbstractIntegrationTest.java
@@ -15,6 +15,8 @@
*/
package com.vaadin.tests.integration;
+import com.vaadin.testbench.By;
+import com.vaadin.testbench.elements.UIElement;
import com.vaadin.testbench.parallel.TestNameSuffix;
import com.vaadin.tests.tb3.PrivateTB3Configuration;
@@ -37,4 +39,17 @@ public abstract class AbstractIntegrationTest extends PrivateTB3Configuration {
return deploymentUrl;
}
+ @Override
+ protected void openTestURL() {
+ super.openTestURL();
+
+ waitForApplication();
+ }
+
+ protected void waitForApplication() {
+ if (!isElementPresent(UIElement.class)) {
+ // Wait for UI element.
+ waitForElementPresent(By.vaadin("//com.vaadin.ui.UI"));
+ }
+ }
}