Class: Testrail::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/testrail/client.rb

Constant Summary collapse

COMMANDS =

COMMANDS.each do |method_name|

define_method method_name

end

%w[add_result
add_result_for_case
get_test
get_tests
get_case
get_cases
add_case
update_case
delete_case
get_suite
get_suites
get_section
get_sections
add_suite
add_section
get_run
get_runs
add_run
close_run
get_plan
get_plans
add_plan
add_plan_entries
close_plan
get_milestone
get_milestones
add_milestone
get_project
get_projects]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeClient

Returns a new instance of Client.



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

def initialize
  @request = Testrail::Request
end

Instance Attribute Details

#requestObject (readonly)

Returns the value of attribute request.



4
5
6
# File 'lib/testrail/client.rb', line 4

def request
  @request
end

Instance Method Details

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



37
38
39
# File 'lib/testrail/client.rb', line 37

def add_case(section_id, opts = {})
  request.post('add_case', section_id, opts)
end

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



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

def add_milestone(project_id, opts = {})
  request.post('add_milestone', project_id, opts)
end

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



100
101
102
# File 'lib/testrail/client.rb', line 100

def add_plan(project_id, opts = {})
  request.post('add_plan', project_id, opts)
end

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



104
105
106
# File 'lib/testrail/client.rb', line 104

def add_plan_entries(plan_id, opts = {})
  request.post('add_plan_entries', plan_id, opts)
end

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



11
12
13
# File 'lib/testrail/client.rb', line 11

def add_result(test_id, opts = {})
  request.post('add_result', test_id, opts)
end

#add_result_for_case(run_id, case_id, opts = {}) ⇒ Object



15
16
17
# File 'lib/testrail/client.rb', line 15

def add_result_for_case(run_id, case_id, opts = {})
  request.post('add_result_for_case', run_id, case_id, opts)
end

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



83
84
85
# File 'lib/testrail/client.rb', line 83

def add_run(suite_id, opts = {})
  request.post('add_run', suite_id, opts)
end

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



70
71
72
# File 'lib/testrail/client.rb', line 70

def add_section(suite_id, opts = {})
  request.post('add_section', suite_id, opts)
end

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



66
67
68
# File 'lib/testrail/client.rb', line 66

def add_suite(project_id, opts = {})
  request.post('add_suite', project_id, opts)
end

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



108
109
110
# File 'lib/testrail/client.rb', line 108

def close_plan(plan_id, opts = {})
  request.post('close_plan', plan_id, opts)
end

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



87
88
89
# File 'lib/testrail/client.rb', line 87

def close_run(run_id, opts = {})
  request.post('close_run', run_id, opts)
end

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



45
46
47
# File 'lib/testrail/client.rb', line 45

def delete_case(case_id, opts = {})
  request.post('delete_case', case_id, opts)
end

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



29
30
31
# File 'lib/testrail/client.rb', line 29

def get_case(case_id, opts = {})
  request.get('get_case', case_id, opts)
end

#get_cases(suite_id, section_id, opts = {}) ⇒ Object



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

def get_cases(suite_id, section_id, opts = {})
  request.get('get_cases', [suite_id, section_id], opts)
end

#get_milestone(milestone_id, opts = {}) ⇒ Object



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

def get_milestone(milestone_id, opts = {})
  request.get('get_milestone', milestone_id, opts)
end

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



117
118
119
# File 'lib/testrail/client.rb', line 117

def get_milestones(project_id, opts = {})
  request.get('get_milestones', project_id, opts)
end

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



92
93
94
# File 'lib/testrail/client.rb', line 92

def get_plan(plan_id, opts = {})
  request.get('get_plan', plan_id, opts)
end

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



96
97
98
# File 'lib/testrail/client.rb', line 96

def get_plans(project_id, opts = {})
  request.get('get_plans', project_id, opts)
end

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



126
127
128
# File 'lib/testrail/client.rb', line 126

def get_project(project_id, opts = {})
  request.get('get_project', project_id, opts)
end

#get_projects(opts = {}) ⇒ Object



130
131
132
# File 'lib/testrail/client.rb', line 130

def get_projects(opts = {})
  request.get('get_projects', opts)
end

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



75
76
77
# File 'lib/testrail/client.rb', line 75

def get_run(run_id, opts = {})
  request.get('get_run', run_id, opts)
end

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



79
80
81
# File 'lib/testrail/client.rb', line 79

def get_runs(project_id, plan_id, opts = {})
  request.get('get_runs', project_id, plan_id, opts)
end

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



58
59
60
# File 'lib/testrail/client.rb', line 58

def get_section(section_id, opts = {})
  request.get('get_section', section_id, opts)
end

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



62
63
64
# File 'lib/testrail/client.rb', line 62

def get_sections(suite_id, opts = {})
  request.get('get_sections', suite_id, opts)
end

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



50
51
52
# File 'lib/testrail/client.rb', line 50

def get_suite(suite_id, opts = {})
  request.get('get_suite', suite_id, opts)
end

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



54
55
56
# File 'lib/testrail/client.rb', line 54

def get_suites(project_id, opts = {})
  request.get('get_suites', project_id, opts)
end

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



20
21
22
# File 'lib/testrail/client.rb', line 20

def get_test(test_id, opts = {})
  request.get('get_test', test_id, opts)
end

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



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

def get_tests(run_id, opts = {})
  request.get('get_tests', run_id, opts)
end

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



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

def update_case(case_id, opts = {})
  request.post('update_case', case_id, opts)
end