Help documentation

Run Twist Scenarios from Maven

Twist scenarios can be executed in Maven. This makes Twist Continuous Integration friendly, and allows tests to be run as part of a build within tools such as CruiseControl, Go etc. For more information about Continuous Integration, please visit http://martinfowler.com/articles/continuousIntegration.html

Export Twist Libraries

It is possible to export all the jars that Twist depends on. These jars can then be used to execute scenarios using tools such as Ant, Maven and Rake. The option to Export Twist Libraries is available in the Context Menu of a Twist project.

Using Maven Integration

Twist Scenarios can be run from Maven by calling the Ant target from Maven, using the maven-antrun-plugin.

Here are the steps required to do this:

  1. Create the Ant target using the template 'twist-target'. See running scenarios from Ant for more.
  2. Create a Maven profile as shown in the example below. Replace parameters surrounded with braces with suitable values.
  3. <profiles>
        <profile>
            <id>{profile-id-used-for-command-line-execution}</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>{appropriate-id}</id>
                                <configuration>
                                    <tasks>
                                        <property name="ant.library.dir" value="{location-of-ant-library}"/>
                                        <ant dir="{location-of-ant-build-file-created-as-part-of-step-1}" 
                                                    inheritRefs="true">
                                            <target name="execute-scenarios" />
                                        </ant>
                                    </tasks>
                                </configuration>
    
                                <goals>
                                    <goal>{a-goal-name. For ex "test"}</goal>
                                </goals>
                                <phase>{phase-after-which-the-scenarios-are-to-be-executed. For ex "post-integration-test"}</phase>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>  
        
During the Maven execution, provide the profile id used in the newly created profile. For ex:
 
mvn clean install -P {profile-id-created}