Module: Endpoints
- Included in:
- TestRail::APIClient
- Defined in:
- lib/endpoints.rb
Instance Method Summary collapse
-
#add_case(section_id, opts = {}) ⇒ Object
Creates a new test case.
-
#add_milestone(project_id, opts = {}) ⇒ Object
Add milestone to project id.
-
#add_plan(project_id, opts = {}) ⇒ Object
Creates a new test plan.
-
#add_plan_entry(plan_id, opts = {}) ⇒ Object
Add plan entries by plan id.
-
#add_project(opts = {}) ⇒ Object
Creates a new project (admin status required).
-
#add_result(test_id, opts = {}) ⇒ Object
Adds a new test result, comment or assigns a test.
-
#add_result_for_case(run_id, case_id, opts = {}) ⇒ Object
Adds a new test result, comment or assigns a test (for a test run and case combination).
-
#add_results(run_id, opts = {}) ⇒ Object
..
-
#add_results_for_cases(run_id, opts = {}) ⇒ Object
Adds one or more new test results, comments or assigns one or more tests (using the case IDs).
-
#add_run(project_id, opts = {}) ⇒ Object
Add run by suite id.
-
#add_section(project_id, opts = {}) ⇒ Object
Add section to suite.
-
#add_suite(project_id, opts = {}) ⇒ Object
Add a test suite.
-
#close_plan(plan_id, opts = {}) ⇒ Object
Closes an existing test plan and archives its test runs & results.
-
#close_run(run_id, opts = {}) ⇒ Object
Closes an existing test run and archives its tests & results.
-
#delete_case(case_id, opts = {}) ⇒ Object
Delete test case by case id.
-
#delete_milestone(milestone_id, opts = {}) ⇒ Object
Add milestone to project id WARNING: Destructive.
-
#delete_plan(plan_id, opts = {}) ⇒ Object
Deletes an existing test plan.
-
#delete_plan_entry(plan_id, entry_id, opts = {}) ⇒ Object
Deletes one or more existing test runs from a plan.
-
#delete_project(project_id, opts = {}) ⇒ Object
Delete an existing project.
-
#delete_run(run_id, opts = {}) ⇒ Object
Deletes an existing test run.
-
#delete_section(section_id, opts = {}) ⇒ Object
Delete a section WARNING: Destructive.
-
#delete_suite(suite_id, opts = {}) ⇒ Object
Delete a test suite.
-
#get_case(case_id) ⇒ Object
Returns an existing test case.
-
#get_cases(project_id, opts = {}) ⇒ Object
Returns a list of test cases for a test suite or specific section in a test suite.
-
#get_milestone(milestone_id) ⇒ Object
Get milestone by milestone_id.
-
#get_milestones(project_id, opts = {}) ⇒ Object
Get project milestones by project id.
-
#get_plan(plan_id) ⇒ Object
Get plan by id.
-
#get_plans(project_id, opts = {}) ⇒ Object
Get plans in project by project id.
-
#get_project(project_id, opts = {}) ⇒ Object
Get project by project id.
-
#get_projects(opts = {}) ⇒ Object
Get all projects.
-
#get_results(test_id, opts = {}) ⇒ Object
Returns a list of test results for a test.
-
#get_results_for_case(run_id, case_id, opts = {}) ⇒ Object
Returns a list of test results for a test run and case combination.
-
#get_results_for_run(run_id, opts = {}) ⇒ Object
Returns a list of test results for a test run.
-
#get_run(run_id) ⇒ Object
Get run by run id.
-
#get_runs(project_id, opts = {}) ⇒ Object
Get runs by project id.
-
#get_section(section_id) ⇒ Object
Return section by id.
-
#get_sections(project_id, opts = {}) ⇒ Object
Get sections for suite.
-
#get_suite(suite_id) ⇒ Object
Return suite by suite id.
-
#get_suites(project_id) ⇒ Object
Return all suites in project by project id.
-
#get_test(test_id) ⇒ Object
Returns an existing test.
-
#get_tests(run_id, opts = {}) ⇒ Object
Returns an existing test.
-
#update_case(case_id, opts = {}) ⇒ Object
Update test result by case id.
-
#update_milestone(milestone_id, opts = {}) ⇒ Object
Add milestone to project id.
-
#update_plan(plan_id, opts = {}) ⇒ Object
Updates an existing test plan (partial updates are supported, i.e. you can submit and update specific fields only).
-
#update_plan_entry(plan_id, entry_id, opts = {}) ⇒ Object
Updates one or more existing test runs in a plan (partial updates are supported, i.e. you can submit and update specific fields only).
-
#update_project(project_id, opts = {}) ⇒ Object
Updates an existing project (admin status required; partial updates are supported, i.e. you can submit and update specific fields only).
-
#update_run(run_id, opts = {}) ⇒ Object
Updates existing test run.
-
#update_section(section_id, opts = {}) ⇒ Object
Update a section.
-
#update_suite(suite_id, opts = {}) ⇒ Object
update a test suite.
Instance Method Details
#add_case(section_id, opts = {}) ⇒ Object
For more information about custom fields, see guroc docs
Creates a new test case
97 98 99 |
# File 'lib/endpoints.rb', line 97 def add_case(section_id, opts = {}) send_post("add_case/#{section_id.to_s}", opts) end |
#add_milestone(project_id, opts = {}) ⇒ Object
Add milestone to project id
412 413 414 |
# File 'lib/endpoints.rb', line 412 def add_milestone(project_id, opts = {}) send_post("add_milestone/#{project_id.to_s}", opts) end |
#add_plan(project_id, opts = {}) ⇒ Object
Creates a new test plan.
625 626 627 |
# File 'lib/endpoints.rb', line 625 def add_plan(project_id, opts = {}) send_post("add_plan/#{project_id.to_s}", opts) end |
#add_plan_entry(plan_id, opts = {}) ⇒ Object
Add plan entries by plan id
690 691 692 |
# File 'lib/endpoints.rb', line 690 def add_plan_entry(plan_id, opts = {}) send_post("add_plan_entry/#{plan_id.to_s}", opts) end |
#add_project(opts = {}) ⇒ Object
Creates a new project (admin status required)
827 828 829 |
# File 'lib/endpoints.rb', line 827 def add_project(opts = {}) send_post("add_project", opts) end |
#add_result(test_id, opts = {}) ⇒ Object
Adds a new test result, comment or assigns a test. It’s recommended to use add_results instead if you plan to add results for multiple tests.
983 984 985 |
# File 'lib/endpoints.rb', line 983 def add_result(test_id, opts = {}) send_post("add_result/#{test_id.to_s}", opts) end |
#add_result_for_case(run_id, case_id, opts = {}) ⇒ Object
Adds a new test result, comment or assigns a test (for a test run and case combination)
1022 1023 1024 |
# File 'lib/endpoints.rb', line 1022 def add_result_for_case(run_id, case_id, opts = {}) send_post("add_result_for_case/#{run_id.to_s}/#{case_id.to_s}", opts) end |
#add_results(run_id, opts = {}) ⇒ Object
..
]
}
1068 1069 1070 |
# File 'lib/endpoints.rb', line 1068 def add_results(run_id, opts = {}) send_post("add_results/#{run_id.to_s}", opts) end |
#add_results_for_cases(run_id, opts = {}) ⇒ Object
Adds one or more new test results, comments or assigns one or more tests (using the case IDs)
1109 1110 1111 |
# File 'lib/endpoints.rb', line 1109 def add_results_for_cases(run_id, opts = {}) send_post("add_results_for_cases/#{run_id.to_s}", opts) end |
#add_run(project_id, opts = {}) ⇒ Object
Add run by suite id
1245 1246 1247 |
# File 'lib/endpoints.rb', line 1245 def add_run(project_id, opts = {}) send_post("add_run/#{project_id.to_s}", opts) end |
#add_section(project_id, opts = {}) ⇒ Object
Add section to suite
313 314 315 |
# File 'lib/endpoints.rb', line 313 def add_section(project_id, opts = {}) send_post("add_section/#{project_id.to_s}", opts) end |
#add_suite(project_id, opts = {}) ⇒ Object
Add a test suite
197 198 199 |
# File 'lib/endpoints.rb', line 197 def add_suite(project_id, opts = {}) send_post("add_suite/#{project_id.to_s}", opts) end |
#close_plan(plan_id, opts = {}) ⇒ Object
Closes an existing test plan and archives its test runs & results. WARNING: This can not be undone.
741 742 743 |
# File 'lib/endpoints.rb', line 741 def close_plan(plan_id, opts = {}) send_post("close_plan/#{plan_id.to_s}", opts) end |
#close_run(run_id, opts = {}) ⇒ Object
Closes an existing test run and archives its tests & results
1281 1282 1283 |
# File 'lib/endpoints.rb', line 1281 def close_run(run_id, opts = {}) send_post("close_run/#{run_id.to_s}", opts) end |
#delete_case(case_id, opts = {}) ⇒ Object
Delete test case by case id
135 136 137 |
# File 'lib/endpoints.rb', line 135 def delete_case(case_id, opts = {}) send_post("delete_case/#{case_id.to_s}", opts) end |
#delete_milestone(milestone_id, opts = {}) ⇒ Object
Add milestone to project id WARNING: Destructive
445 446 447 |
# File 'lib/endpoints.rb', line 445 def delete_milestone(milestone_id, opts = {}) send_post("delete_milestone/#{milestone_id.to_s}", opts) end |
#delete_plan(plan_id, opts = {}) ⇒ Object
Deletes an existing test plan. WARNING: This can not be undone. Permenantly deletes ALL test runs and results in plan
755 756 757 |
# File 'lib/endpoints.rb', line 755 def delete_plan(plan_id, opts = {}) send_post("delete_plan/#{plan_id.to_s}", opts) end |
#delete_plan_entry(plan_id, entry_id, opts = {}) ⇒ Object
Deletes one or more existing test runs from a plan. WARNING: Deletes test results
768 769 770 |
# File 'lib/endpoints.rb', line 768 def delete_plan_entry(plan_id, entry_id, opts = {}) send_post("delete_plan_entry/#{plan_id.to_s}/#{entry_id.to_s}", opts) end |
#delete_project(project_id, opts = {}) ⇒ Object
Delete an existing project
861 862 863 |
# File 'lib/endpoints.rb', line 861 def delete_project(project_id, opts = {}) send_post("delete_project/#{project_id.to_s}", opts) end |
#delete_run(run_id, opts = {}) ⇒ Object
Deletes an existing test run.
1293 1294 1295 |
# File 'lib/endpoints.rb', line 1293 def delete_run(run_id, opts = {}) send_post("delete_run/#{run_id.to_s}", opts) end |
#delete_section(section_id, opts = {}) ⇒ Object
Delete a section WARNING: Destructive
347 348 349 |
# File 'lib/endpoints.rb', line 347 def delete_section(section_id, opts = {}) send_post("delete_section/#{section_id}", opts) end |
#delete_suite(suite_id, opts = {}) ⇒ Object
Delete a test suite
222 223 224 |
# File 'lib/endpoints.rb', line 222 def delete_suite(suite_id, opts = {}) send_post("delete_suite/#{suite_id.to_s}", opts) end |
#get_case(case_id) ⇒ Object
Returns an existing test case
43 44 45 |
# File 'lib/endpoints.rb', line 43 def get_case(case_id) send_get("get_case/#{case_id}") end |
#get_cases(project_id, opts = {}) ⇒ Object
Returns a list of test cases for a test suite or specific section in a test suite.
74 75 76 77 |
# File 'lib/endpoints.rb', line 74 def get_cases(project_id, opts = {}) = param_stringify(opts) send_get("get_cases/#{project_id.to_s}&#{}") end |
#get_milestone(milestone_id) ⇒ Object
Get milestone by milestone_id
372 373 374 |
# File 'lib/endpoints.rb', line 372 def get_milestone(milestone_id) send_get("get_milestone/#{milestone_id.to_s}") end |
#get_milestones(project_id, opts = {}) ⇒ Object
Get project milestones by project id
389 390 391 392 |
# File 'lib/endpoints.rb', line 389 def get_milestones(project_id, opts = {}) = param_stringify(opts) send_get("get_milestones/#{project_id.to_s}&#{}") end |
#get_plan(plan_id) ⇒ Object
Get plan by id
530 531 532 |
# File 'lib/endpoints.rb', line 530 def get_plan(plan_id) send_get("get_plan/#{plan_id.to_s}") end |
#get_plans(project_id, opts = {}) ⇒ Object
Get plans in project by project id
561 562 563 564 565 |
# File 'lib/endpoints.rb', line 561 def get_plans(project_id, opts = {}) = param_stringify(opts) puts send_get("get_plans/#{project_id.to_s}&#{}") end |
#get_project(project_id, opts = {}) ⇒ Object
Get project by project id
782 783 784 785 |
# File 'lib/endpoints.rb', line 782 def get_project(project_id, opts = {}) = param_stringify(opts) send_get("get_project/#{project_id.to_s}&#{}") end |
#get_projects(opts = {}) ⇒ Object
Get all projects
806 807 808 809 |
# File 'lib/endpoints.rb', line 806 def get_projects(opts = {}) = param_stringify(opts) send_get("get_projects&#{}") end |
#get_results(test_id, opts = {}) ⇒ Object
Returns a list of test results for a test
882 883 884 885 |
# File 'lib/endpoints.rb', line 882 def get_results(test_id, opts = {}) = param_stringify(opts) send_get("get_results/#{test_id.to_s}&#{}") end |
#get_results_for_case(run_id, case_id, opts = {}) ⇒ Object
Returns a list of test results for a test run and case combination
904 905 906 907 |
# File 'lib/endpoints.rb', line 904 def get_results_for_case(run_id, case_id, opts = {}) = param_stringify(opts) send_get("get_results_for_case/#{run_id.to_s}/#{case_id.to_s}&#{}") end |
#get_results_for_run(run_id, opts = {}) ⇒ Object
Returns a list of test results for a test run
928 929 930 931 |
# File 'lib/endpoints.rb', line 928 def get_results_for_run(run_id, opts = {}) = param_stringify(opts) send_get("get_results_for_run/#{run_id.to_s}&#{}") end |
#get_run(run_id) ⇒ Object
Get run by run id
1157 1158 1159 |
# File 'lib/endpoints.rb', line 1157 def get_run(run_id) send_get("get_run/#{run_id.to_s}") end |
#get_runs(project_id, opts = {}) ⇒ Object
Get runs by project id
1213 1214 1215 1216 |
# File 'lib/endpoints.rb', line 1213 def get_runs(project_id, opts = {}) = param_stringify(opts) send_get("get_runs/#{project_id.to_s}&#{}") end |
#get_section(section_id) ⇒ Object
Return section by id
246 247 248 |
# File 'lib/endpoints.rb', line 246 def get_section(section_id) send_get("get_section/#{section_id.to_s}") end |
#get_sections(project_id, opts = {}) ⇒ Object
Get sections for suite
288 289 290 291 |
# File 'lib/endpoints.rb', line 288 def get_sections(project_id, opts = {}) = param_stringify(opts) send_get("get_sections/#{project_id.to_s}&#{}") end |
#get_suite(suite_id) ⇒ Object
Return suite by suite id
158 159 160 |
# File 'lib/endpoints.rb', line 158 def get_suite(suite_id) send_get("get_suite/#{suite_id.to_s}") end |
#get_suites(project_id) ⇒ Object
Return all suites in project by project id
176 177 178 |
# File 'lib/endpoints.rb', line 176 def get_suites(project_id) send_get("get_suites/#{project_id.to_s}") end |
#get_test(test_id) ⇒ Object
Returns an existing test
1332 1333 1334 |
# File 'lib/endpoints.rb', line 1332 def get_test(test_id) send_get("get_test/#{test_id.to_s}") end |
#get_tests(run_id, opts = {}) ⇒ Object
Returns an existing test
1357 1358 1359 1360 |
# File 'lib/endpoints.rb', line 1357 def get_tests(run_id, opts = {}) = param_stringify(opts) send_get("get_tests/#{run_id.to_s}&#{}") end |
#update_case(case_id, opts = {}) ⇒ Object
Update test result by case id
120 121 122 |
# File 'lib/endpoints.rb', line 120 def update_case(case_id, opts = {}) send_post("update_case/#{case_id.to_s}", opts) end |
#update_milestone(milestone_id, opts = {}) ⇒ Object
Add milestone to project id
433 434 435 |
# File 'lib/endpoints.rb', line 433 def update_milestone(milestone_id, opts = {}) send_post("update_milestone/#{milestone_id.to_s}", opts) end |
#update_plan(plan_id, opts = {}) ⇒ Object
Updates an existing test plan (partial updates are supported, i.e. you can submit and update specific fields only).
708 709 710 |
# File 'lib/endpoints.rb', line 708 def update_plan(plan_id, opts = {}) send_post("update_plan/#{plan_id.to_s}", opts) end |
#update_plan_entry(plan_id, entry_id, opts = {}) ⇒ Object
Updates one or more existing test runs in a plan (partial updates are supported, i.e. you can submit and update specific fields only).
727 728 729 |
# File 'lib/endpoints.rb', line 727 def update_plan_entry(plan_id, entry_id, opts = {}) send_post("update_plan_entry/#{plan_id.to_s}/#{entry_id.to_s}", opts) end |
#update_project(project_id, opts = {}) ⇒ Object
Updates an existing project (admin status required; partial updates are supported, i.e. you can submit and update specific fields only).
849 850 851 |
# File 'lib/endpoints.rb', line 849 def update_project(project_id, opts = {}) send_post("update_project/#{project_id.to_s}", opts) end |
#update_run(run_id, opts = {}) ⇒ Object
Updates existing test run
1269 1270 1271 |
# File 'lib/endpoints.rb', line 1269 def update_run(run_id, opts = {}) send_post("update_run/#{run_id.to_s}", opts) end |
#update_section(section_id, opts = {}) ⇒ Object
Update a section
335 336 337 |
# File 'lib/endpoints.rb', line 335 def update_section(section_id, opts = {}) send_post("update_section/#{section_id.to_s}", opts) end |
#update_suite(suite_id, opts = {}) ⇒ Object
update a test suite
210 211 212 |
# File 'lib/endpoints.rb', line 210 def update_suite(suite_id, opts = {}) send_post("update_suite/#{suite_id.to_s}", opts) end |