From 2ff67edb7281960ffeebad27d730d81d7dbbfafc Mon Sep 17 00:00:00 2001 From: Sauli Tähkäpää Date: Tue, 3 Jun 2014 16:20:37 +0300 Subject: Pass useLocalWebDriver parameter to JUnit. Change-Id: I4840da6281c8be676384aa5b71bf689f7083ee36 --- uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java | 4 +++- uitest/src/com/vaadin/tests/tb3/TB3Runner.java | 8 +++++++- uitest/tb3test.xml | 2 ++ 3 files changed, 12 insertions(+), 2 deletions(-) (limited to 'uitest') diff --git a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java index 3745d60fd8..c8e4e3c9a9 100644 --- a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java +++ b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java @@ -51,6 +51,8 @@ import com.vaadin.tests.components.AbstractTestUIWithLog; import com.vaadin.tests.tb3.MultiBrowserTest.Browser; import com.vaadin.ui.UI; +import static com.vaadin.tests.tb3.TB3Runner.localWebDriverIsUsed; + /** * Base class for TestBench 3+ tests. All TB3+ tests in the project should * extend this class. @@ -126,7 +128,7 @@ public abstract class AbstractTB3Test extends TestBenchTestCase { } else { capabilities = getDesiredCapabilities(); - if (System.getProperty("useLocalWebDriver") != null) { + if (localWebDriverIsUsed()) { setupLocalDriver(capabilities); } else { WebDriver dr = TestBench.createDriver(new RemoteWebDriver( diff --git a/uitest/src/com/vaadin/tests/tb3/TB3Runner.java b/uitest/src/com/vaadin/tests/tb3/TB3Runner.java index 69880008ff..4d29e479e2 100644 --- a/uitest/src/com/vaadin/tests/tb3/TB3Runner.java +++ b/uitest/src/com/vaadin/tests/tb3/TB3Runner.java @@ -61,7 +61,7 @@ public class TB3Runner extends BlockJUnit4ClassRunner { private static final ExecutorService service; static { - if (System.getProperty("useLocalWebDriver") != null) { + if (localWebDriverIsUsed()) { MAX_CONCURRENT_TESTS = 10; } else { MAX_CONCURRENT_TESTS = 50; @@ -69,6 +69,12 @@ public class TB3Runner extends BlockJUnit4ClassRunner { service = Executors.newFixedThreadPool(MAX_CONCURRENT_TESTS); } + protected static boolean localWebDriverIsUsed() { + String useLocalWebDriver = System.getProperty("useLocalWebDriver"); + + return useLocalWebDriver != null && useLocalWebDriver.toLowerCase().equals("true"); + } + public TB3Runner(Class klass) throws InitializationError { super(klass); setScheduler(new ParallelScheduler(service)); diff --git a/uitest/tb3test.xml b/uitest/tb3test.xml index 6e0f25a8f7..a39725f1bb 100644 --- a/uitest/tb3test.xml +++ b/uitest/tb3test.xml @@ -7,6 +7,7 @@ + @@ -37,6 +38,7 @@ + -- cgit v1.2.3