Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Note
titlePlease note

Xray provides a free plugin for TeamCity. Please use it instead, as described in Integration with TeamCity - Legacy(legacy).


It is easy to setup TeamCity in order to integrate it with Xray.

Since Xray provides a full REST API, you may interact with Xray, for submitting results for example.


Table of Contents

JUnit example

In this scenario, we want to get visibility of the automated test results from some tests implemented in Java, using the JUnit framework. 

...

In order to submit those results, we'll just need to invoke the REST API (as detailed in Import Execution Results - REST).

Run automated tests

Our project is Maven based, therefore the first Build Step compiles and runs the JUnit automated tests.


Import execution results

In order to submit the results, we'll need to add a Build Step of type "Command Line", where we'll invoke the REST API, submitting the JUnit XML report generated in the previous step.

...

The parameters can be hidden, such as the password, if you defined them as being of type "Password". 

Cucumber example

In this scenario, we are managing the specification of Cucumber Scenarios/Scenario Outline(s) based tests in Jira, as detailed in the "standard workflow" mentioned in Testing with Cucumber

...

Overall, our Build Configuration is composed of 3 basic steps.

Exporting Cucumber features 

We start by extracting the tests specification out of JIRA and generate the proper .feature files.

...

Notice that we're unzipping the .feature files to a local directory, so we're able to run them.

Run Cucumber scenarios

The exact syntax for running the Cucumber scenarios depends on the Cucumber implementation being used; in this case we're using Ruby's variant.

...

You may have noticed a trick in the cucumber line above, in the end of the command (i.e. ".... || :"). That ensures that cucumber returns with exit code 0 (i.e. success), so the build may proceed.

Import execution results

In order to submit the results, we'll need to add a Build Step of type "Command Line", where we'll invoke the REST API, submitting the Cucumber JSON report generated in the previous step.

...

Xray provides a free plugin for TeamCity. Please use it instead, as described in Integration with TeamCity - Legacy(legacy).