Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to integrate soapUI with Jenkins?

Anyone know a good way to add soapUI tests to my CI builds ?

like image 972
Michael Avatar asked Jul 11 '11 09:07

Michael


People also ask

How do you automate a SoapUI test?

Drag and Drop Test Creation SoapUI provides a great user interface for test creation using the drag and drop feature. For creating test cases, there is no need to code or script, one can simple drag the and drop the API requests in the project to test case without any hassle.

Is ReadyAPI same as SoapUI?

SoapUI is an open-source tool by SmartBear for automated web service testing. You can use it to create automated functional and security API tests. ReadyAPI is an API readiness platform that includes the next generation of SoapUI as one of its test modules.


2 Answers

soapUI offers test automation via Maven or Ant. Maven integration is described HERE.

I tried it some month ago but had some strange issues with the eviware repository... Therefore I run my tests now via Ant. What you have to do is to call the testrunner.bat (or testrunner.sh) script in the soapUI bin directory. You can find the available arguments HERE.

You have to install soapUI on your Hudson build server. Then you simply create a new job which is built via Ant.

Sample build.xml:

<project name="IntegrationTest" default="soapui-tests" basedir=".">     <description>Runs the soapUI integration tests</description>     <property file="build.properties"/>      <target name="checkos">         <condition property="testrunner.cmd" value="${soapUI.home}/bin/testrunner.bat">                 <os family="windows" />         </condition>         <condition property="testrunner.cmd" value="${soapUI.home}/bin/testrunner.sh">                 <os family="unix" />         </condition>     </target>      <target name="soapui-tests" depends="checkos">         <exec executable="${testrunner.cmd}"               failonerror="yes"               failifexecutionfails="yes"         >                 <arg value="-e ${service.endpoint}"/>             <arg value="-P dbUrl=${db.Url}"/>             <arg value="-rajf"/>             <arg path="${report.dir}"/>             <arg path="${soapui.project.folder}"/>         </exec>     </target> </project> 
like image 67
Sebi Avatar answered Oct 03 '22 17:10

Sebi


It is quite simple...

Create a git repo with the following (example):

├── pom.xml ├── RestAPI-negativeTestSuite.xml └── RestAPI-positiveTestSuite.xml 

pom.xml, adjust where needed:

<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">     <modelVersion>4.0.0</modelVersion>     <name>Test soapui</name>     <groupId>tdrury</groupId>     <artifactId>com.example.soapuitests</artifactId>     <version>1.0-SNAPSHOT</version>     <packaging>jar</packaging>     <description>blah blah</description>     <build>         <plugins>             <plugin>                 <groupId>com.smartbear.soapui</groupId>                 <artifactId>soapui-maven-plugin</artifactId>                 <version>5.0.0</version>                  <executions>                     <execution>                         <id>RestAPI-positiveTestSuite</id>                         <configuration>                             <projectFile>RestAPI-positiveTestSuite.xml</projectFile>                             <outputFolder>target/surefire-reports</outputFolder>                             <testSuite>Positive cases</testSuite>                             <junitReport>true</junitReport>                             <exportwAll>true</exportwAll>                             <printReport>true</printReport>                             <testFailIgnore>true</testFailIgnore>                         </configuration>                         <goals>                             <goal>test</goal>                         </goals>                         <phase>test</phase>                     </execution>                      <execution>                         <id>RestAPI-negativeTestSuite</id>                         <configuration>                             <projectFile>RestAPI-negativeTestSuite.xml</projectFile>                             <outputFolder>target/surefire-reports</outputFolder>                             <testSuite>Negative tests</testSuite>                             <junitReport>true</junitReport>                             <exportwAll>true</exportwAll>                             <printReport>true</printReport>                             <testFailIgnore>true</testFailIgnore>                         </configuration>                          <goals>                             <goal>test</goal>                         </goals>                          <phase>test</phase>                     </execution>                 </executions>             </plugin>         </plugins>     </build> </project> 

Create a new Maven job in Jenkins and point it to the git repo and pom.xml, as goal fill in test

That's all folks

like image 42
Xiwen Avatar answered Oct 03 '22 17:10

Xiwen