Custom Publishing
This is a standalone tutorial covering custom publishing.
As mentioned in the Add to CI help article, there are two types of projects - Connected and Standalone. This section of the tutorial focuses exclusively on the steps required for publishing results using a standalone project. A standalone project is applicable when running custom test automation - not connected to GitHub, GitLab, or Bitbucket repositories.
$ testspace results.xml coverage.xml ...
Refer to the Add to CI help article for details on CI/Automation integration.
Now login into your Testspace account.
New project
You will now create a Testspace project
to be used for this section of the tutorial. Select the New Project
button(only availabe to admin accounts) at the top right of the page. You can select whether to make this project Public
by the checkbox in the upper right corner, the default is private.
Provide a Project name and optional description and SUBMIT
.
Note, if a list of repos is presented make sure to select the STANDALONE
button on the left/bottom side.
New space
Once a new Project has been created a space for publishing needs to be added as well.
Select the New Space
button to bring up the dialog shown below.
Provide a Space name and optional description and SUBMIT
.
Install client
As a prerequisite to pushing test content the Testspace client console utility is required to be installed on your host computer. Refer to the client installation instructions for Windows, Linux, and macOS computers.
Verify installation:
$ testspace --version
Push data
For simplicity, create a file called results.xml
with the following pre-canned test results:
<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="example" tests="2" failures="0" 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"/>
</testsuite>
</testsuites>
Using the newly created file go ahead and push data to the server using the following:
$ testspace results.xml YOUR_TOKEN:@YOUR_ORG.testspace.com/YOUR_PROJECT/YOUR_SPACE
After making the following changes:
- Update
YOUR_ORG
to the name you picked when signing up to Testspace (e.g. 'myOrganization') - Update
YOUR_PROJECT
to the name used - Update
YOUR_SPACE
to the named used - Update
YOUR_TOKEN
to your Testspace User access-token
Config
If appropriate you could do a one time config
:
$ testspace config url YOUR_TOKEN:@YOUR_ORG.testspace.com/YOUR_PROJECT/YOUR_SPACE
Then pushing looks like:
$ testspace results.xml
For setting options see:
$ testspace --help config
Pro Tips
For more information on publishing features, refer to the Push Data section of the help documentation:
- Using incremental pushes by calling the Testspace client multiple times
- Adding Code Coverage
- Passing wildcards, sub-directories, etc., for finding results files
- Adding custom metrics
Recap
The section covered the setup steps and options for publishing test automation results:
- Create a Testspace project and one or more spaces
- Installing the Testspace client
- Option for configuring the Testspace client
- Options for pushing data