Skip to content

Instantly share code, notes, and snippets.

@leonardinius
Created February 20, 2011 21:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leonardinius/836325 to your computer and use it in GitHub Desktop.
Save leonardinius/836325 to your computer and use it in GitHub Desktop.
selenium integration test configuration
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<!-- ... -->
<dependencies>
<!-- ... -->
<dependency>
<groupId>org.seleniumhq.selenium.client-drivers</groupId>
<artifactId>selenium-java-client-driver</artifactId>
<version>1.0.1</version>
<scope>test</scope>
</dependency>
<!-- ... -->
</dependencies>
<!-- ... -->
<profiles>
<profile>
<id>execute-selenium-it-tests</id>
<activation>
<property>
<name>!selenium.test.it.skip</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>selenium-maven-plugin</artifactId>
<version>1.0</version>
<executions>
<execution>
<id>start-selenium</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start-server</goal>
</goals>
<configuration>
<background>true</background>
<port>${selenium.server.port}</port>
<debug>true</debug>
<logOutput>true</logOutput>
</configuration>
</execution>
<execution>
<id>stop-selenium</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop-server</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<!-- ... -->
<properties>
<!-- ... -->
<selenium.server.port>4444</selenium.server.port>
<!-- ... -->
</properties>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<!-- ... -->
<dependencies>
<!-- ... -->
<dependency>
<groupId>org.seleniumhq.selenium.client-drivers</groupId>
<artifactId>selenium-java-client-driver</artifactId>
<version>1.0.1</version>
<scope>test</scope>
</dependency>
<!-- ... -->
</dependencies>
<build>
<plugins>
<!-- ... -->
<!-- default AMPS configuration, only one testGroup -->
<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-jira-plugin</artifactId>
<version>3.2.3</version>
<extensions>true</extensions>
<configuration>
<productVersion>${jira.version}</productVersion>
<productDataVersion>${jira.data.version}</productDataVersion>
<productDataPath>${jira.xml.data.path}</productDataPath>
<testGroups>
<testGroup>
<id>jira-func-tests</id>
<productIds>
<productId>jira</productId>
</productIds>
<includes>
<include>it/**/functests/**/*.java</include>
</includes>
</testGroup>
</testGroups>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<!-- profile actived on windows only, setting xvfb:skip to true -->
<profile>
<id>selenium-xvfb-on-windows</id>
<activation>
<os>
<family>windows</family>
</os>
</activation>
<properties>
<selenium.skip.xvfb>true</selenium.skip.xvfb>
</properties>
</profile>
<profile>
<id>execute-selenium-it-tests</id>
<activation>
<property>
<!-- active by default -->
<name>!selenium.test.it.skip</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>selenium-maven-plugin</artifactId>
<version>1.0</version>
<executions>
<execution>
<id>xvfb</id>
<phase>pre-integration-test</phase>
<goals>
<goal>xvfb</goal>
</goals>
<configuration>
<skip>${selenium.skip.xvfb}</skip>
</configuration>
</execution>
<execution>
<id>start-selenium</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start-server</goal>
</goals>
<configuration>
<background>true</background>
<port>${selenium.server.port}</port>
<debug>true</debug>
<logOutput>true</logOutput>
</configuration>
</execution>
<execution>
<id>stop-selenium</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop-server</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-jira-plugin</artifactId>
<version>3.2.3</version>
<extensions>true</extensions>
<configuration>
<productVersion>${jira.version}</productVersion>
<productDataVersion>${jira.data.version}</productDataVersion>
<productDataPath>${jira.xml.data.path}</productDataPath>
<testGroups>
<!-- multiple test group defined -->
<testGroup>
<id>jira-func-tests</id>
<productIds>
<productId>jira</productId>
</productIds>
<includes>
<include>it/**/functests/**/*.java</include>
</includes>
</testGroup>
<testGroup>
<id>jira-selenium-tests</id>
<productIds>
<productId>jira</productId>
</productIds>
<includes>
<include>it/**/selenium/**/*.java</include>
</includes>
</testGroup>
</testGroups>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<!-- ... -->
</profiles>
<properties>
<!-- ... -->
<selenium.server.port>4444</selenium.server.port>
<selenium.skip.xvfb>false</selenium.skip.xvfb>
<!-- ... -->
</properties>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment