Feedback

Your feedback is important to keep improving our website and offer you a more reliable experience.

Test Report Center (TRC)

Introduction

Test Report Center has four RESTful HTTP APIs for importing, updating, merging test reports, and search capabilities on existing test reports.

Personal authentication token is required for operations on the APIs. You can obtain the token by clicking the user name link at the upper-right corner of the Test Report Center web page while logging in, as shown in Figure 1.

Figure 1 Obtaining Personal Authentication Token

 

The API token is shown at the bottom of the User Preferences page, as shown in Figure 2.

Figure 2 API token

 

/api/import

Description: Import test results
Method: POST [encoding multipart/form-data], Red fields are mandatory, Green are optional

2 possible exceptions though:

Build ID and Test type that may have been put as mandatory by settings, but in this case, a red asterisk appears in this Add Report page below:

Figure 3 Add Report page Fields


Parameters:

Parameter Name

Description

Type and Value

auth_token

Personal authentication token

String: Must be API Token from an existing user, see introduction. Pay attention to a possible space before it while copy/pasting it.

release_version

Project

(as displayed in Add Report)

String: v1, v2, Dev, …

target

Product type

(as displayed in Add Report)

String: Desktop, Laptop, …

Testtype

Test type

(as displayed in Add Report)

String

(Optional depending on server configuration): Sanity test, Middleware, and Regression test, Smoke

tested_at

Test timestamp in format of yyyy-mm-dd

String (Optional): Use the current date if not provided.
Example: 2012-01-14

Hwproduct

Test Environment

(as displayed in Add Report)

String: Dell Optiplec, Lenovo X1 Carbon, …

build_id

Build ID

(as displayed in Add Report)

String

(Optional depending on server configuration): 20120110.13, 20120112.2, and 20120110.13

report, report.[1..n]

Report Files to be sent in .xml or .csv format

Files: Containing Test results with known file format.

attachment, attachment.[1..n]

Files to be attached with test report, such as Screenshots and logs

Files (Optional): Containing additional information for the test session

title

Report title

(as displayed in Add Report)

String (Optional): Its default value is automatically generated with : Test Environment (hwproduct) + Image + BuildID

objective_txt

Test objective.
Web UI markup can be used, however, HTML codes must be used for specific character (space=%20, carriage return=%0A, …).

String (Optional): Provide information on Test Session objective.

Image

Image

(as displayed in Add Report)

Ubuntu 14.04, Windows 8, …

environment_txt

Test environment.
Web UI markup can be used.

String (Optional): Its default value is the value of hwproduct.

qa_summary_txt

Quality summary.
Web UI markup can be used, however, HTML codes must be used for specific character (space=%20, carriage return=%0A, …).

String (Optional): Provide information on QA Summary section

issue_summary_txt

Issue summary.
Web UI markup can be used, however, HTML codes must be used for specific character (space=%20, carriage return=%0A, …).

String (Optional): Provide information on Issue Summary section.


The input can contain multiple report and attachment files.

  • If multiple files are given, each file must be numbered for identification, for example, attachment.1 and attachment.2.
  • If only one file is given, it does not need to be numbered, for example, attachment.

Because multiple files can be uploaded, HTTP POST with "multipart/form-encoding" is used.

An example using Curl for testing the API is provided below:

curl --form report.1=@sim.csv --form report.2=@bluetooth.xml --form attachment.1=coredump http://<Server_Domain_Name>/api/import?auth_token=<TOKEN>\&release_version=v1\&target=Desktop\&testtype=Middleware\&hwproduct=”Dell Optiplex”\&image=”Ubuntu 14.04”

The operation results status code is in JSON format. If the operation proceeds successfully, key value pair "ok" = 1 is returned:

{"ok":"1","url":"http://<Server_Domain_Name>/release_version/target/hwproduct/image/983"}

With :
release_version = “v1”
target = “Desktop”
hwproduct = “Dell Optiplex”
image = “Ubuntu 14.04”

System will respond this:
{"ok":"1","url":"http://<Server_Domain_Name>/v1/desktop/dell-optiplex/ubuntu-14-04/984"}

If an error occurs, ok values is 0. Moreover, an additional field errors is returned, describing the problem.

 

/api/update/<Report_ID>

Description: Update the test cases of an existing test report.
WARNING, this is deleting any previous test results of this report, this must be used wisely.
Method: POST [encoding multipart/form-data]

Parameters:

Parameter Name

Description

auth_token

Personal authentication token

report, report.[1..n]

Report file in .xml or .csv format

Report_ID

ID of the target report

You can obtain the ID of the target report from the URL of the TRC report page.

The input can contain multiple report files.

  • If multiple report files are given, each file must be numbered for identification, for example, report.1 and report.2.
  • If only one file is given, it does not need to be numbered, for example report.

Because multiple files can be uploaded, HTTP POST with "multipart/form-encoding" is used.

An example using Curl for testing the API is provided below:

curl --form report.1=@sim.xml --form report.2=@bluetooth.xml http://<Server_Domain_Name>/api/update/<Report_ID>?auth_token=<TOKEN>

The operation results status code is in JSON format. If the operation proceeds successfully, key value pair "ok" = 1 is returned:

{"ok":"1","url":"http://<Server_Domain_Name>/v1/desktop/dell-optiplex/ubuntu-14-04/984"}

If an error occurs, ok values is 0. Moreover, an additional field errors is returned, describing the problem:

{"ok":"0","errors":"Request contained invalid files: ..."}


/api/merge/<Report_ID>

Description: Merge new test result files to an existing test report. This is adding any new tests and update result of a given tests if a test case name was already existing (as a reminder, test case names must be unique.
Method: POST [encoding multipart/form-data]

Parameters:

Parameter Name

Description

auth_token

Personal authentication token

result_files

Report file in .xml or .csv format

Report_ID

ID of the target report

The input can contain multiple report files. You can identify the report files by setting the result_files parameter, for example:

curl -F result_files=@/PATH_TO_REPORT/MyReportFile.csv http://<Server_Domain_Name>/api/merge/983?auth_token=<TOKEN>

{"ok":"1","url":"http://<Server_Domain_Name>/v1/desktop/dell-optiplex/ubuntu-14-04/984"}

curl -F result_files=@sim.xml -F result_files=@bluetooth.xml http://<Server_Domain_Name>/api/merge/<Report_ID>?auth_token=<token>

Because multiple files can be uploaded, HTTP POST with "multipart/form-encoding" is used.

The operation responds with a standard HTTP response status code. In particular, 200 indicates a successful operation, and 422 indicates that files fail to be processed.


Response

Description

Data

0

Success

{"ok":"1","url":"http://<Server_Domain_Name>/v1/desktop/dell-optiplex/ubuntu-14-04/984"}

403

Invalid authentication token

Error message in JSON format: {"errors": "<message>"}

404

Report not found

-

422

Invalid result files

Error message in JSON format: {"errors": "<message>"}

 

/api/reports/

Description: Search some information from existing test reports
Method: GET

Parameters:

Parameter Name

Description

auth_token

Personal authentication token (not mandatory if reports are public)

limit_amount

Search the amount of the reports

begin_time

The begin time of the reports’ update time  

brief=true

The brief information(except ‘features’)

id

ID of the target report

 

About the parameters, you have a lot of combinations to make a request URL, for example:

  • Get the detail information : http://<Server_Domain_Name>/api/reports?auth_token=<TOKEN>&limit_amount=<amount>&begin_time=<begin_time>
  • Get the brief information : http://<Server_Domain_Name>/api/reports?auth_token=<TOKEN>&limit_amount=<amount>&begin_time=<begin_time>&brief=true
  • Get the detail information by Report_ID:

http://<Server_Domain_Name>/api/reports/< Report_ID>?auth_token=<TOKEN>

The operation results status code is in JSON format. If the operation proceeds successfully, you will get the information.

If an error occurs, an additional field errors is returned, describing the problem:

{"errors":"<message>"}