If you use Maven in your development environment, you can include ReadyAPI tests in your builds. To do that, command Maven to download and use the ReadyAPI Maven plugin in your project.
To run ReadyAPI tests from Maven, you need the following:
The pom.xml file containing a reference to the ReadyAPI Maven plugin. Configure it correctly to get the ReadyAPI plugin from the Maven repository and add a ReadyAPI test to the test phase of the build lifecycle.
See a sample Maven configuration here. If you already have your own configuration, copy the needed parts to it.
A ReadyAPI project file.
An appropriate Pro license. For example, if you run functional tests, you need a ReadyAPI Test Pro license. If ReadyAPI cannot find a license when you run it from Maven, it will ask you to activate it.
|Tip:||You can use a trial license to try the integration out. To learn how to get it, see Online Activation of a Trial License Without ReadyAPI.|
Maven downloads the required files and handles any dependencies.
Maven uses a Java Virtual Machine (JVM) to run ReadyAPI tests. This machine uses properties that differ from those specified in the ReadyAPI vmoptions file.
To specify properties in Maven, use the MAVEN_OPTS system property. This property is not created automatically, so you will have to set it manually:
Next time, when you run a Maven build, it will use the specified options to create a virtual machine.
To start a test, execute the Maven
test command in the folder containing your pom.xml file. This command will run the test and generate reports for it. For example:
See an example to learn more about using the pom.xml file for running ReadyAPI tests. To add more test properties, uncomment the corresponding elements (if they exist) or specify additional parameters.
To learn more about known issues and how to work around them, see Troubleshooting.
The Maven plugin supports two types of reports for ReadyAPI tests:
ReadyAPI JUnit reports.
The Surefire Report plugin converts the JUnit XML reports created by ReadyAPI to Surefire HTML reports. Learn more about this plugin in the Apache documentation, and see a sample test that creates such a report.
ReadyAPI reports use some of Microsoft core fonts. Not all Linux installations include these fonts. If you have issues with creating reports:
Install the mscorefonts package applicable for your Linux distributive.
Copy TTF files from /usr/share/fonts/truetype/msttcorefonts to the <ReadyAPI Installation>/jre/lib/fonts directory.
Make sure to specify the <ReadyAPI Installation>/bin/reports directory in the Custom Reports Library field of the ReadyAPI tab in the Preferences window.
Custom ReadyAPI reports require assets and templates that, by default, are not present on test machines where ReadyAPI is not installed.
To work around this issue, retrieve the necessary data from any machine where ReadyAPI is installed:
Copy the <ReadyAPI installation>/bin/reports folder to some location on your test machine.
In ReadyAPI, go to Preferences > ReadyAPI.
Set the path to the reports folder as the value of the Custom reports library option.
Copy the <user home directory>/.readyapi/readyapi‑settings.xml file to some location on your test machine.
(Optional) Restore the original value of the Custom reports library option on the Preferences > ReadyAPI tab.
On your test machine, add the following line to the
configuration section of the pom.xml file:
If needed, see a sample Maven pom.xml file here.