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;
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>()
{
<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>