Module: Endpoints

Included in:
TestRail::APIClient
Defined in:
lib/endpoints.rb

Instance Method Summary collapse

Instance Method Details

#add_case(case_id, opts = {}) ⇒ Object

Add results to a geven test case

Parameters:

  • case_id (int)

    The id of the test case

  • opts (hash) (defaults to: {})

See Also:



41
42
43
# File 'lib/endpoints.rb', line 41

def add_case(case_id, opts = {})
  send_post("add_case/#{case_id.to_s}", opts)
end

#add_milestone(project_id, opts = {}) ⇒ Object

Add milestone to project id

Parameters:

  • project_id (int)
  • opts (hash) (defaults to: {})

See Also:



129
130
131
# File 'lib/endpoints.rb', line 129

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

Parameters:

  • project_id (int)
  • opts (hash) (defaults to: {})

See Also:



153
154
155
# File 'lib/endpoints.rb', line 153

def add_plan(project_id, opts = {})
  send_post("add_plan/#{project_id.to_s}", opts)
end

#add_plan_entries(plan_id, opts = {}) ⇒ Object

Add plan entries by plan id

Parameters:

  • plan_id (int)
  • opts (hash) (defaults to: {})

See Also:



161
162
163
# File 'lib/endpoints.rb', line 161

def add_plan_entries(plan_id, opts = {})
  send_post("add_plan_entries/#{plan_id.to_s}", opts)
end

#add_result(test_id, opts = {}) ⇒ Object

Add result to test by test id

Parameters:

  • test_id (int)
  • opts (hash) (defaults to: {})

See Also:



192
193
194
# File 'lib/endpoints.rb', line 192

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

Add result to case by case id

Parameters:

  • run_id (int)
  • case_id (int)
  • opts (hash) (defaults to: {})

See Also:



201
202
203
# File 'lib/endpoints.rb', line 201

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_run(suite_id, opts = {}) ⇒ Object

Add run by suite id

Parameters:

  • suite_id (int)
  • opts (hash) (defaults to: {})

See Also:



227
228
229
# File 'lib/endpoints.rb', line 227

def add_run(suite_id, opts = {})
  send_post("add_run/#{suite_id.to_s}", opts)
end

#add_section(suite_id, opts = {}) ⇒ Object

Add section to suite

Parameters:

  • suite_id (int)
  • opts (hash) (defaults to: {})

See Also:



105
106
107
# File 'lib/endpoints.rb', line 105

def add_section(suite_id, opts = {})
  send_post("add_section/#{suite_id.to_s}", opts)
end

#add_suite(project_id, opts = {}) ⇒ Object

Add a test suite

Parameters:

  • project_id (int)

    The id of the project containing suites

  • opts (hash) (defaults to: {})

See Also:



81
82
83
# File 'lib/endpoints.rb', line 81

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

Parameters:

  • plan_id (int)
  • opts (hash) (defaults to: {})

See Also:



169
170
171
# File 'lib/endpoints.rb', line 169

def close_plan(plan_id, opts = {})
  send_post("close_plan/#{plan_id.to_s}", opts)
end

#close_run(run_id, opts = {}) ⇒ Object

Close run by run id

Parameters:

  • run_id (int)
  • opts (hash) (defaults to: {})

See Also:



236
237
238
# File 'lib/endpoints.rb', line 236

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

Parameters:

  • case_id (int)

    The id of the test case

  • opts (hash) (defaults to: {})

See Also:



57
58
59
# File 'lib/endpoints.rb', line 57

def delete_case(case_id, opts = {})
  send_post("delete_case/#{case_id.to_s}", opts)
end

#get_case(case_id, opts = {}) ⇒ Object

Return a single test case

Parameters:

  • case_id (int)

    The id of the test case you want.

  • opts (hash) (defaults to: {})

See Also:



6
7
8
# File 'lib/endpoints.rb', line 6

def get_case(case_id, opts = {})
  send_get("get_case/#{case_id.to_s}", opts)
end

#get_cases(project_id, opts = {}) ⇒ Object

Return all test cases in a given project

Parameters:

  • project_id (int)

    The id of the project that contains your tests

  • opts (hash) (defaults to: {})

See Also:



14
15
16
# File 'lib/endpoints.rb', line 14

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

Parameters:

  • project_id (int)

    The id of the project that contains your tests

  • suite_id (int)

    The id of the suite within the project

  • section_id (int)

    The id of the section within the suite

  • opts (hash) (defaults to: {})

See Also:



24
25
26
# File 'lib/endpoints.rb', line 24

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}&section_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

Parameters:

  • project_id (int)

    The id of the project that contains your tests

  • suite_id (int)

    The id of the suite within the project

  • opts (hash) (defaults to: {})

See Also:



33
34
35
# File 'lib/endpoints.rb', line 33

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

Parameters:

  • milestone_id (int)
  • opts (hash) (defaults to: {})

See Also:



113
114
115
# File 'lib/endpoints.rb', line 113

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

Parameters:

  • project_id (int)
  • opts (hash) (defaults to: {})

See Also:



121
122
123
# File 'lib/endpoints.rb', line 121

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

Parameters:

  • plan_id (int)
  • opts (hash) (defaults to: {})

See Also:



137
138
139
# File 'lib/endpoints.rb', line 137

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

Parameters:

  • project_id (int)
  • opts (hash) (defaults to: {})

See Also:



145
146
147
# File 'lib/endpoints.rb', line 145

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

Parameters:

  • project_id (int)
  • opts (hash) (defaults to: {})

See Also:



177
178
179
# File 'lib/endpoints.rb', line 177

def get_project(project_id, opts = {})
  send_get("get_project/#{project_id.to_s}", opts)
end

#get_projects(opts = {}) ⇒ Object

Get all projects

Parameters:

  • opts (hash) (defaults to: {})

See Also:



184
185
186
# File 'lib/endpoints.rb', line 184

def get_projects(opts = {})
  send_get('get_projects', opts)
end

#get_run(run_id, opts = {}) ⇒ Object

Get run by run id

Parameters:

  • run_id (int)
  • opts (hash) (defaults to: {})

See Also:



209
210
211
# File 'lib/endpoints.rb', line 209

def get_run(run_id, opts = {})
  send_get("get_run/#{run_id.to_s}", opts)
end

#get_runs(project_id, plan_id, opts = {}) ⇒ Object

Note:

Might be broken

Get runs by project id

Parameters:

  • project_id (int)
  • plan_id (int)
  • opts (hash) (defaults to: {})

See Also:



219
220
221
# File 'lib/endpoints.rb', line 219

def get_runs(project_id, plan_id, opts = {})
  send_get("get_runs/#{project_id.to_s}/#{plan_id.to_s}", opts)
end

#get_section(section_id, opts = {}) ⇒ Object

Return section by id

Parameters:

  • section_id (int)
  • opts (hash) (defaults to: {})

See Also:



89
90
91
# File 'lib/endpoints.rb', line 89

def get_section(section_id, opts = {})
  send_get("get_section/#{section_id.to_s}", opts)
end

#get_sections(suite_id, opts = {}) ⇒ Object

Get sections for suite

Parameters:

  • suite_id (int)
  • opts (hash) (defaults to: {})

See Also:



97
98
99
# File 'lib/endpoints.rb', line 97

def get_sections(suite_id, opts = {})
  send_get("get_sections/#{suite_id.to_s}", opts)
end

#get_suite(suite_id, opts = {}) ⇒ Object

Return suite by suite id

Parameters:

  • suite_id (int)

    The suite id

  • opts (hash) (defaults to: {})

See Also:



65
66
67
# File 'lib/endpoints.rb', line 65

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

Parameters:

  • project_id (int)

    The id of the project containing suites

  • opts (hash) (defaults to: {})

See Also:



73
74
75
# File 'lib/endpoints.rb', line 73

def get_suites(project_id, opts = {})
  send_get("get_suites/#{project_id.to_s}", opts)
end

#get_test(test_id, opts = {}) ⇒ Object

Get test by test id

Parameters:

  • test_id (int)
  • opts (hash) (defaults to: {})

See Also:



244
245
246
# File 'lib/endpoints.rb', line 244

def get_test(test_id, opts = {})
  send_get("get_test/#{test_id.to_s}", opts)
end

#get_tests(run_id, opts = {}) ⇒ Object

Get tests by run id

Parameters:

  • run_id (int)
  • opts (hash) (defaults to: {})

See Also:



252
253
254
# File 'lib/endpoints.rb', line 252

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

Parameters:

  • case_id (int)

    The id of the test case

  • opts (hash) (defaults to: {})

See Also:



49
50
51
# File 'lib/endpoints.rb', line 49

def update_case(case_id, opts = {})
  send_post("update_case/#{case_id.to_s}", opts)
end