Test Suites

This chapter focuses on services for the test suites.

Get test suite

A GET to /test-suites/{id} returns the test suite with the given id.

Path parameters

Table 1. /api/rest/latest/test-suites/{id}
Parameter Description

id

the id of the test suite

HTTP request

GET /api/rest/latest/test-suites/9 HTTP/1.1
Accept: application/json
Host: localhost:8080

Request parameters

Parameter Description

fields

which fields of the elements should be returned (optional)

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 2662

{
  "_type" : "test-suite",
  "id" : 9,
  "name" : "sample test suite",
  "description" : "<p>this is a sample test suite</p>",
  "parent" : {
    "_type" : "iteration",
    "id" : 101,
    "name" : "second iteration",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/iterations/101"
      }
    }
  },
  "created_by" : "admin",
  "created_on" : "2017-07-12T10:00:00Z",
  "last_modified_by" : "admin",
  "last_modified_on" : "2017-07-12T10:00:00Z",
  "custom_fields" : [ {
    "code" : "CF_TXT",
    "label" : "cuf text",
    "value" : "the_value"
  }, {
    "code" : "CF_TAG",
    "label" : "cuf tag",
    "value" : [ "tag_1", "tag_2" ]
  } ],
  "test_plan" : [ {
    "_type" : "iteration-test-plan-item",
    "id" : 80,
    "execution_status" : "READY",
    "referenced_test_case" : {
      "_type" : "test-case",
      "id" : 90,
      "name" : "first test case",
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/api/rest/latest/test-cases/90"
        }
      }
    },
    "referenced_dataset" : {
      "_type" : "dataset",
      "id" : 5,
      "name" : "dataset",
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/api/rest/latest/datasets/5"
        }
      }
    },
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/iteration-test-plan-items/80"
      }
    }
  }, {
    "_type" : "iteration-test-plan-item",
    "id" : 41,
    "execution_status" : "SUCCESS",
    "referenced_test_case" : {
      "_type" : "test-case",
      "id" : 91,
      "name" : "test case 2",
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/api/rest/latest/test-cases/91"
        }
      }
    },
    "referenced_dataset" : {
      "_type" : "dataset",
      "id" : 9,
      "name" : "dataset",
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/api/rest/latest/datasets/9"
        }
      }
    },
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/iteration-test-plan-items/41"
      }
    }
  } ],
  "attachments" : [ ],
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/test-suites/9"
    },
    "project" : {
      "href" : "http://localhost:8080/api/rest/latest/projects/15"
    },
    "iteration" : {
      "href" : "http://localhost:8080/api/rest/latest/iterations/101"
    },
    "test-plan" : {
      "href" : "http://localhost:8080/api/rest/latest/test-suites/9/test-plan"
    },
    "attachments" : {
      "href" : "http://localhost:8080/api/rest/latest/test-suites/9/attachments"
    }
  }
}

Response fields

Path Type Description

id

Number

the id of the test suite

_type

String

the type of the entity

name

String

the name of the test suite

description

String

the description of the test suite

parent

Object

the parent entity of the test suite

created_by

String

the user who created the test suite

created_on

String

the date the test suite was created

last_modified_by

String

the user who last modified the test suite

last_modified_on

String

the date the test suite was last modified

custom_fields

Array

the custom fields of the test suite

test_plan

Array

the iteration test plan items of the test suite

attachments

Array

the attachments of the test suite

_links

Object

related links

Relation Description

self

link to this test suite

project

link to the project the test suite belongs to

iteration

link to the iteration the test suite belongs to

test-plan

link the test plan of the test suite

attachments

link the test plan of the test suite

Get plans of test suite

A GET to /test-suites/{id}/test-plan returns all the test plans of the test suite with the given id.

Path parameters

Table 1. /api/rest/latest/test-suites/{id}/test-plan
Parameter Description

id

the id of the test suite

HTTP request

GET /api/rest/latest/test-suites/44/test-plan HTTP/1.1
Accept: application/json
Host: localhost:8080

Request parameters

Parameter Description

page

number of the page to retrieve (optional)

size

size of the page to retrieve (optional)

fields

which fields of the elements should be returned (optional)

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 4396

{
  "_embedded" : {
    "test-plan" : [ {
      "_type" : "iteration-test-plan-item",
      "id" : 1,
      "execution_status" : "BLOCKED",
      "referenced_test_case" : {
        "_type" : "test-case",
        "id" : 1,
        "name" : "sample test case 1",
        "reference" : "",
        "_links" : {
          "self" : {
            "href" : "http://localhost:8080/api/rest/latest/test-cases/1"
          }
        }
      },
      "referenced_dataset" : {
        "_type" : "dataset",
        "id" : 1,
        "name" : "sample dataset 1",
        "_links" : {
          "self" : {
            "href" : "http://localhost:8080/api/rest/latest/datasets/1"
          }
        }
      },
      "last_executed_by" : "User-1",
      "last_executed_on" : "2017-07-13T10:00:00Z",
      "assigned_to" : "User-1",
      "executions" : [ {
        "_type" : "execution",
        "id" : 11,
        "execution_status" : "FAILURE",
        "last_executed_by" : "User-1",
        "last_executed_on" : "2017-07-13T10:00:00Z",
        "_links" : {
          "self" : {
            "href" : "http://localhost:8080/api/rest/latest/executions/11"
          }
        }
      }, {
        "_type" : "execution",
        "id" : 21,
        "execution_status" : "BLOCKED",
        "last_executed_by" : "User-1",
        "last_executed_on" : "2017-07-13T10:00:00Z",
        "_links" : {
          "self" : {
            "href" : "http://localhost:8080/api/rest/latest/executions/21"
          }
        }
      } ],
      "iteration" : {
        "_type" : "iteration",
        "id" : 1,
        "name" : "sample iteration 1",
        "reference" : "IT1",
        "_links" : {
          "self" : {
            "href" : "http://localhost:8080/api/rest/latest/iterations/1"
          }
        }
      },
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/api/rest/latest/iteration-test-plan-items/1"
        }
      }
    }, {
      "_type" : "iteration-test-plan-item",
      "id" : 2,
      "execution_status" : "SUCCESS",
      "referenced_test_case" : {
        "_type" : "test-case",
        "id" : 2,
        "name" : "sample test case 2",
        "reference" : "",
        "_links" : {
          "self" : {
            "href" : "http://localhost:8080/api/rest/latest/test-cases/2"
          }
        }
      },
      "referenced_dataset" : {
        "_type" : "dataset",
        "id" : 2,
        "name" : "sample dataset 2",
        "_links" : {
          "self" : {
            "href" : "http://localhost:8080/api/rest/latest/datasets/2"
          }
        }
      },
      "last_executed_by" : "User-2",
      "last_executed_on" : "2017-07-15T10:00:00Z",
      "assigned_to" : "User-2",
      "executions" : [ {
        "_type" : "execution",
        "id" : 12,
        "execution_status" : "SUCCESS",
        "last_executed_by" : "User-2",
        "last_executed_on" : "2017-07-07T10:00:00Z",
        "_links" : {
          "self" : {
            "href" : "http://localhost:8080/api/rest/latest/executions/12"
          }
        }
      }, {
        "_type" : "execution",
        "id" : 22,
        "execution_status" : "BLOCKED",
        "last_executed_by" : "User-2",
        "last_executed_on" : "2017-07-15T10:00:00Z",
        "_links" : {
          "self" : {
            "href" : "http://localhost:8080/api/rest/latest/executions/22"
          }
        }
      }, {
        "_type" : "execution",
        "id" : 32,
        "execution_status" : "RUNNING",
        "last_executed_by" : "User-2",
        "last_executed_on" : "2017-07-20T10:00:00Z",
        "_links" : {
          "self" : {
            "href" : "http://localhost:8080/api/rest/latest/executions/32"
          }
        }
      } ],
      "iteration" : {
        "_type" : "iteration",
        "id" : 2,
        "name" : "sample iteration 2",
        "reference" : "IT2",
        "_links" : {
          "self" : {
            "href" : "http://localhost:8080/api/rest/latest/iterations/2"
          }
        }
      },
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/api/rest/latest/iteration-test-plan-items/2"
        }
      }
    } ]
  },
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/test-suites/44/test-plan"
    }
  },
  "page" : {
    "size" : 20,
    "totalElements" : 2,
    "totalPages" : 1,
    "number" : 0
  }
}

Response fields

Path Type Description

_embedded.test-plan

Array

the iteration test plan items of this test suite

page.size

Number

the page size for that query

page.totalElements

Number

total number of elements the client is allowed to read

page.totalPages

Number

how many pages can be browsed

page.number

Number

the page number

_links

Object

related links

Relation Description

first

link to the first page (optional)

prev

link to the previous page (optional)

self

link to this page

next

link to the next page (optional)

last

link to the last page (optional)