This is a lib that enables you to create test plan runs for your integration test cases on Target Process.
You just have to use TestNG and use maven failsafe-plugin.
-
Install the artifact (targetprocess-testng) on your maven repo.
mvn clean install
-
Then on your project containing the integration tests, setup your pom.xml with the necessary dependencies like the following one:
<dependencies> <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <version>LATEST</version> <scope>test</scope> </dependency> <dependency> <groupId>pt.drsoares.plugins</groupId> <artifactId>targetprocess-testng</artifactId> <version>1.0-SNAPSHOT</version> <scope>test</scope> <type>test-jar</type> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-failsafe-plugin</artifactId> <executions> <execution> <id>integration-test</id> <goals> <goal>integration-test</goal> <goal>verify</goal> </goals> </execution> </executions> <configuration> <testSourceDirectory>src/test/java/pt/drsoares/plugins/integrationtests/</testSourceDirectory> <properties> <property> <name>listener</name> <value>pt.drsoares.plugins.targetprocess.TestSuiteListener</value> </property> </properties> <systemPropertyVariables> <targetProcessUrl>https://targetprocesshostname</targetProcessUrl> <!-- BASIC AUTHENTICATION --> <targetProcessUser>username</targetProcessUser> <targetProcessPassword>password</targetProcessPassword> </systemPropertyVariables> </configuration> </plugin> </plugins> </build> Alternatively you can use token authentication <systemPropertyVariables> <targetProcessUrl>https://targetprocesshostname</targetProcessUrl> <!-- TOKEN AUTHENTICATION --> <targetProcessAuthToken>token</targetProcessAuthToken> </systemPropertyVariables>
-
Add the
TestCase
annotation with the respective id (and testPlan id (optional)) to your Integration Testpackage pt.drsoares.plugins.integrationtests; import org.testng.annotations.Test; import pt.drsoares.plugins.targetprocess.annotations.TestCase; import static org.testng.Assert.assertTrue; public class DummyIT { @TestCase(id = "111959", testPlan = "111958") @Test public void test() { ... } }
-
Run your integration tests
mvn failsafe:integration-test
-
After that you'll notice that your test Test Case on Target Process will have a new Test Plan Run with the result of your ITest.