Creating a custom TestStep (Factory) plugin to check whether a file exists
In this recipe we will put our plugin skills to work to create a custom TestStep
to check whether a file exists. The file check TestStep
will accept a property with the path to a file and then pass or fail depending on whether the file actually exists in that location.
Getting ready
This recipe builds on the Developing a Groovy plugin with custom Action using Gradle recipe, so if you haven't done it, then you might find it a helpful reference.
The code for this recipe can be found in the plugins/soapui-file-check-plugin/
folder in the chapter 11
samples. The FileCheckPluginProject
project can also be found there.
How to do it...
To do this we're going to start from the soapui-sample-plugin
Gradle project:
- Add a new custom
TestStep
(FileCheckTestStep.groovy
) - Add a new custom
Factory
to create the item forFileCheckTestStep
Model
(FileCheckTestStep.groovy
) - Add a new
factories.xml
configuration file for our custom...