Test Case Folders

This chapter focuses on services for the test case folders.

Get all test case folders

A GET to /test-case-folders returns all the test case folders that the client is allowed to read.

HTTP request

GET /api/rest/latest/test-case-folders?page=1&size=3 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)

sort

which attributes of the returned entities should be sorted on (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: 1414

{
  "_embedded" : {
    "test-case-folders" : [ {
      "_type" : "test-case-folder",
      "id" : 100,
      "name" : "top-secret",
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/api/rest/latest/test-case-folders/100"
        }
      }
    }, {
      "_type" : "test-case-folder",
      "id" : 101,
      "name" : "confidential",
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/api/rest/latest/test-case-folders/101"
        }
      }
    }, {
      "_type" : "test-case-folder",
      "id" : 102,
      "name" : "restricted access",
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/api/rest/latest/test-case-folders/102"
        }
      }
    } ]
  },
  "_links" : {
    "first" : {
      "href" : "http://localhost:8080/api/rest/latest/test-case-folders?page=0&size=3"
    },
    "prev" : {
      "href" : "http://localhost:8080/api/rest/latest/test-case-folders?page=0&size=3"
    },
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/test-case-folders?page=1&size=3"
    },
    "next" : {
      "href" : "http://localhost:8080/api/rest/latest/test-case-folders?page=2&size=3"
    },
    "last" : {
      "href" : "http://localhost:8080/api/rest/latest/test-case-folders?page=3&size=3"
    }
  },
  "page" : {
    "size" : 3,
    "totalElements" : 10,
    "totalPages" : 4,
    "number" : 1
  }
}

Response fields

Path Type Description

_embedded.test-case-folders

Array

the list of elements for that page

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)

Get test case folder

A GET to /test-case-folders/{id} returns the test case folder with the given id.

Path parameters

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

id

the id of the test case folder

HTTP request

GET /api/rest/latest/test-case-folders/24 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: 1250

{
  "_type" : "test-case-folder",
  "id" : 24,
  "name" : "Recipes : A-F",
  "project" : {
    "_type" : "project",
    "id" : 10,
    "name" : "Recipes inventory",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/projects/10"
      }
    }
  },
  "path" : "/Recipes inventory/Recipes : A-F",
  "parent" : {
    "_type" : "project",
    "id" : 10,
    "name" : "Recipes inventory",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/projects/10"
      }
    }
  },
  "created_by" : "User-1",
  "created_on" : "2011-09-30T10:00:00.000+0000",
  "last_modified_by" : "admin",
  "last_modified_on" : "2017-06-16T10:00:00.000+0000",
  "description" : "<p>All recipes in alphabetical order from A to F inclusive</p>",
  "attachments" : [ ],
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/test-case-folders/24"
    },
    "project" : {
      "href" : "http://localhost:8080/api/rest/latest/projects/10"
    },
    "content" : {
      "href" : "http://localhost:8080/api/rest/latest/test-case-folders/24/content"
    },
    "attachments" : {
      "href" : "http://localhost:8080/api/rest/latest/test-case-folders/24/attachments"
    }
  }
}

Response fields

Path Type Description

id

Number

the id of the entity

_type

String

the type of the entity

name

String

name of the entity

project

Object

project of the entity

parent

Object

the location of the entity (either a folder or the project if located at the root of the library)

path

String

the path of the entity

created_by

String

user that created the entity

created_on

String

timestamp of the creation (ISO 8601)

last_modified_by

String

user that modified the entity the most recently

last_modified_on

String

timestamp of last modification (ISO 8601)

description

String

description of that entity (html)

attachments

Array

the attachments of that entity

_links

Varies

related links

Relation Description

self

the link to this folder

project

the link to its project

content

the link to its content

attachments

the link to its attachments

Get test case folder contents

A GET to /test-case-folders/{id}/content returns the content of the test case folder with the given id.

Path parameters

Table 1. /api/rest/latest/test-case-folders/{id}/content
Parameter Description

id

the id of the test-case-folder

HTTP request

GET /api/rest/latest/test-case-folders/180/content 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)

sort

which attributes of the returned entities should be sorted on (optional)

fields

which fields of the elements should be returned (optional)

include

level of depth of the content that should be returned (optional)

HTTP response

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

{
  "_embedded" : {
    "content" : [ {
      "_type" : "test-case",
      "id" : 13,
      "name" : "walk test",
      "reference" : "",
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/api/rest/latest/test-cases/13"
        }
      }
    }, {
      "_type" : "test-case",
      "id" : 150,
      "name" : "fly test",
      "reference" : "",
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/api/rest/latest/test-cases/150"
        }
      }
    }, {
      "_type" : "test-case-folder",
      "id" : 1467,
      "name" : "other, non-natural motions",
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/api/rest/latest/test-case-folders/1467"
        }
      }
    } ]
  },
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/test-case-folders/180/content?page=0&size=20"
    }
  },
  "page" : {
    "size" : 20,
    "totalElements" : 3,
    "totalPages" : 1,
    "number" : 0
  }
}

Response fields

Path Type Description

_embedded.content

Array

the list of elements for that page

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)