From 4cfc5a7837c296d293c116d0a0336818f82f805d Mon Sep 17 00:00:00 2001 From: Wendy Smoak Date: Sat, 2 May 2009 00:38:38 +0000 Subject: [PATCH] [MRM-1164] Allow command line configuration of which browser to use, for example -Dbrowser=iexplore git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@770871 13f79535-47bb-0310-9956-ffa450edef68 --- .../web/test/parent/AbstractSeleniumTest.java | 10 ++++- .../archiva-webapp-test/testng-pom.xml | 42 +++++++++++++++++-- 2 files changed, 47 insertions(+), 5 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java index 82531a13a..2e79ad91b 100644 --- a/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java @@ -26,6 +26,8 @@ import java.util.Map; import java.util.Properties; import java.util.Map.Entry; +import org.codehaus.plexus.util.StringUtils; + import org.testng.Assert; import com.thoughtworks.selenium.DefaultSelenium; import com.thoughtworks.selenium.Selenium; @@ -56,7 +58,13 @@ public abstract class AbstractSeleniumTest { String seleniumHost = p.getProperty( "SELENIUM_HOST" ); int seleniumPort = Integer.parseInt( ( p.getProperty( "SELENIUM_PORT" ) ) ); - String seleniumBrowser = p.getProperty( "SELENIUM_BROWSER" ); + + String seleniumBrowser = System.getProperty( "browser" ); + if ( StringUtils.isEmpty( seleniumBrowser ) ) + { + seleniumBrowser = p.getProperty( "SELENIUM_BROWSER" ); + } + final Selenium s = new DefaultSelenium( seleniumHost, seleniumPort, seleniumBrowser, baseUrl ); selenium = new ThreadLocal() { diff --git a/archiva-modules/archiva-web/archiva-webapp-test/testng-pom.xml b/archiva-modules/archiva-web/archiva-webapp-test/testng-pom.xml index 645d9e5cc..faa2847b6 100644 --- a/archiva-modules/archiva-web/archiva-webapp-test/testng-pom.xml +++ b/archiva-modules/archiva-web/archiva-webapp-test/testng-pom.xml @@ -172,6 +172,14 @@ test + + + + browser + ${selenium.browser} + + + @@ -364,22 +372,48 @@ firefox - true + + !browser + - *firefox + *firefox iexplore + + + browser + iexplore + + + + *iexplore + + + + safari + + + browser + safari + + - *iexplore + *safari otherbrowser + + + browser + other + + - *custom ${browserPath} + *custom ${browserPath} -- 2.39.5