diff options
author | Teemu Suo-Anttila <tsuoanttila@users.noreply.github.com> | 2017-02-02 12:48:02 +0200 |
---|---|---|
committer | Denis <denis@vaadin.com> | 2017-02-02 12:48:02 +0200 |
commit | 59211beda0aaee3469336a671de5a7ccfb62f014 (patch) | |
tree | 32096f7a38ff0887ec1511acf37cbbd1e0b1898d | |
parent | 700742c85872c018af017f757fde64d564050811 (diff) | |
download | vaadin-framework-59211beda0aaee3469336a671de5a7ccfb62f014.tar.gz vaadin-framework-59211beda0aaee3469336a671de5a7ccfb62f014.zip |
Handle system properties for failsafe plugin (#8414)
* Handle system properties for failsafe plugin
-rw-r--r-- | uitest-common/src/main/java/com/vaadin/tests/tb3/RetryOnFail.java | 14 | ||||
-rw-r--r-- | uitest/pom.xml | 42 |
2 files changed, 23 insertions, 33 deletions
diff --git a/uitest-common/src/main/java/com/vaadin/tests/tb3/RetryOnFail.java b/uitest-common/src/main/java/com/vaadin/tests/tb3/RetryOnFail.java index bd3300e54f..cd735ae76b 100644 --- a/uitest-common/src/main/java/com/vaadin/tests/tb3/RetryOnFail.java +++ b/uitest-common/src/main/java/com/vaadin/tests/tb3/RetryOnFail.java @@ -15,11 +15,14 @@ */ package com.vaadin.tests.tb3; +import java.util.logging.Logger; + import org.junit.rules.TestRule; import org.junit.runner.Description; import org.junit.runners.model.Statement; public class RetryOnFail implements TestRule { + @Override public Statement apply(Statement base, Description description) { return statement(base, description); @@ -53,8 +56,15 @@ public class RetryOnFail implements TestRule { String retryCount = System .getProperty("com.vaadin.testbench.max.retries"); - if (retryCount != null && retryCount != "") { - return Integer.parseInt(retryCount); + if (retryCount != null && !retryCount.trim().isEmpty()) { + try { + return Integer.parseInt(retryCount); + } catch (NumberFormatException e) { + // TODO: See how this was implemented in TestBench + Logger.getLogger(RetryOnFail.class.getName()).warning( + "Could not parse max retry count. Retry count set to 0. Failed value: " + + retryCount); + } } return 0; diff --git a/uitest/pom.xml b/uitest/pom.xml index 3ebff16bf2..e88e46d2ac 100644 --- a/uitest/pom.xml +++ b/uitest/pom.xml @@ -331,8 +331,17 @@ <include>**/AllTB3Tests.java</include> </includes> <systemPropertyVariables> + <!-- Static path for screenshots pointing to submodule --> <com.vaadin.testbench.screenshot.directory>${project.parent.basedir}/tests/screenshots</com.vaadin.testbench.screenshot.directory> - <com.vaadin.testbench.max.retries>2</com.vaadin.testbench.max.retries> + + <!-- Optional properties for the test build --> + <vaadin.testbench.developer.license>${vaadin.testbench.developer.license}</vaadin.testbench.developer.license> + <com.vaadin.testbench.max.retries>${com.vaadin.testbench.max.retries}</com.vaadin.testbench.max.retries> + <browsers.include>${browsers.include}</browsers.include> + <browsers.exclude>${browsers.exclude}</browsers.exclude> + <categories.include>${categories.include}</categories.include> + <categories.exclude>${categories.exclude}</categories.exclude> + <useLocalWebDriver>${useLocalWebDriver}</useLocalWebDriver> </systemPropertyVariables> </configuration> <executions> @@ -444,36 +453,7 @@ </plugins> </build> </profile> - <profile> - <id>validation</id> - <activation> - <activeByDefault>false</activeByDefault> - </activation> - <build> - <pluginManagement> - <plugins> - <plugin> - <artifactId>maven-failsafe-plugin</artifactId> - <configuration> - <systemPropertyVariables> - <useLocalWebDriver>true</useLocalWebDriver> - <browsers.include>phantomjs1</browsers.include> - <categories.exclude>push,needs-ssh</categories.exclude> - </systemPropertyVariables> - </configuration> - <executions> - <execution> - <goals> - <goal>integration-test</goal> - <goal>verify</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </pluginManagement> - </build> - </profile> + </profiles> </project> |