# v2 API仕様書:test_cycles --- ## GET /api/v2/test_phases/:test_phase_id/test_suite_assignments/:test_suite_assignment_id/test_cycles.json レスポンスコードが 200 で TestCycle の一覧の JSON が返ること. ### Example #### Request ``` GET /api/v2/test_phases/2713/test_suite_assignments/3636/test_cycles?api_key=api_key_1 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: 32273 Content-Type: application/json; charset=utf-8 ETag: W/"0096d657076e7aa11634e75556481925" 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: c35310d2-948d-42d1-aa6c-c93ecaabbf35 X-Runtime: 0.177200 X-XSS-Protection: 1; mode=block { "total_pages": 2, "current_page": 1, "next_url": "http://www.example.com/api/v2/test_phases/2713/test_suite_assignments/3636/test_cycles?api_key=api_key_1&page=2", "test_cycles": [ { "id": 4398, "status": "unexecuted", "name": "test_cycle_1", "target_priorities": [ "A" ], "target_results": [ ], "target_test_case_no_list": [ 1, 2 ], "test_suite_assignment_id": 3636, "start_on": "2020-08-26", "end_on": "2020-08-29", "tester_id": null, "created_at": "2020-08-27T14:27:36.376+09:00", "updated_at": "2020-08-27T14:27:36.376+09:00" }, ... ] } ``` ## GET /api/v2/test_phases/:test_phase_id/test_suite_assignments/:test_suite_assignment_id/test_cycles.json レスポンスコードが 200 で next_url が nil の JSON が返ること. ### Example #### Request ``` GET /api/v2/test_phases/2722/test_suite_assignments/3653/test_cycles?api_key=api_key_2 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: 67 Content-Type: application/json; charset=utf-8 ETag: W/"05406138b2c65a550eba94920f3e30bf" 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: 5f46adfe-3b33-470c-ba92-2aaafd7d9633 X-Runtime: 0.033037 X-XSS-Protection: 1; mode=block { "total_pages": 0, "current_page": 1, "next_url": null, "test_cycles": [ ] } ``` ## POST /api/v2/test_phases/:test_phase_id/test_suite_assignments/:test_suite_assignment_id/test_cycles.json TestCycle が作成できること. ### Example #### Request ``` POST /api/v2/test_phases/2723/test_suite_assignments/3654/test_cycles?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: 2345 Content-Type: application/x-www-form-urlencoded Host: www.example.com test_cycle[id]&test_cycle[status]=1&test_cycle[created_at]&test_cycle[updated_at]&test_cycle[name]=test_cycle_310&test_cycle[target_priorities][]=A&test_cycle[test_suite_assignment_id]&test_cycle[pass_count]=0&test_cycle[fail_count]=0&test_cycle[skip_count]=0&test_cycle[cut_count]=0&test_cycle[block_count]=0&test_cycle[na_count]=0&test_cycle[none_count]=0&test_cycle[start_on]=2020-08-26&test_cycle[end_on]=2020-08-29&test_cycle[holiday_count]=0&&test_cycle[qa_count]=0&test_cycle[base_test_cycle_id]&test_cycle[target_results][]=&test_cycle[default_value_content1]&test_cycle[default_value_content2]&test_cycle[default_value_content3]&test_cycle[default_value_content4]&test_cycle[default_value_content5]&test_cycle[default_value_content6]&test_cycle[default_value_content7]&test_cycle[default_value_content8]&test_cycle[default_value_content9]&test_cycle[default_value_content10]&test_cycle[default_value_content11]&test_cycle[default_value_content12]&test_cycle[default_value_content13]&test_cycle[default_value_content14]&test_cycle[default_value_content15]&test_cycle[default_value_content16]&test_cycle[default_value_content17]&test_cycle[default_value_content18]&test_cycle[default_value_content19]&test_cycle[default_value_content20]&test_cycle[default_value_content21]&test_cycle[default_value_content22]&test_cycle[default_value_content23]&test_cycle[default_value_content24]&test_cycle[default_value_content25]&test_cycle[default_value_content26]&test_cycle[default_value_content27]&test_cycle[default_value_content28]&test_cycle[default_value_content29]&test_cycle[default_value_content30]&test_cycle[default_value_content31]&test_cycle[default_value_content32]&test_cycle[default_value_content33]&test_cycle[default_value_content34]&test_cycle[default_value_content35]&test_cycle[default_value_content36]&test_cycle[default_value_content37]&test_cycle[default_value_content38]&test_cycle[default_value_content39]&test_cycle[default_value_content40]&test_cycle[default_value_content41]&test_cycle[default_value_content42]&test_cycle[default_value_content43]&test_cycle[default_value_content44]&test_cycle[default_value_content45]&test_cycle[default_value_content46]&test_cycle[default_value_content47]&test_cycle[default_value_content48]&test_cycle[default_value_content49]&test_cycle[default_value_content50]&test_cycle[tester_id] ``` #### 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: 321 Content-Type: application/json; charset=utf-8 ETag: W/"3747774d8a9197419af26af51d694467" 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: 72d4ec9c-37fa-4d5d-9112-d23b8e0e0526 X-Runtime: 0.093857 X-XSS-Protection: 1; mode=block { "id": 4707, "status": "unexecuted", "name": "test_cycle_310", "target_priorities": [ "A" ], "target_results": [ ], "target_test_case_no_list": [ 1, 2 ], "test_suite_assignment_id": 3654, "start_on": "2020-08-26", "end_on": "2020-08-29", "tester_id": null, "created_at": "2020-08-27T14:27:54.863+09:00", "updated_at": "2020-08-27T14:27:54.863+09:00" } ``` ## POST /api/v2/test_phases/:test_phase_id/test_suite_assignments/:test_suite_assignment_id/test_cycles.json TestCycle が作成されないこと. ### Example #### Request ``` POST /api/v2/test_phases/2728/test_suite_assignments/3663/test_cycles?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: 2330 Content-Type: application/x-www-form-urlencoded Host: www.example.com test_cycle[id]&test_cycle[status]=1&test_cycle[created_at]&test_cycle[updated_at]&test_cycle[name]&test_cycle[target_priorities][]=A&test_cycle[test_suite_assignment_id]&test_cycle[pass_count]=0&test_cycle[fail_count]=0&test_cycle[skip_count]=0&test_cycle[cut_count]=0&test_cycle[block_count]=0&test_cycle[na_count]=0&test_cycle[none_count]=0&test_cycle[start_on]=2020-08-26&test_cycle[end_on]=2020-08-29&test_cycle[holiday_count]=0&&test_cycle[qa_count]=0&test_cycle[base_test_cycle_id]&test_cycle[target_results][]=&test_cycle[default_value_content1]&test_cycle[default_value_content2]&test_cycle[default_value_content3]&test_cycle[default_value_content4]&test_cycle[default_value_content5]&test_cycle[default_value_content6]&test_cycle[default_value_content7]&test_cycle[default_value_content8]&test_cycle[default_value_content9]&test_cycle[default_value_content10]&test_cycle[default_value_content11]&test_cycle[default_value_content12]&test_cycle[default_value_content13]&test_cycle[default_value_content14]&test_cycle[default_value_content15]&test_cycle[default_value_content16]&test_cycle[default_value_content17]&test_cycle[default_value_content18]&test_cycle[default_value_content19]&test_cycle[default_value_content20]&test_cycle[default_value_content21]&test_cycle[default_value_content22]&test_cycle[default_value_content23]&test_cycle[default_value_content24]&test_cycle[default_value_content25]&test_cycle[default_value_content26]&test_cycle[default_value_content27]&test_cycle[default_value_content28]&test_cycle[default_value_content29]&test_cycle[default_value_content30]&test_cycle[default_value_content31]&test_cycle[default_value_content32]&test_cycle[default_value_content33]&test_cycle[default_value_content34]&test_cycle[default_value_content35]&test_cycle[default_value_content36]&test_cycle[default_value_content37]&test_cycle[default_value_content38]&test_cycle[default_value_content39]&test_cycle[default_value_content40]&test_cycle[default_value_content41]&test_cycle[default_value_content42]&test_cycle[default_value_content43]&test_cycle[default_value_content44]&test_cycle[default_value_content45]&test_cycle[default_value_content46]&test_cycle[default_value_content47]&test_cycle[default_value_content48]&test_cycle[default_value_content49]&test_cycle[default_value_content50]&test_cycle[tester_id] ``` #### 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: 40 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: 3b371b64-de00-4ddf-a55c-06bfec48729a X-Runtime: 0.040637 X-XSS-Protection: 1; mode=block { "name": [ "を入力してください" ] } ``` ## GET /api/v2/test_phases/:test_phase_id/test_suite_assignments/:test_suite_assignment_id/test_cycles/:id.csv CSV で TestCycle の内容が出力されること. ### Example #### Request ``` GET /api/v2/test_phases/2733/test_suite_assignments/3672/test_cycles/4811.csv?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: 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: no-cache Content-Disposition: attachment; filename="test-cycle-4811-2020-08-27-14-28-06.csv"; filename*=UTF-8''test-cycle-4811-2020-08-27-14-28-06.csv Content-Length: 621 Content-Transfer-Encoding: binary Content-Type: text/csv Last-Modified: 0 Referrer-Policy: strict-origin-when-cross-origin X-Accel-Buffering: no X-Content-Type-Options: nosniff X-Download-Options: noopen X-Frame-Options: SAMEORIGIN X-Permitted-Cross-Domain-Policies: none X-Request-Id: 0321edf9-2c70-4c1d-9753-5a75c93508a6 X-Runtime: 0.124392 X-XSS-Protection: 1; mode=block 識別ID,優先度,category1,category2,category3,category4,category5,category6,category7,category8,category9,category10,category11,category12,category13,category14,category15,category16,category17,category18,category19,category20,category21,category22,category23,category24,category25,テスト実施者,テスト実施日,テスト結果,content1,content2,content3,content4,content5,content6,content7,content8,content9,content10 1,A,1,,,,,,,,,,,,,,,,,,,,,,,,,user_5,2016/01/01,pass,,,,,,,,,, 2,A,2,,,,,,,,,,,,,,,,,,,,,,,,,user_5,2016/01/05,skip,,,,,,,,,, 3,,3,,,,,,,,,,,,,,,,,,,,,,,,,user_5,2016/01/10,fail,,,,,,,,,, ``` ## PATCH /api/v2/test_phases/:test_phase_id/test_suite_assignments/:test_suite_assignment_id/test_cycles/:id.json TestCycle が更新できること. ### Example #### Request ``` PATCH /api/v2/test_phases/2738/test_suite_assignments/3681/test_cycles/4914?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: 25 Content-Type: application/x-www-form-urlencoded Host: www.example.com test_cycle[name]=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: 315 Content-Type: application/json; charset=utf-8 ETag: W/"8406f538185f450d7271fa339f0d3c7b" 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: 67268193-767d-41cf-9de5-5d0bcfd880fe X-Runtime: 0.138513 X-XSS-Protection: 1; mode=block { "id": 4914, "status": "unexecuted", "name": "testtest", "target_priorities": [ "A" ], "target_results": [ ], "target_test_case_no_list": [ 1, 2 ], "test_suite_assignment_id": 3681, "start_on": "2020-08-26", "end_on": "2020-08-29", "tester_id": null, "created_at": "2020-08-27T14:28:07.275+09:00", "updated_at": "2020-08-27T14:28:13.097+09:00" } ``` ## PATCH /api/v2/test_phases/:test_phase_id/test_suite_assignments/:test_suite_assignment_id/test_cycles/:id.json TestCycle が更新されないこと. ### Example #### Request ``` PATCH /api/v2/test_phases/2743/test_suite_assignments/3690/test_cycles/5017?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: 16 Content-Type: application/x-www-form-urlencoded Host: www.example.com test_cycle[name] ``` #### 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: 40 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: 6c211517-c96a-41e8-b9e3-ea32045aa98b X-Runtime: 0.042132 X-XSS-Protection: 1; mode=block { "name": [ "を入力してください" ] } ``` ## DELETE /api/v2/test_phases/:test_phase_id/test_suite_assignments/:test_suite_assignment_id/test_cycles/:id.json TestCycle が削除されること. ### Example #### Request ``` DELETE /api/v2/test_phases/2748/test_suite_assignments/3699/test_cycles/5120?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: 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: 07745375-5d49-47b0-ae56-867677861e7c X-Runtime: 0.136374 X-XSS-Protection: 1; mode=block ```