17.8. Maven integration

17.8.1. Obtaining the Maven Plugin
17.8.2. Installing the Maven Plugin
17.8.3. Using the Maven Plugin
17.8.4. Maven Plugin XML reference

Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting, and documentation from a central piece of information.

The Squish Maven plugin described here makes it possible to run Squish tests during any Maven phase.

17.8.1. Obtaining the Maven Plugin

The Maven plugin is available from: www.froglogic.com/download/squish-maven-plugin_latest.zip

17.8.2. Installing the Maven Plugin

To install the plugin, start by unzipping the package. Once unzipped, change into the package's directory. To perform the installation, on Windows, run the install-squish-plugin.bat program, and on Unix-like systems run the install-squish-plugin.sh program.

17.8.3. Using the Maven Plugin

To use the plugin from your POM file add this to the plugins section:


<project>
   ....
    <plugins>
       ....
       <!-- Make the Squish plugin known to Maven and run one testcase -->
       <plugin>
         <groupId>com.froglogic.squish.maven</groupId>
         <artifactId>squish-plugin</artifactId>
         <executions>
           ....
           <!-- This test uses local Squish server -->
           <execution>
             <id>test1</id>
             <phase>test</phase>
             <goals>
               <goal>run-test</goal>
             </goals>
             <configuration>
               <path>C:\squish</path>
               <testsuite>C:\squish\examples\qt4\suite_addressbook_js</testsuite>
               <testcase>tst_add_address</testcase>
             </configuration>
           </execution>
           ....
         </executions>
       <plugin>
       ....
    </plugins>
   ....
</project>

This example runs the suite_addressbook_js suite's tst_add_address test case during the test phase. Athough in fact, the test could be run during any phase, simply by changing the phase tag.

In this example, only one test case is executed, but it is possible to run as many test cases as you like, simply by adding more execution tags inside the executions tag. Alternatively, all of a suite's test cases can be run simply by omitting the testcase tag.

17.8.4. Maven Plugin XML reference

This section provides an overview of the runtest goal (tag) that can be used after installing the Maven plugin.

17.8.4.1. runtest

The runtest goal is used to run an entire Squish test suite or a single test case. The table below shows the tags that can be used within the configuration tag:

Table 17.4. runtest goal

Tag Value Required
testsuite The absolute path to the Squish suite that is to be run. Yes
testcase The one test case from the suite to be run. (If this is not specified then all of the suite's test cases will be run.) No
path The absolute path to Squish's root directory. Yes
host The hostname of the machine where the squishserver is running. No
port The port number that the squishserver is listening on. No
reportdir The directory where test reports should be output to. No