Test Examples

  • To view a specific Test Example from a (Cucumber Scenario Outline) Test Run, you need to specify the ID of the Test Run and the index of the test example (from 0 to number of test examples minus 1).
  • To update the status, an additional parameter is required: the Status that you want the Test Example to have.
 GET /api/testrun/{id}/example/{exampleIndex}

Return a json that represents the test run.

Request

PATH PARAMETERS
parametertypedescription
idInteger

- id of the test run.

exampleIndexInteger- index of the example.

Responses

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

Example Output
{
  "id": 5068,
  "rank": 1,
  "values": [
    "0",
    "factorial",
    "1"
  ],
  "status": "PASS",
  "statusDescription": "The test run has passed",
  "duration": "0 millisec",
  "backgrounds": [
    {
      "id": 1337,
      "rank": 1,
      "type": "background",
      "keyword": "Given ",
      "name": "a calculator I just turned on",
      "duration": "0 millisec",
      "status": "PASS"
    }
  ],
  "hooks": [
    {
      "id": 1338,
      "rank": 2,
      "type": "hook",
      "keyword": "Before",
      "name": "FactorialCalculator.setUp()",
      "duration": "0 millisec",
      "status": "PASS"
    },
    {
      "id": 1339,
      "rank": 3,
      "type": "hook",
      "keyword": "After",
      "name": "FactorialCalculator.tearDown()",
      "duration": "0 millisec",
      "status": "PASS"
    }
  ],
  "steps": [
    {
      "id": 1340,
      "rank": 4,
      "type": "scenario",
      "keyword": "Given ",
      "name": "I have entered 3 into the calculator",
      "duration": "0 millisec",
      "status": "PASS"
    },
    {
      "id": 1341,
      "rank": 5,
      "type": "scenario",
      "keyword": "When ",
      "name": "I press factorial",
      "duration": "0 millisec",
      "status": "PASS"
    },
    {
      "id": 1342,
      "rank": 6,
      "type": "scenario",
      "keyword": "Then ",
      "name": "the result should be 6 on the screen",
      "duration": "0 millisec",
      "status": "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 getting the test run example.


The Cucumber Scenarios Example/Result details (i.e., Hooks, Backgrounds and Steps) are only available for executions done in Xray v2.2.0 and above.

 PUT /api/testrun/{id}/example/{exampleIndex}

Update the test run example status.

Request

PATH PARAMETERS
 
parametertypedescription
idInteger

- ID of the test run.

exampleIndexInteger- index of the example.
QUERY PARAMETERS
parametertypedescription
statusString- The status you want the test run to have.

Responses

200 OK : text/plain : Successful.

400 BAD_REQUEST : text/plain : Returns the error.

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

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

  • No labels