瀏覽代碼

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: I37a398e60c247920fd56fc05b747e0f93f3f2dd2
tags/7.7.0.alpha1
Teemu Suo-Anttila 8 年之前
父節點
當前提交
b5efe7d243
共有 1 個檔案被更改,包括 15 行新增0 行删除
  1. 15
    0
      uitest/src/com/vaadin/tests/integration/AbstractIntegrationTest.java

+ 15
- 0
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"));
}
}
}

Loading…
取消
儲存