Skip to main content

Publish Results

This step publishes automated test results by hand, into the main Space of the tutorial Project.

Install Client​

Publishing uses the Testspace client, a command-line program. Install it on your computer following the client installation instructions for Windows, Linux or macOS.

Verify the installation:

$ testspace --version

Publish​

Create a file called results.xml with these sample test results, two test cases of which one fails:

<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="example" tests="2" failures="1" time="2.0">
<testsuite name="Hello Automation">
<testcase classname="Hello Automation" name="Test Case One" time="1.00"/>
<testcase classname="Hello Automation" name="Test Case Two" time="1.00">
<failure type="Exception" message="Something unexpected happened"/>
</testcase>
</testsuite>
</testsuites>

Push it to Testspace:

$ testspace results.xml YOUR_TOKEN:@YOUR_ORG.testspace.com/tutorial/main
  • Replace YOUR_ORG with your Organization's subdomain, chosen when you signed up.
  • Replace YOUR_TOKEN with the Project's push token or your own access token.
  • tutorial/main is the Project and Space from Setup; change it if you used other names.

Save the URL​

To avoid typing the URL each time, save it once with config:

$ testspace config url YOUR_TOKEN:@YOUR_ORG.testspace.com/tutorial/main

Then pushing is just:

$ testspace results.xml

For the other settings, see:

$ testspace --help config

See the Result​

In Testspace, open the tutorial Project and click the main Space. Its Current tab shows the Result you just published:

  • ✕ Unhealthy: the pass rate, 50%, is below the Space's threshold, 100% by default.
  • The counts: 1 passed · 1 failed, in 2 test cases in 1 suite.
  • The All tests tab: the Hello Automation Suite, with its failing case tracked as ● 1 new.
  • The Failures tab: Test Case Two, the failing case.

The published Result

Review Results walks through these after the next step.

From CI​

The same testspace command runs in any CI job that can run a shell command: push the results file your tests write, after the tests run. Download the client in the job, and store the token as a CI secret rather than in the job definition. See CI/CD Support.

A Standalone Project publishes to the Space you name in the URL. A Connected Project creates a Space for each branch and pull request, and the client finds the Project and Space from the repository.

More Publishing Options​

For more publishing features, see Push Data:

Recap​

This section covered:

  • Installing the Testspace client
  • Pushing a results file by hand, with the URL given or saved with config
  • A first look at the Result: its Health, counts and failing case
  • Publishing from CI