SOAP UI, Regression Testing of Human based processes, using Groovy scripts or SOAP UI Steps
We have been using SOAP UI for regression and load testing of workflow. SOAP UI can be downloaded for free from the soapui.org website.
Our story today is to test the absence request, which is basically a five step human workflow:
- init process from a human task
- create an activity task,
- complete the activity task,
- create a notification, and
- dismiss the notification
The graphical BPMN looks something similar to this:
We are going to also add a new call to the authentication service, provided on the runtime, so that we can retrieve the authentication token and re-use it throughout the test case.
1. Standard SOAP UI Testing
The actual SOAP UI test case will then look like this:
- AuthenticateUser: Send a request to the security service and retrieve the security token
- CopyToken: This steps copies the token retrieve from the call to the security service to the request we are about to make to TMS.
- GetPipa: Send a request to TMS.getAvailableTasks, targeted for the pipa of the absence request. We retrieve only one task from this call
- CopyTokenAndPipaId: Similar to 2, we copy the token, and also the taskId of the pipa task, collected from 3
- initProcess: Send a request to TMS.initProcess that will then call the process engine to start the process accordingly.
This steps is equivalent to the action of pressing the start button in the form manager:
- CopyTokenToGetTasks: Copy the security token.
- Delay: We need to wait for the task to be assigned to our current user, according to the process. We are now at the step describe below:
- GetActivityTasks: Now that the activity task “Request Manager Approval” should be in the task list, let’s retrieve its id
- CopyActivityTaskId: Copy token and taskId for the next request
- Complete: This one is called on TMP, the TaskManagementProcess, because it handles the task lifecycle.
The endpoint for TMP can be found locally at: http://localhost:8080/ode/processes/completeTask?wsdlThis step does the same as filling the form of the activity task and using the complete button of the form manager.
- GetNotification: Calling TMS.getAvailableTasks this time again, but with Notification in state READY as a target.
- CompleteNotification: This would be the same as pressing the Dismiss button
2. Testing through Groovy Scripting
SoapUI has a very detailed documentation on how to write tests using groovy scripting with SOAP UI.
This then looks like the screenshot below:
Only the Groovy Script is enabled.
A quick excerpt of the groovy script looks like this:
We then can go through all the same steps exposed into section 1.
3. Download and run.
The SOAP UI project for testing workflow and absence request can be found on github.
After importing, you will see a summary of the project:
And you can run the two tests straight from the TestSuites tab.