Test Steps Results

Test Step

  • To view a Test Step, you need to specify the ID of the Test Run and the ID of the test step.
  • To update a Test Step, you need to send a JSON with the Test Step fields you want to update.


 GET api/testrun/{id}/step/{stepResultId}/

Return a json that represents the test step.

Request

PATH PARAMETERS
parameter
type
description
idInteger

- id of the test run.

stepResultIdInteger- id of the step.

Responses

200 OK : text/plain : Successful. Return a json that represents the test step.

Example Output
{
      "id":729,
      "index":1,
      "step":{
         "raw":"ssaf",
         "rendered":"<p>ssaf</p>"
      },
      "data":{
         "raw":"asdf",
         "rendered":"<p>asdf</p>"
      },
      "result":{
         "raw":"asdfasdf",
         "rendered":"<p>asdfasdf</p>"
      },
      "attachments":[
      ],
      "status":"EXECUTING",
      "comment":{
         "raw":"asdasdasdasdasd",
         "rendered":"<p>asdasdasdasdasd</p>"
      },
      "defects":[
         {
            "id":15018,
            "key":"CALC-115",
            "summary":"Ad-hoc execution for CALC-93",
            "status":"Open"
         }
      ],
      "evidences":[
         {
            "id":216,
            "fileName":"1 (24).feature",
            "fileSize":"0,4 kB",
            "created":"Wednesday 5:09 PM",
            "author":"admin",
			"fileURL": "http://YOURJIRA/jira/plugins/servlet/raven/attachment/253/1 (24).feature"
         }
      ],
	  "actualResult":{
		"raw":"Actual result",
		"rendered":"<p>Actual result</p>"
	  }
   }

400 BAD_REQUEST : text/plain : Returns the error.

401 UNAUTHORIZED : text/plain : The Xray license is not valid.

500  INTERNAL SERVER ERROR : text/plain : An internal error occurred getting the test run.

 PUT api/testrun/{id}/step/{stepResultId}/

Update the test run step. The fields that can be updated on the test run are: status, comment, defects and evidences.

Defects and evidences mentioned directly by the respective attributes are always added to the ones that may exist at the step.

Request

PATH PARAMETERS
 
parameter
type
description
idInteger

- id of the test run.

stepResultIdInteger- id of the step.
Example
Example of input
{
   "id":"729",
   "status":"PASS",
   "comment":"The comment",
   "defects":[
      "TEST-114",
      "TEST-115",
      "TEST-116"
   ],
   "evidences":[
      {
         "filename":"test.txt",
         "contentType":"plain/text",
         "data":"(BASE64 encoding)"
      }
   ],
   "actualResult":"The actual result"
}

Responses

200 OK : text/plain : Successful.  

400 BAD_REQUEST : text/plain : Returns the error.

401 UNAUTHORIZED : text/plain : The Xray license is not valid.

500  INTERNAL SERVER ERROR : text/plain : An internal error occurred updating the test run step.

Status

  • To view the status of a Test Step, you need to specify the ID of the Test Run and the ID of the Test Step. 
  • To update the status of a Test Step, you need to specify the ID of the Test Run, the ID of the Test Step and the Status that you want the Test Step to have.


 GET api/testrun/{id}/step/{stepResultId}/status

Return a json that contains the test step status.

Request

PATH PARAMETERS
parameter
type
description
idInteger

- id of the test run.

stepResultIdInteger- id of the step.

Example Request

curl -H "Content-Type: application/json" -X GET -u admin:admin http://yourserver/rest/raven/1.0/api/testrun/3/step/2/status

Responses

200 OK : text/plain : Successful. Returns the name of the test step Status. 

Example Output
PASS

400 BAD_REQUEST : text/plain : Returns the error.

401 UNAUTHORIZED : text/plain : The Xray license is not valid.

500  INTERNAL SERVER ERROR : text/plain : An internal error occurred when getting the test run status.

 PUT api/testrun/{id}/step/{stepResultId}/status

Update the test step status.

Request

PATH PARAMETERS
parameter
type
description
idInteger

- id of the test run.

stepResultIdInteger- id of the step.
QUERY PARAMETERS
parametertypedescription
statusString- The status we want the test step to have.

Example Request

curl -H "Content-Type: application/json" -X PUT -u admin:admin http://yourserver/rest/raven/1.0/api/testrun/3/step/2/status?status=PASS

Responses

200 OK : text/plain : Successful.

400 BAD_REQUEST : text/plain : Returns the error.

401 UNAUTHORIZED : text/plain : The Xray license is not valid.

500  INTERNAL SERVER ERROR : text/plain : An internal error occurred when updating the test step status.

Execution Evidences

  • To view the execution evidences of a Test Step, you need to specify the ID of the Test Run and the ID of the Test Step.
  • To add a new execution evidence to the Test Run, a JSON is required.
  • To delete one or more execution evidences from the Test Run, you need to send a JSON with the file name of the evidence you want to delete. Another way to delete an execution evidence is to specify the evidence ID.


 GET api/testrun/{id}/step/{stepResultId}/attachment

Return a json that contains an array with all the execution evidences the test step has.

 Request

PATH PARAMETERS

 

parameter
type
description
idInteger

- id of the test run.

stepResultIdInteger- id of the step.

Responses

200 OK : text/plain : Successful. Returns a json with the test step execution evidences.

Example Output
[
   {
      "id":216,
      "fileName":"1 (24).feature",
      "fileSize":"0,4 kB",
      "created":"Wednesday 5:09 PM",
      "author":"admin",
      "fileURL":"http://YOURJIRA/jira/plugins/servlet/raven/attachment/253/1 (24).feature"
   }
]

400 BAD_REQUEST : text/plain : Returns the error.

401 UNAUTHORIZED : text/plain : The Xray license is not valid.

500  INTERNAL SERVER ERROR : text/plain : An internal error occurred when getting the evidences.

 POST api/testrun/{id}/step/{stepResultId}/attachment

Add a new evidence to the test step.

Request

PATH PARAMETERS
 
parameter
type
description
idInteger

- id of the test run.

stepResultIdInteger- id of the step.
Example
Example Input
{
   "data":"iVBORw0KGgoAAAANSUhEUgAABkIAAAO9CAYAAADezXv6AAAAAXNSR0IArs4c6QAA(...base64 file enconding)",
   "filename":"image21.jpg",
   "contentType":"image/jpeg"
}

Responses

200 OK : text/plain : Successful.

400 BAD_REQUEST : text/plain : Returns the error.

401 UNAUTHORIZED : text/plain : The Xray license is not valid.

500  INTERNAL SERVER ERROR : text/plain : An internal error occurred when inserting the evidences.

 DELETE api/testrun/{id}/step/{stepResultId}/attachment

Remove all evidences with the same filename from the test step.

Request

PATH PARAMETERS
 
parameter
type
description
idInteger

- id of the test run.

stepResultIdInteger- id of the step.
Example
Example Input
image.png

Responses

200 OK : text/plain : Successful.

400 BAD_REQUEST : text/plain : Returns the error.

401 UNAUTHORIZED : text/plain : The Xray license is not valid.

500  INTERNAL SERVER ERROR : text/plain : An internal error occurred when deleting the evidences.

 DELETE api/testrun/{id}/step/{stepResultId}/attachment/{attachmentid}

Remove the evidence with the given attachment id.

Request

PATH PARAMETERS
parametertypedescription
idInteger

- id of the test run.

stepResultIdInteger- id of the step.
attachmentIdInteger

- id of the attachment we want to delet


Responses

200 OK : text/plain : Successful.

400 BAD_REQUEST : text/plain : Returns the error.

401 UNAUTHORIZED : text/plain : The Xray license is not valid.

500  INTERNAL SERVER ERROR : text/plain : An internal error occurred when deleting the evidences.

  • No labels