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
Add plan to project by project id.
-
#add_plan_entry(plan_id, opts = {}) ⇒ Object
Add plan entries by plan id.
-
#add_project(opts = {}) ⇒ Object
Add a project.
-
#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
Adds one or more new test results, comments or assigns one or more tests.
-
#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
Close plan by plan id.
-
#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.
- #delete_plan(plan_id, opts) ⇒ Object
- #delete_plan_entry(plan_id, entry_id, opts = {}) ⇒ Object
-
#delete_project(project_id, opts) ⇒ Object
Delete a project.
-
#delete_run(run_id, opts = {}) ⇒ Object
Deletes an existing test run.
-
#delete_suite(suite_id, opts = {}) ⇒ Object
Delete a test suite.
-
#get_case(case_id, opts = {}) ⇒ 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_cases_by_section(project_id, suite_id, section_id, opts = {}) ⇒ Object
Return all test cases in a given project by suite_id and section_id.
-
#get_cases_by_suite(project_id, suite_id, opts = {}) ⇒ Object
Return all test cases in a given project by suite_id.
-
#get_milestone(milestone_id, opts = {}) ⇒ Object
Get milestone by milestone id.
-
#get_milestones(project_id, opts = {}) ⇒ Object
Get project milestones by project id.
-
#get_plan(plan_id, opts = {}) ⇒ 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, opts = {}) ⇒ Object
Get run by run id.
-
#get_runs(project_id, plan_id, opts = {}) ⇒ Object
Get runs by project id.
-
#get_section(section_id, opts = {}) ⇒ Object
Return section by id.
-
#get_sections(project_id, suite_id, opts = {}) ⇒ Object
Get sections for suite.
-
#get_suite(suite_id, opts = {}) ⇒ Object
Return suite by suite id.
-
#get_suites(project_id, opts = {}) ⇒ Object
Return all suites in project by project id.
-
#get_test(test_id, opts = {}) ⇒ Object
Returns an existing test.
-
#get_tests(run_id, opts = {}) ⇒ Object
Returns a list of tests for a test run.
-
#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
Update plan by plan id.
-
#update_plan_entry(plan_id, entry_id, opts = {}) ⇒ Object
Update plan entry by plan id.
-
#update_project(project_id, opts) ⇒ Object
Update a project.
-
#update_run(run_id, opts = {}) ⇒ Object
Updates existing test run.
-
#update_suite(suite_id, opts = {}) ⇒ Object
update a test suite.
Instance Method Details
#add_case(section_id, opts = {}) ⇒ Object
Creates a new test case
46 47 48 |
# File 'lib/endpoints.rb', line 46 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
163 164 165 |
# File 'lib/endpoints.rb', line 163 def add_milestone(project_id, opts = {}) send_post("add_milestone/#{project_id.to_s}", opts) end |
#add_plan(project_id, opts = {}) ⇒ Object
Add plan to project by project id
208 209 210 |
# File 'lib/endpoints.rb', line 208 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
217 218 219 |
# File 'lib/endpoints.rb', line 217 def add_plan_entry(plan_id, opts = {}) send_post("add_plan_entry/#{plan_id.to_s}", opts) end |
#add_project(opts = {}) ⇒ Object
Add a project
281 282 283 |
# File 'lib/endpoints.rb', line 281 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.
337 338 339 |
# File 'lib/endpoints.rb', line 337 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)
347 348 349 |
# File 'lib/endpoints.rb', line 347 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
Adds one or more new test results, comments or assigns one or more tests
356 357 358 |
# File 'lib/endpoints.rb', line 356 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)
365 366 367 |
# File 'lib/endpoints.rb', line 365 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
393 394 395 |
# File 'lib/endpoints.rb', line 393 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
136 137 138 |
# File 'lib/endpoints.rb', line 136 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
91 92 93 |
# File 'lib/endpoints.rb', line 91 def add_suite(project_id, opts = {}) send_post("add_suite/#{project_id.to_s}", opts) end |
#close_plan(plan_id, opts = {}) ⇒ Object
Close plan by plan id
245 246 247 |
# File 'lib/endpoints.rb', line 245 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
411 412 413 |
# File 'lib/endpoints.rb', line 411 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
64 65 66 |
# File 'lib/endpoints.rb', line 64 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
181 182 183 |
# File 'lib/endpoints.rb', line 181 def delete_milestone(milestone_id, opts = {}) send_post("delete_milestone/#{milestone_id.to_s}", opts) end |
#delete_plan(plan_id, opts) ⇒ Object
251 252 253 |
# File 'lib/endpoints.rb', line 251 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
256 257 258 |
# File 'lib/endpoints.rb', line 256 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 a project
300 301 302 |
# File 'lib/endpoints.rb', line 300 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.
420 421 422 |
# File 'lib/endpoints.rb', line 420 def delete_run(run_id, opts = {}) send_post("delete_run/#{run_id.to_s}", opts) end |
#delete_suite(suite_id, opts = {}) ⇒ Object
Delete a test suite
109 110 111 |
# File 'lib/endpoints.rb', line 109 def delete_suite(suite_id, opts = {}) send_post("delete_suite/#{suite_id.to_s}", opts) end |
#get_case(case_id, opts = {}) ⇒ Object
Returns an existing test case
7 8 9 |
# File 'lib/endpoints.rb', line 7 def get_case(case_id, opts = {}) send_get("get_case/#{case_id.to_s}", opts) end |
#get_cases(project_id, opts = {}) ⇒ Object
Returns a list of test cases for a test suite or specific section in a test suite.
16 17 18 |
# File 'lib/endpoints.rb', line 16 def get_cases(project_id, opts = {}) send_get("get_cases/#{project_id.to_s}", opts) end |
#get_cases_by_section(project_id, suite_id, section_id, opts = {}) ⇒ Object
Return all test cases in a given project by suite_id and section_id
27 28 29 |
# File 'lib/endpoints.rb', line 27 def get_cases_by_section(project_id, suite_id, section_id, opts = {}) send_get("get_cases/#{project_id.to_s}&suite_id=#{suite_id.to_s}§ion_id=#{section_id.to_s}", opts) end |
#get_cases_by_suite(project_id, suite_id, opts = {}) ⇒ Object
Return all test cases in a given project by suite_id
37 38 39 |
# File 'lib/endpoints.rb', line 37 def get_cases_by_suite(project_id, suite_id, opts = {}) send_get("get_cases/#{project_id.to_s}&suite_id=#{suite_id.to_s}", opts) end |
#get_milestone(milestone_id, opts = {}) ⇒ Object
Get milestone by milestone id
145 146 147 |
# File 'lib/endpoints.rb', line 145 def get_milestone(milestone_id, opts = {}) send_get("get_milestone/#{milestone_id.to_s}", opts) end |
#get_milestones(project_id, opts = {}) ⇒ Object
Get project milestones by project id
154 155 156 |
# File 'lib/endpoints.rb', line 154 def get_milestones(project_id, opts = {}) send_get("get_milestones/#{project_id.to_s}", opts) end |
#get_plan(plan_id, opts = {}) ⇒ Object
Get plan by id
190 191 192 |
# File 'lib/endpoints.rb', line 190 def get_plan(plan_id, opts = {}) send_get("get_plan/#{plan_id.to_s}", opts) end |
#get_plans(project_id, opts = {}) ⇒ Object
Get plans in project by project id
199 200 201 |
# File 'lib/endpoints.rb', line 199 def get_plans(project_id, opts = {}) send_get("get_plans/#{project_id.to_s}", opts) end |
#get_project(project_id, opts = {}) ⇒ Object
Get project by project id
265 266 267 |
# File 'lib/endpoints.rb', line 265 def get_project(project_id, opts = {}) send_get("get_project/#{project_id.to_s}", opts) end |
#get_projects(opts = {}) ⇒ Object
Get all projects
273 274 275 |
# File 'lib/endpoints.rb', line 273 def get_projects(opts = {}) send_get('get_projects', opts) end |
#get_results(test_id, opts = {}) ⇒ Object
Returns a list of test results for a test
309 310 311 |
# File 'lib/endpoints.rb', line 309 def get_results(test_id, opts = {}) send_get("get_results/#{test_id.to_s}", opts) end |
#get_results_for_case(run_id, case_id, opts = {}) ⇒ Object
Returns a list of test results for a test run and case combination
319 320 321 |
# File 'lib/endpoints.rb', line 319 def get_results_for_case(run_id, case_id, opts = {}) send_get("get_results_for_case/#{run_id.to_s}/#{case_id.to_s}", opts) end |
#get_results_for_run(run_id, opts = {}) ⇒ Object
Returns a list of test results for a test run
328 329 330 |
# File 'lib/endpoints.rb', line 328 def get_results_for_run(run_id, opts = {}) send_get("get_results_for_run/#{run_id.to_s}", opts) end |
#get_run(run_id, opts = {}) ⇒ Object
Get run by run id
374 375 376 |
# File 'lib/endpoints.rb', line 374 def get_run(run_id, opts = {}) send_get("get_run/#{run_id.to_s}", opts) end |
#get_runs(project_id, plan_id, opts = {}) ⇒ Object
Get runs by project id
384 385 386 |
# File 'lib/endpoints.rb', line 384 def get_runs(project_id, plan_id, opts = {}) send_get("get_runs/#{project_id.to_s}", opts) end |
#get_section(section_id, opts = {}) ⇒ Object
Return section by id
118 119 120 |
# File 'lib/endpoints.rb', line 118 def get_section(section_id, opts = {}) send_get("get_section/#{section_id.to_s}", opts) end |
#get_sections(project_id, suite_id, opts = {}) ⇒ Object
Get sections for suite
127 128 129 |
# File 'lib/endpoints.rb', line 127 def get_sections(project_id, suite_id, opts = {}) send_get("get_sections/#{project_id.to_s}&#{suite_id.to_s}", opts) end |
#get_suite(suite_id, opts = {}) ⇒ Object
Return suite by suite id
73 74 75 |
# File 'lib/endpoints.rb', line 73 def get_suite(suite_id, opts = {}) send_get("get_suite/#{suite_id.to_s}", opts) end |
#get_suites(project_id, opts = {}) ⇒ Object
Return all suites in project by project id
82 83 84 |
# File 'lib/endpoints.rb', line 82 def get_suites(project_id, opts = {}) send_get("get_suites/#{project_id.to_s}", opts) end |
#get_test(test_id, opts = {}) ⇒ Object
Returns an existing test
429 430 431 |
# File 'lib/endpoints.rb', line 429 def get_test(test_id, opts = {}) send_get("get_test/#{test_id.to_s}", opts) end |
#get_tests(run_id, opts = {}) ⇒ Object
Returns a list of tests for a test run
438 439 440 |
# File 'lib/endpoints.rb', line 438 def get_tests(run_id, opts = {}) send_get("get_tests/#{run_id.to_s}", opts) end |
#update_case(case_id, opts = {}) ⇒ Object
Update test result by case id
55 56 57 |
# File 'lib/endpoints.rb', line 55 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
172 173 174 |
# File 'lib/endpoints.rb', line 172 def update_milestone(milestone_id, opts = {}) send_post("update_milestone/#{milestone_id.to_s}", opts) end |
#update_plan(plan_id, opts = {}) ⇒ Object
Update plan by plan id
226 227 228 |
# File 'lib/endpoints.rb', line 226 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
Update plan entry by plan id
236 237 238 |
# File 'lib/endpoints.rb', line 236 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
Update a project
290 291 292 |
# File 'lib/endpoints.rb', line 290 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
402 403 404 |
# File 'lib/endpoints.rb', line 402 def update_run(run_id, opts = {}) send_post("update_run/#{run_id.to_s}", opts) end |
#update_suite(suite_id, opts = {}) ⇒ Object
update a test suite
100 101 102 |
# File 'lib/endpoints.rb', line 100 def update_suite(suite_id, opts = {}) send_post("update_suite/#{suite_id.to_s}", opts) end |