# v2 API仕様書:test_cases --- ## GET /api/v2/test_suites/:test_suite_id/test_suite_versions/:test_suite_version_id/test_cases.json レスポンスコードが 200 で TestCase の一覧の JSON が返ること. ### Example #### Request ``` GET /api/v2/test_suites/91166/test_suite_versions/90595/test_cases?api_key=api_key_3 HTTP/1.1 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Content-Length: 0 Host: www.example.com ``` #### Response ``` HTTP/1.1 200 Access-Control-Allow-Headers: Origin, Content-Type, Accept, Authorization Access-Control-Allow-Methods: POST, PUT, DELETE, GET, OPTIONS Access-Control-Allow-Origin: * Access-Control-Request-Method: * Cache-Control: max-age=0, private, must-revalidate Content-Length: 60169 Content-Type: application/json; charset=utf-8 ETag: W/"4b0a2f47cb7ff55de5a626239190db57" Referrer-Policy: strict-origin-when-cross-origin X-Content-Type-Options: nosniff X-Download-Options: noopen X-Frame-Options: SAMEORIGIN X-Permitted-Cross-Domain-Policies: none X-Request-Id: d742a5ec-4125-42ac-a395-585d14c24271 X-Runtime: 0.165906 X-XSS-Protection: 1; mode=block { "total_pages": 2, "current_page": 1, "next_url": "http://www.example.com/api/v2/test_suites/91166/test_suite_versions/90595/test_cases?api_key=api_key_3&page=2", "test_cases": [ { "id": 1160070, "test_suite_version_id": 90595, "no": 1, "priority": null, "category1": null, "category2": null, "category3": null, "category4": null, "category5": null, "category6": null, "category7": null, "category8": null, "category9": null, "category10": null, "category11": null, "category12": null, "category13": null, "category14": null, "category15": null, "category16": null, "category17": null, "category18": null, "category19": null, "category20": null, "category21": null, "category22": null, "category23": null, "category24": null, "category25": null, "created_at": "2020-02-27T14:27:39.421+09:00", "updated_at": "2020-02-27T14:27:39.421+09:00" }, { "id": 1160071, "test_suite_version_id": 90595, "no": 2, "priority": null, "category1": null, "category2": null, "category3": null, "category4": null, "category5": null, "category6": null, "category7": null, "category8": null, "category9": null, "category10": null, "category11": null, "category12": null, "category13": null, "category14": null, "category15": null, "category16": null, "category17": null, "category18": null, "category19": null, "category20": null, "category21": null, "category22": null, "category23": null, "category24": null, "category25": null, "created_at": "2020-02-27T14:27:39.431+09:00", "updated_at": "2020-02-27T14:27:39.431+09:00" }, ... ] } ``` ## GET /api/v2/test_suites/:test_suite_id/test_suite_versions/:test_suite_version_id/test_cases.json レスポンスコードが 200 で next_url が nil の JSON が返ること. ### Example #### Request ``` GET /api/v2/test_suites/91167/test_suite_versions/90598/test_cases?api_key=api_key_4 HTTP/1.1 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Content-Length: 0 Host: www.example.com ``` #### Response ``` HTTP/1.1 200 Access-Control-Allow-Headers: Origin, Content-Type, Accept, Authorization Access-Control-Allow-Methods: POST, PUT, DELETE, GET, OPTIONS Access-Control-Allow-Origin: * Access-Control-Request-Method: * Cache-Control: max-age=0, private, must-revalidate Content-Length: 66 Content-Type: application/json; charset=utf-8 ETag: W/"9964b54243ab0bb6765747ade6442b5b" Referrer-Policy: strict-origin-when-cross-origin X-Content-Type-Options: nosniff X-Download-Options: noopen X-Frame-Options: SAMEORIGIN X-Permitted-Cross-Domain-Policies: none X-Request-Id: 0aa7b832-51f3-43e5-8f3a-1b0f0b9c75b4 X-Runtime: 0.038790 X-XSS-Protection: 1; mode=block { "total_pages": 0, "current_page": 1, "next_url": null, "test_cases": [ ] } ``` ## POST /api/v2/test_suites/:test_suite_id/test_suite_versions/:test_suite_version_id/test_cases.json TestCase が作成できること. ### Example #### Request ``` POST /api/v2/test_suites/91168/test_suite_versions/90599/test_cases?api_key=api_key_5 HTTP/1.1 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Content-Length: 3470 Content-Type: application/x-www-form-urlencoded Host: www.example.com test_case[id]&test_case[test_suite_version_id]&test_case[no]=304&test_case[created_at]&test_case[updated_at]&test_case[category1]&test_case[category2]&test_case[category3]&test_case[priority]&test_case[category4]&test_case[category5]&test_case[category6]&test_case[category7]&test_case[category8]&test_case[category9]&test_case[category10]&test_case[category11]&test_case[category12]&test_case[category13]&test_case[category14]&test_case[category15]&test_case[category16]&test_case[category17]&test_case[category18]&test_case[category19]&test_case[category20]&test_case[category21]&test_case[category22]&test_case[category23]&test_case[category24]&test_case[category25]&test_case[category26]&test_case[category27]&test_case[category28]&test_case[category29]&test_case[category30]&test_case[category31]&test_case[category32]&test_case[category33]&test_case[category34]&test_case[category35]&test_case[category36]&test_case[category37]&test_case[category38]&test_case[category39]&test_case[category40]&test_case[category41]&test_case[category42]&test_case[category43]&test_case[category44]&test_case[category45]&test_case[category46]&test_case[category47]&test_case[category48]&test_case[category49]&test_case[category50]&test_case[category51]&test_case[category52]&test_case[category53]&test_case[category54]&test_case[category55]&test_case[category56]&test_case[category57]&test_case[category58]&test_case[category59]&test_case[category60]&test_case[category61]&test_case[category62]&test_case[category63]&test_case[category64]&test_case[category65]&test_case[category66]&test_case[category67]&test_case[category68]&test_case[category69]&test_case[category70]&test_case[category71]&test_case[category72]&test_case[category73]&test_case[category74]&test_case[category75]&test_case[category76]&test_case[category77]&test_case[category78]&test_case[category79]&test_case[category80]&test_case[category81]&test_case[category82]&test_case[category83]&test_case[category84]&test_case[category85]&test_case[category86]&test_case[category87]&test_case[category88]&test_case[category89]&test_case[category90]&test_case[category91]&test_case[category92]&test_case[category93]&test_case[category94]&test_case[category95]&test_case[category96]&test_case[category97]&test_case[category98]&test_case[category99]&test_case[category100]&test_case[category101]&test_case[category102]&test_case[category103]&test_case[category104]&test_case[category105]&test_case[category106]&test_case[category107]&test_case[category108]&test_case[category109]&test_case[category110]&test_case[category111]&test_case[category112]&test_case[category113]&test_case[category114]&test_case[category115]&test_case[category116]&test_case[category117]&test_case[category118]&test_case[category119]&test_case[category120]&test_case[category121]&test_case[category122]&test_case[category123]&test_case[category124]&test_case[category125]&test_case[category126]&test_case[category127]&test_case[category128]&test_case[category129]&test_case[category130]&test_case[category131]&test_case[category132]&test_case[category133]&test_case[category134]&test_case[category135]&test_case[category136]&test_case[category137]&test_case[category138]&test_case[category139]&test_case[category140]&test_case[category141]&test_case[category142]&test_case[category143]&test_case[category144]&test_case[category145]&test_case[category146]&test_case[category147]&test_case[category148]&test_case[category149]&test_case[category150] ``` #### Response ``` HTTP/1.1 201 Access-Control-Allow-Headers: Origin, Content-Type, Accept, Authorization Access-Control-Allow-Methods: POST, PUT, DELETE, GET, OPTIONS Access-Control-Allow-Origin: * Access-Control-Request-Method: * Cache-Control: max-age=0, private, must-revalidate Content-Length: 600 Content-Type: application/json; charset=utf-8 ETag: W/"a6bc09ce7a87632aaa0f1143848924ef" Referrer-Policy: strict-origin-when-cross-origin X-Content-Type-Options: nosniff X-Download-Options: noopen X-Frame-Options: SAMEORIGIN X-Permitted-Cross-Domain-Policies: none X-Request-Id: 6eba6566-27be-4468-a17f-b28b4f7785ff X-Runtime: 0.223905 X-XSS-Protection: 1; mode=block { "id": 1160373, "test_suite_version_id": 90599, "no": 304, "priority": null, "category1": null, "category2": null, "category3": null, "category4": null, "category5": null, "category6": null, "category7": null, "category8": null, "category9": null, "category10": null, "category11": null, "category12": null, "category13": null, "category14": null, "category15": null, "category16": null, "category17": null, "category18": null, "category19": null, "category20": null, "category21": null, "category22": null, "category23": null, "category24": null, "category25": null, "created_at": "2020-02-27T14:27:43.177+09:00", "updated_at": "2020-02-27T14:27:43.177+09:00" } ``` ## POST /api/v2/test_suites/:test_suite_id/test_suite_versions/:test_suite_version_id/test_cases.json TestCase が作成されないこと. ### Example #### Request ``` POST /api/v2/test_suites/91169/test_suite_versions/90601/test_cases?api_key=api_key_6 HTTP/1.1 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Content-Length: 3466 Content-Type: application/x-www-form-urlencoded Host: www.example.com test_case[id]&test_case[test_suite_version_id]&test_case[no]&test_case[created_at]&test_case[updated_at]&test_case[category1]&test_case[category2]&test_case[category3]&test_case[priority]&test_case[category4]&test_case[category5]&test_case[category6]&test_case[category7]&test_case[category8]&test_case[category9]&test_case[category10]&test_case[category11]&test_case[category12]&test_case[category13]&test_case[category14]&test_case[category15]&test_case[category16]&test_case[category17]&test_case[category18]&test_case[category19]&test_case[category20]&test_case[category21]&test_case[category22]&test_case[category23]&test_case[category24]&test_case[category25]&test_case[category26]&test_case[category27]&test_case[category28]&test_case[category29]&test_case[category30]&test_case[category31]&test_case[category32]&test_case[category33]&test_case[category34]&test_case[category35]&test_case[category36]&test_case[category37]&test_case[category38]&test_case[category39]&test_case[category40]&test_case[category41]&test_case[category42]&test_case[category43]&test_case[category44]&test_case[category45]&test_case[category46]&test_case[category47]&test_case[category48]&test_case[category49]&test_case[category50]&test_case[category51]&test_case[category52]&test_case[category53]&test_case[category54]&test_case[category55]&test_case[category56]&test_case[category57]&test_case[category58]&test_case[category59]&test_case[category60]&test_case[category61]&test_case[category62]&test_case[category63]&test_case[category64]&test_case[category65]&test_case[category66]&test_case[category67]&test_case[category68]&test_case[category69]&test_case[category70]&test_case[category71]&test_case[category72]&test_case[category73]&test_case[category74]&test_case[category75]&test_case[category76]&test_case[category77]&test_case[category78]&test_case[category79]&test_case[category80]&test_case[category81]&test_case[category82]&test_case[category83]&test_case[category84]&test_case[category85]&test_case[category86]&test_case[category87]&test_case[category88]&test_case[category89]&test_case[category90]&test_case[category91]&test_case[category92]&test_case[category93]&test_case[category94]&test_case[category95]&test_case[category96]&test_case[category97]&test_case[category98]&test_case[category99]&test_case[category100]&test_case[category101]&test_case[category102]&test_case[category103]&test_case[category104]&test_case[category105]&test_case[category106]&test_case[category107]&test_case[category108]&test_case[category109]&test_case[category110]&test_case[category111]&test_case[category112]&test_case[category113]&test_case[category114]&test_case[category115]&test_case[category116]&test_case[category117]&test_case[category118]&test_case[category119]&test_case[category120]&test_case[category121]&test_case[category122]&test_case[category123]&test_case[category124]&test_case[category125]&test_case[category126]&test_case[category127]&test_case[category128]&test_case[category129]&test_case[category130]&test_case[category131]&test_case[category132]&test_case[category133]&test_case[category134]&test_case[category135]&test_case[category136]&test_case[category137]&test_case[category138]&test_case[category139]&test_case[category140]&test_case[category141]&test_case[category142]&test_case[category143]&test_case[category144]&test_case[category145]&test_case[category146]&test_case[category147]&test_case[category148]&test_case[category149]&test_case[category150] ``` #### Response ``` HTTP/1.1 422 Access-Control-Allow-Headers: Origin, Content-Type, Accept, Authorization Access-Control-Allow-Methods: POST, PUT, DELETE, GET, OPTIONS Access-Control-Allow-Origin: * Access-Control-Request-Method: * Cache-Control: no-cache Content-Length: 38 Content-Type: application/json; charset=utf-8 Referrer-Policy: strict-origin-when-cross-origin X-Content-Type-Options: nosniff X-Download-Options: noopen X-Frame-Options: SAMEORIGIN X-Permitted-Cross-Domain-Policies: none X-Request-Id: f492f43d-2319-426f-84bf-c398fe80903b X-Runtime: 0.042937 X-XSS-Protection: 1; mode=block { "no": [ "を入力してください" ] } ``` ## PATCH /api/v2/test_suites/:test_suite_id/test_suite_versions/:test_suite_version_id/test_cases/:id.json TestCase が更新できること. ### Example #### Request ``` PATCH /api/v2/test_suites/91170/test_suite_versions/90603/test_cases/1160475?api_key=api_key_7 HTTP/1.1 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Content-Length: 29 Content-Type: application/x-www-form-urlencoded Host: www.example.com test_case[category1]=testtest ``` #### Response ``` HTTP/1.1 200 Access-Control-Allow-Headers: Origin, Content-Type, Accept, Authorization Access-Control-Allow-Methods: POST, PUT, DELETE, GET, OPTIONS Access-Control-Allow-Origin: * Access-Control-Request-Method: * Cache-Control: max-age=0, private, must-revalidate Content-Length: 606 Content-Type: application/json; charset=utf-8 ETag: W/"2dbfe41bc62346314220b2a0e8a92bff" Referrer-Policy: strict-origin-when-cross-origin X-Content-Type-Options: nosniff X-Download-Options: noopen X-Frame-Options: SAMEORIGIN X-Permitted-Cross-Domain-Policies: none X-Request-Id: a0b0534e-2217-4350-9fa3-394e8f523599 X-Runtime: 0.057456 X-XSS-Protection: 1; mode=block { "id": 1160475, "test_suite_version_id": 90603, "no": 406, "priority": null, "category1": "testtest", "category2": null, "category3": null, "category4": null, "category5": null, "category6": null, "category7": null, "category8": null, "category9": null, "category10": null, "category11": null, "category12": null, "category13": null, "category14": null, "category15": null, "category16": null, "category17": null, "category18": null, "category19": null, "category20": null, "category21": null, "category22": null, "category23": null, "category24": null, "category25": null, "created_at": "2020-02-27T14:27:44.900+09:00", "updated_at": "2020-02-27T14:27:46.212+09:00" } ``` ## PATCH /api/v2/test_suites/:test_suite_id/test_suite_versions/:test_suite_version_id/test_cases/:id.json TestCase が更新されないこと. ### Example #### Request ``` PATCH /api/v2/test_suites/91171/test_suite_versions/90605/test_cases/1160576?api_key=api_key_8 HTTP/1.1 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Content-Length: 13 Content-Type: application/x-www-form-urlencoded Host: www.example.com test_case[no] ``` #### Response ``` HTTP/1.1 422 Access-Control-Allow-Headers: Origin, Content-Type, Accept, Authorization Access-Control-Allow-Methods: POST, PUT, DELETE, GET, OPTIONS Access-Control-Allow-Origin: * Access-Control-Request-Method: * Cache-Control: no-cache Content-Length: 38 Content-Type: application/json; charset=utf-8 Referrer-Policy: strict-origin-when-cross-origin X-Content-Type-Options: nosniff X-Download-Options: noopen X-Frame-Options: SAMEORIGIN X-Permitted-Cross-Domain-Policies: none X-Request-Id: 5d757e56-c758-4cba-a673-971c41f8d7a7 X-Runtime: 0.040951 X-XSS-Protection: 1; mode=block { "no": [ "を入力してください" ] } ``` ## DELETE /api/v2/test_suites/:test_suite_id/test_suite_versions/:test_suite_version_id/test_cases/:id.json TestCase が削除されること. ### Example #### Request ``` DELETE /api/v2/test_suites/91172/test_suite_versions/90607/test_cases/1160677?api_key=api_key_9 HTTP/1.1 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Content-Length: 0 Content-Type: application/x-www-form-urlencoded Host: www.example.com ``` #### Response ``` HTTP/1.1 204 Access-Control-Allow-Headers: Origin, Content-Type, Accept, Authorization Access-Control-Allow-Methods: POST, PUT, DELETE, GET, OPTIONS Access-Control-Allow-Origin: * Access-Control-Request-Method: * Cache-Control: no-cache Referrer-Policy: strict-origin-when-cross-origin X-Content-Type-Options: nosniff X-Download-Options: noopen X-Frame-Options: SAMEORIGIN X-Permitted-Cross-Domain-Policies: none X-Request-Id: e21aa4e2-1ed3-4e5b-bace-1fc33a2c80b8 X-Runtime: 0.049592 X-XSS-Protection: 1; mode=block ```