Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Expand
titlePUT /rest/raven/1.0/api/testrun/{id}/
Panel
borderColor#ccc
borderStylesolid

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

Request

PATH PARAMETERS
parametertypedescription
idinteger

- ID of the test run.

Example
Code Block
titleExample Input 1
{
	"status": "FAIL",
	"assignee": "john.doe",
	"comment": "new comment",
	"defects": {
		"add": [
			"test-114",
			"test-115",
			"test-116"
		]
	},
	"evidences": {
		"add": [{
			"filename": "test1.txt",
			"contentType": "plain/text",
			"data": "(base64 encoding...)"
		}, {
			"filename": "test2.txt",
			"contentType": "plain/text",
			"data": "(base64 encoding...)"
		}],
		"remove": ["254", "443"]
	},
	"examples": [{
		"id": "1379",
		"status": "TODO"
	}]
}

 

Code Block
titleExample Input 2
{
	"status": "FAIL",
	"comment": "new comment",
	"defects": {
		"add": [
			"test-114",
			"test-115",
			"test-116"
		]
	},
	"evidences": {
		"add": [{
			"filename": "test1.txt",
			"contentType": "plain/text",
			"data": "(base64 encoding...)"
		}, {
			"filename": "test2.txt",
			"contentType": "plain/text",
			"data": "(base64 encoding...)"
		}],
		"remove": ["254", "443"]
	},
	"steps": [{
		"id": "731",
		"status": "TODO",
		"comment": "the comment 1"
	}, {
		"id": "730",
		"status": "PASS",
		"defects": {
			"add": [
				"test-114",
				"test-115",
				"test-116",
				"appId=a364a9c7-9ac0-3183-9175-353c1331692a&issue=SDP-5"
			]
		},
		"evidences": {
			"add": [{
				"filename": "test1.txt",
				"contentType": "plain/text",
				"data": "(base64 encoding...)"
			}, {
				"filename": "test2.txt",
				"contentType": "plain/text",
				"data": "(base64 encoding...)"
			}],
			"remove": ["274", "543"]
		}
	}]
}
Code Block
titleExample Input 3
{
    "status": "FAIL",
    "defects": {"add":["appId=a364a9c7-9ac0-3183-9175-353c1331692a&issue=SDP-5"], "remove":["DCW-9", "appId=a364a9c7-9ac0-3183-9175-353c1331692a&issue=SDP-1"]},
    "evidences": [],
    "steps": [
        {
            "id": 43,
            "status": "PASS",
            "comment": "",
            "defects": {"add":[], "remove":["DCW-9"]},
            "evidences": []
        },
        {
            "id": 44,
            "status": "FAIL",
            "defects": {},
            "evidences": []
        },
        {
            "id": 45,
            "status": "FAIL",
            "defects": {},
            "evidences": []
        }
    ]
}
Tip
titleExample Request
curl -H "Content-Type: application/json" -X PUT -u admin:admin --data @example.json http://yourserver / rest/raven/1.0/api/testrun/1


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.

...

Expand
titlePUT /rest/raven/1.0/api/testrun/{id}/status
Panel
borderColor#ccc
borderStylesolid

Updates the test run status.

Request

PATH PARAMETERS
parametertypedescription
idinteger

- ID of the test run.

QUERY PARAMETERS
parametertypedescription
statusString- The status you want the test run to have.
Tip
titleExample Request
curl -H "Content-Type: application/json" -X PUT -u admin:admin http://yourserver/rest/raven/1.0/api/testrun/3/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 run status.

Execution

...

Defects

  • To view the defects of a Test Run, you need to specify the ID of the Test Run.
  • To add a new defect to the Test Run, a JSON with an of issue keys the defect issue key(s) is required.
  • To delete one or more defects from the Test Run, you need to specify the key of the issue you want to delete.

...

Expand
titleDELETE /rest/raven/1.0/api/testrun/{id}/defect/{issueIdOrKey}
Panel
borderColor#ccc
borderStylesolid

Remove one or more defects from the test run.

  Request

PATH PARAMETERS
parametertypedescription
idinteger

- ID of the test run.

issueIdOrKeyString or Integer

- ID or key of the issue you want to remove from the defects.

Tip
titleExample Request
curl -H "Content-Type: application/json" -X DELETE -u admin:admin http://yourserver / rest/raven/1.0/api/testrun/2/defect/TEST-421

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 defects.

Execution

...

Evidence

  • To view the execution evidences evidence of a Test Run, you need to specify the ID of the Test Run. 
  • To add a new execution evidence to evidence to the Test Run, a JSON is required.
  • To delete one or more execution evidences evidence 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.

...

Expand
titleGET /rest/raven/1.0/api/testrun/{id}/attachment
Panel
borderColor#ccc
borderStylesolid

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

  Request

PATH PARAMETERS
parametertypedescription
idinteger

- id of the test run.

Tip
titleExample Request
curl -H "Content-Type: application/json" -X GET -u admin:admin http://yourserver/rest/raven/1.0/api/testrun/3/attachment

Responses

200 OK : text/plain : Successful. Returns a json with the test run execution evidencesevidence.

Code Block
titleExample Output
[
   {
      "id":253,
      "fileName":"TestdataPoorPerfomance.csv",
      "fileSize":"35 kB",
      "created":"2016-10-24T15:50:57+01:00",
      "author":"admin",
	  "fileURL": "http://YOURJIRA/jira/plugins/servlet/raven/attachment/253/TestdataPoorPerfomance.csv"
   },
   {
      "id":254,
      "fileName":"testfile.txt",
      "fileSize":"35 kB",
      "created":"2016-10-24T16:50:57+01:00",
      "author":"admin"
	  "fileURL": "http://YOURJIRA/jira/plugins/servlet/raven/attachment/254/testfile.txt"
   }
]

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 evidencesevidence.

Expand
titlePOST /rest/raven/1.0/api/testrun/{id}/attachment
Panel
borderColor#ccc
borderStylesolid

Add a new evidence to the test run.

Request

PATH PARAMETERS
parametertypedescription
idinteger

- id of the test run.

Example
Code Block
titleExample Input
{
   "data":"iVBORw0KGgoAAAANSUhEUgAABkIAAAO9CAYAAADezXv6AAAAAXNSR0IArs4c6QAA(...base64 file enconding)",
   "filename":"image21.jpg",
   "contentType":"image/jpeg"
}
Tip
titleExample Request
curl -H "Content-Type: application/json" -X POST -u admin:admin --data @example.json http://yourserver / rest/raven/1.0/api/testrun/2/attachment

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.

...

Expand
titleGET /rest/raven/1.0/api/testrun/{id}/step
Panel
borderColor#ccc
borderStylesolid

Return a json that contains all of the test run steps.

Request

PATH PARAMETERS
parametertypedescription
idinteger

- id of the test run.

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

Responses

200 OK : text/plain : Successful. Returns a json with the test run steps.

Code Block
titleExample 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":"2016-10-24T15:50:57+01:00",
            "author":"admin"
			"fileURL": "http://YOURJIRA/jira/plugins/servlet/raven/attachment/253/1 (24).feature"
         }
      ],
	  "actualResult": {
      	"raw": "Actual result on step 1",
        "rendered": "<p>Actual result on step 1</p>"
      }
   },
   {
      "id":730,
      "index":2,
      "step":{
         "raw":"asfd",
         "rendered":"<p>asfd</p>"
      },
      "data":{
         "raw":"aaa",
         "rendered":"<p>aaa</p>"
      },
      "result":{
         "raw":"aaaa",
         "rendered":"<p>aaaa</p>"
      },
      "attachments":[
      ],
      "status":"FAIL",
      "comment":{
         "raw":"aaaaa\n",
         "rendered":"<p>aaaaa</p>"
      },
      "defects":[
      ],
      "evidences":[
      ],
	  "actualResult": {
		"rendered": ""
	  }
   }
]

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 steps.

...