TeamCity is a build management service based on Java. It supports a number of convenient features, such as code inspection, running multiple builds, integration with various IDEs, and so on.
To learn more about TeamCity, please visit its official website:
https://www.jetbrains.com/teamcity/
This topic explains how you can integrate ReadyAPI Test with TeamCity and run your API functional tests from TeamCity builds.
About
To integrate ReadyAPI Test with TeamCity, you need to install the ReadyAPI Test Functional Testing plugin provided by SmartBear into TeamCity. It uses the Functional TestRunner to execute tests remotely, and enables you to call this runner from TeamCity builds. The runner generates JUnit-style HTML reports, which you can use to analyze results of the run.
You can download the plugin from the official TeamCity plugin repository:
https://plugins.jetbrains.com/teamcity
The plugin is shipped as a ZIP package that can be installed directly in TeamCity via the web interface. See below for details.
Requirements
Before using the plugin, make sure the following requirements are met:
-
The project you want to run remotely must be saved in ReadyAPI version 2.1.0 or later.
-
The TeamCity agent you want to use for test runs must have ReadyAPI installed with an active ReadyAPI Test Pro license.
Install the plugin
To install the plugin on your TeamCity server:
-
Open the ReadyAPI Test Functional Testing plugin page in your preferred browser.
-
Download the plugin .zip package.
-
Open the web interface of the TeamCity server.
-
Log in using the administrator account.
-
Once logged in, click Administration:
-
On the Administration page, click Plugins List in the Server Administration section on the left:
-
The server will redirect you to the Plugins List page. Click Upload plugin zip:
-
In the subsequent dialog, click Choose File and navigate to the plugin .zip file you have downloaded:
-
Click Upload plugin zip.
The server will import the zip file and install it. A record about the newly installed plugin will appear on the Plugins List page:
-
Restart the TeamCity server in order for the changes to take effect.
Configure the test run
1. Create a TeamCity build
To run your functional test via TeamCity, you need at least 1 TeamCity project and 1 build. To learn how to create them, see the TeamCity documentation:
https://confluence.jetbrains.com/display/TCD18/Setting+up+and+Running+Additional+Build+Agents
2. Add the functional test runner to your build
-
Open the web interface of the TeamCity server.
-
Log in using the administrator account.
-
Once logged in, click Administration:
-
The Projects section of the Administration page will open. If you don't see it, click Projects in the Project-related Settings section on the left:
-
Expand your project, then click the name of the needed build:
-
On the edit form of the build, switch to the Build Steps tab:
-
Click Add build step:
-
On the subsequent page, select ReadyAPI Test: Run Functional Test in the Runner Type drop-down list.
-
The options that will appear allow you to configure your run:
Option Description Step name Optional. The step name used in TeamCity. Path to testrunner The path (fully-qualified name) to the folder where the Functional Test Runner is located (that is, testrunner.bat on Windows or testrunner.sh on Linux or macOS).
Example:C:\Program Files\SmartBear\ReadyAPI-3.56.0\bin
Path to ReadyAPI Project The path to the ReadyAPI project file (XML) or to the folder where the ReadyAPI composite project is located.
Examples:D:\projects\swagger-single.xml
D:\projects\composite-projectTest Suite The name of the test suite you want to run. Leave it blank to run all the test cases of the project. Test Case The name of the test case you want to run. Leave it blank to run all the test cases of the specified test suite, or, if Test Suite is blank as well, all the test cases of the project. Project Password The encryption key the user must use to access the project if the project or some of its custom properties are encrypted. Environment The ReadyAPI environment you want to use during the test run. Additionally, you can click Show Advanced options in the Execute Step drop-down list to modify the execution rule:
-
Click Save.
Now, you can run your functional test using the TeamCity web interface.
Run builds
When the plugin is installed and the build is configured, you can use the TeamCity web interface to remotely run functional tests. To do that:
-
In the TeamCity web interface, go to Projects.
-
Find your project and build.
-
Click Run next to your build:
TeamCity will perform a test run. During the test run, you can check how it is going on the Agents screen.
After the test run is over, its result will appear on the Projects screen.
You can click it to get information on the test run:
View results
The ReadyAPI Test Functional Testing plugin for TeamCity automatically generates a report for each test run. You can find it in the TeamCity data directory, which you specify during the TeamCity installation. For example:
C:\TeamCity\buildAgent\work\4f750434e10a8680\ReadyAPI_report
To view the report, click index.html in the folder. This will open the report in your preferred browser.
If the plugin generates a report from an agent, it always replaces the existing report generated from that agent. Currently, there is no way to generate multiple reports from an agent in the folder. |
The reports are similar to in-product JUnit-style HTML reports.
See Also
TeamCity – Official Website
JUnit-Style HTML Reports For Automation
Integrations