Meego Wiki
Views

Quality/QA-tools/QAReports/API

From MeeGo wiki
(Difference between revisions)
Jump to: navigation, search
(/api/update/)
(/api/import: New import api parameters)
Line 53: Line 53:
| Files to be attached with the report: Screenshots, logs etc
| Files to be attached with the report: Screenshots, logs etc
| Optional
| Optional
 +
|-
 +
| title
 +
| Report title
 +
| Optional. Default: value generated from other information if user defined title is not given.
 +
|-
 +
| objective_txt
 +
| Test objective. Web UI markup can be used.
 +
| Optional. Default: value is set from previous report if it exists.
 +
|-
 +
| build_txt
 +
| Build (image) section content. Web UI markup can be used.
 +
| Optional. Default: value is set from previous report if it exists.
 +
|-
 +
| environment_txt
 +
| Test environment. Web UI markup can be used.
 +
| Optional. Default: hwproduct name
 +
|-
 +
| qa_summary_txt
 +
| Quality summary. Web UI markup can be used.
 +
| Optional. Default: value is set from previous report if it exists.
 +
|-
 +
| issue_summary_txt
 +
| Issue summary. Web UI markup can be used.
 +
| Optional. Default: value is set from previous report if it exists.
|}
|}
Line 71: Line 95:
<code>{"ok":"0","errors":"unknown attribute: foobar"}</code>
<code>{"ok":"0","errors":"unknown attribute: foobar"}</code>
-
 
== /api/update/<Report_ID> ==
== /api/update/<Report_ID> ==

Revision as of 07:46, 11 April 2011

MeeGo QA Reports API

MeeGo QA Reports have two RESTful HTTP API for programmatically importing test reports, and updating the test cases of a existed report.

Personal Authentication Token is required for operating with the API. The token can be fetched via QA Reports web UI, by clicking the user name link at the upper right center of the page while logged in.

Index.png

The API key is shown at the bottom of the User Preferences page:

User preferences.png

/api/import

Description: Import test results
Method: POST [encoding multipart/form-data]

Parameters:

Parameter name Description Values
auth_token Personal authentication token
release_version Release version 1.0, 1.1, 1.2
target Target profile Core, Handset, Netbook, IVI
testtype Test type Sanity, Acceptance, Basic Feature Testing etc
tested_at Timestamp of the test in format yyyy-mm-dd Optional. If not given, current date is used.
Example value: 2010-12-14
hwproduct Hardware Ia-Russellville, N900, Pinetrail etc
report, report.[1..n] Report file in XML format
attachment, attachment.[1..n] Files to be attached with the report: Screenshots, logs etc Optional
title Report title Optional. Default: value generated from other information if user defined title is not given.
objective_txt Test objective. Web UI markup can be used. Optional. Default: value is set from previous report if it exists.
build_txt Build (image) section content. Web UI markup can be used. Optional. Default: value is set from previous report if it exists.
environment_txt Test environment. Web UI markup can be used. Optional. Default: hwproduct name
qa_summary_txt Quality summary. Web UI markup can be used. Optional. Default: value is set from previous report if it exists.
issue_summary_txt Issue summary. Web UI markup can be used. Optional. Default: value is set from previous report if it exists.


The input can contain multiple report and attachment files. If multiple files are given, an unique field name have to be given for each file. Unique file names are created by giving a sequence number for each file starting from number 1, for example "attachment.1", "attachment.2" etc. If only on file is given, field can be used without sequence number, 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:

curl --form report.1=@sim.xml --form report.2=@bluetooth.xml --form attachment.1=coredump http://<server>/api/import?auth_token=<token>\&release_version=1.2\&target=Core\&testtype=Acceptance\&hwproduct=N900

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

{"ok":"1"}

In case of error, ok values is 0, and an additional field errors describing the problem is returned

{"ok":"0","errors":"unknown attribute: foobar"}

/api/update/<Report_ID>

Description: Update the test cases of a existed report
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 The ID of the target report

The ID of the target report can be fetched from the URL of the corresponding report page, as shown in the picture below:

Report id.png

The input can contain multiple report files. If multiple report files are given, an unique report name have to be given for each file. Unique file names are created by giving a sequence number for each file starting from number 1, for example "report.1", "report.2" etc. If only one file is given, field can be used without sequence number, 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:

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 in JSON format. If the operation proceeds successfully, key value pair "ok" = 1 is returned.

{"ok":"1"}

In case of error, ok values is 0, and an additional field errors describing the problem is returned

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

Personal tools