Run Soapui project from maven
Hi,
i am running soapui project from maven by adding dependency in pom.xml. it is working fine. but i want to run particular test cases from maven. Is there any option to add particular test case and test suite name? i am using soapui free version. Can anyone give suggestion for this?
Here is my code
<plugin>
<groupId>com.smartbear.soapui</groupId>
<artifactId>soapui-maven-plugin</artifactId>
<version>5.3.0</version>
<dependencies>
<dependency>
<groupId>com.smartbear.soapui</groupId>
<artifactId>soapui</artifactId>
<version>5.3.0</version>
<exclusions>
<exclusion>
<groupId>javafx</groupId>
<artifactId>jfxrt</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<configuration>
<projectFile>soapui/user-provisioning-soapui-project_27_05_17.xml</projectFile>
<outputFolder>target/surefire-reports</outputFolder>
<junitReport>true</junitReport>
<exportAll>false</exportAll>
<printReport>true</printReport>
<projectProperties>
<value>Environment=devStagingVM1</value>
<value>endpoint_services="www.gmail.com"</value>
</projectProperties>
</configuration>
<executions>
<execution>
<id>soapUI</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
It's possible. Under configuration tag you can specify testCase or testSuite. From the test-automation page for maven on soapui docs.
testSuite : Specifies the name of the TestSuite to run
testCase : Specifies the name of the TestCase to run
I usually bind a property to specify which testcase/testsuite i want to run at the commandline.<testCase>${soapui.testcase}</testCase>
and bind the property soapui.testcase at top of pom file under project tag to an empty string like this.
<project>
... <properties> <soapui.testcase></soapui.testcase> <soapui.testsuite></soapui.testsuite> </properties> ... </project>That way, by default, all tests are run. And if i want to run something in particular i can do the following.
#Just run My TestCase mvn clean install -Dsoapui.testcase="My TestCase" #Just run My TestSuite mvn clean install -Dsoapui.testsuite="My TestSuite" #run everything mvn clean install
Hope it helps!