aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/tb3
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2014-08-16 20:31:42 +0300
committerVaadin Code Review <review@vaadin.com>2014-08-20 11:07:22 +0000
commit3d2102aba27308f3d7131c53c08a5182a4f767d9 (patch)
tree09724fcee98e9298f41c9c720a9fbd8dc4c12866 /uitest/src/com/vaadin/tests/tb3
parentce92dece273720d9e43d489d72b91be596c9833a (diff)
downloadvaadin-framework-3d2102aba27308f3d7131c53c08a5182a4f767d9.tar.gz
vaadin-framework-3d2102aba27308f3d7131c53c08a5182a4f767d9.zip
Retry local driver in the same way as remote driver
PhantomJS sometimes fails to start properly in validation builds Change-Id: I768dd4c7fd67d7e05d25311f8e309d3b9764d11b
Diffstat (limited to 'uitest/src/com/vaadin/tests/tb3')
-rw-r--r--uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java40
1 files changed, 21 insertions, 19 deletions
diff --git a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java
index b892fbe4a0..8142c3ae6b 100644
--- a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java
+++ b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java
@@ -156,11 +156,25 @@ public abstract class AbstractTB3Test extends TestBenchTestCase {
} else {
capabilities = getDesiredCapabilities();
- if (localWebDriverIsUsed()) {
- setupLocalDriver(capabilities);
- } else {
- setupRemoteDriver(capabilities);
+ for (int i = 1; i <= BROWSER_INIT_ATTEMPTS; i++) {
+ try {
+ if (localWebDriverIsUsed()) {
+ setupLocalDriver(capabilities);
+ } else {
+ setupRemoteDriver(capabilities);
+ }
+ break;
+ } catch (Exception e) {
+ System.err
+ .println("Browser startup for " + capabilities
+ + " failed on attempt " + i + ": "
+ + e.getMessage());
+ if (i == BROWSER_INIT_ATTEMPTS) {
+ throw e;
+ }
+ }
}
+
}
int w = SCREENSHOT_WIDTH;
@@ -260,21 +274,9 @@ public abstract class AbstractTB3Test extends TestBenchTestCase {
usePersistentHoverForIE());
}
- for (int i = 1; i <= BROWSER_INIT_ATTEMPTS; i++) {
- try {
- WebDriver dr = TestBench.createDriver(new RemoteWebDriver(
- new URL(getHubURL()), capabilities));
- setDriver(dr);
- return;
- } catch (Exception e) {
- System.err.println("Browser startup for " + capabilities
- + " failed on attempt " + i + ": " + e.getMessage());
- if (i == BROWSER_INIT_ATTEMPTS) {
- throw e;
- }
- }
- }
-
+ WebDriver dr = TestBench.createDriver(new RemoteWebDriver(new URL(
+ getHubURL()), capabilities));
+ setDriver(dr);
}
/**