Link Tests to Test Cases
First, link your tests to SpiraTeam test cases. Plan to clone the Git repository with tests to the same absolute path on hosts where you want to execute the tests. To link a test open corresponding test case in SpiraTeam and scroll to Automation
section.
- Set
Automation Engine
to Rapise
- Set
Script Type
to Linked
- Set
Filename
to absolute path of the test - Save the test case
Create Test Set
Next step is to create a test set and include there the test cases linked to Rapise tests.
Then configure the test set.
- Set
Type
to Automated
- Set
Automation Host
to a host where you plan to execute the test set - Save the test set
Configure RapiseLauncher
Then on the automation host specified in the test set configure RapiseLauncher. It must be connected to your SpiraTeam instance and have same Automation Host Token
as specified in the test set.
Ready to GO
We are almost ready to run the test set from a command line. Just need to capture a couple parameters. When you login to SpiraTeam you work with a project, record its Id.
Open your test set and record its Id.
The command line to execute the test set 54 in the project 2 looks this way:
"c:\Program Files (x86)\Inflectra\Rapise\Core\bin\RapiseLauncher.exe" /testset:54 /project:2
So you can clone the Git repository to the defined absolute path (in our example it is the root of the drive C, remember the filename parameter of a test case set to 'c:\rapise-framework-examples\SpiraFriendlyArchitecture\CreateNewBook\CreateNewBook.sstest') and then execute it, all with a few lines:
pushd C:\
if exist rapise-framework-examples (
rmdir rapise-framework-examples /S /Q
)
git clone https://github.com/Inflectra/rapise-framework-examples.git
popd
"c:\Program Files (x86)\Inflectra\Rapise\Core\bin\RapiseLauncher.exe" /testset:54 /project:2
After execution view and analyze results as usual by looking into test runs.
Click on a test case name to view the detailed report.
CI Integration
The approach to running Spira-linked tests presented above can be easily implemented with popular CI tools like Jenkins and TeamCity. You just need to define two tasks
- Put tests into specific folder
- Run the test set via RapiseLaucnher
Let's see how to implement these tasks in VSTS. Create a new build definition with three steps.
-
Get sources
gets latest version of tests from a Git repository -
Copy Files
copies tests from TFS Agent temp folder to C:\ -
Run
executes RapiseLaucnher
Note: The host running TFS Agent must have Rapise and RapiseLauncher installed. This is what we call Automation Host
above.