]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1164] Allow command line configuration of which browser to use, for example...
authorWendy Smoak <wsmoak@apache.org>
Sat, 2 May 2009 00:38:38 +0000 (00:38 +0000)
committerWendy Smoak <wsmoak@apache.org>
Sat, 2 May 2009 00:38:38 +0000 (00:38 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@770871 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java
archiva-modules/archiva-web/archiva-webapp-test/testng-pom.xml

index 82531a13a6ece93af893d94c322e269b8bd5de96..2e79ad91b29fefe6628e5963cec58b1ccea2673d 100644 (file)
@@ -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<Selenium>()
            {
index 645d9e5cc95ce9921cbb891d8485855d8dc57780..faa2847b63f69d743855ba38bf39a96e8dde5641 100644 (file)
             <goals>
               <goal>test</goal>
             </goals>
+            <configuration>
+              <systemProperties>
+                <property>
+                  <name>browser</name>
+                  <value>${selenium.browser}</value>
+                </property>
+              </systemProperties>
+            </configuration>
           </execution>
         </executions>
       </plugin>
     <profile>
       <id>firefox</id>
       <activation>
-        <activeByDefault>true</activeByDefault>
+        <property>
+          <name>!browser</name>
+        </property>
       </activation>
       <properties>
-        <browser>*firefox</browser>
+        <selenium.browser>*firefox</selenium.browser>
       </properties>
     </profile>
     <profile>
       <id>iexplore</id>
+      <activation>
+        <property>
+          <name>browser</name>
+          <value>iexplore</value>
+        </property>
+      </activation>
+      <properties>
+        <selenium.browser>*iexplore</selenium.browser>
+      </properties>
+    </profile>
+    <profile>
+      <id>safari</id>
+      <activation>
+        <property>
+          <name>browser</name>
+          <value>safari</value>
+        </property>
+      </activation>
       <properties>
-        <browser>*iexplore</browser>
+        <selenium.browser>*safari</selenium.browser>
       </properties>
     </profile>
     <profile>
       <id>otherbrowser</id>
+      <activation>
+        <property>
+          <name>browser</name>
+          <value>other</value>
+        </property>
+      </activation>
       <properties>
-        <browser>*custom ${browserPath}</browser>
+        <selenium.browser>*custom ${browserPath}</selenium.browser>
       </properties>
     </profile>
   </profiles>