testrail-ruby 0.0.16 → 0.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/endpoints.rb +265 -69
- data/lib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a4fdc90f8f23049952e82f20ad5f0c18a05df28
|
4
|
+
data.tar.gz: 3b7f6c13d5134c597eae86e606c4db9dcf875e5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8df5db1eb716b5f74b4deeb27fe97d5d6017a0fd79929333399b52feff564eeff72dbb7cb1eb70002cff195eb008c1ccd74c409dcf5a435e69e89536e66e149
|
7
|
+
data.tar.gz: e21496ce60986d9369afbc81acd5a3ea12b6031542e687dd205daffd004c08b25b483bb7d44a94a8564fe713c3cbe47c662cbb49cde5a1fd6a4b1d31021fde33
|
data/lib/endpoints.rb
CHANGED
@@ -1,492 +1,688 @@
|
|
1
1
|
module Endpoints
|
2
|
+
##########################++
|
3
|
+
####get_case################
|
4
|
+
############################
|
2
5
|
# Returns an existing test case
|
3
6
|
# @param case_id [int] The id of the test case you want.
|
4
|
-
# @
|
5
|
-
#
|
6
|
-
#
|
7
|
+
# @example Code Example
|
8
|
+
# @client.get_case(1)
|
9
|
+
# @example Endpoint Example
|
10
|
+
# GET index.php?/api/v2/get_case/1
|
11
|
+
# @example Response Example
|
12
|
+
# {
|
13
|
+
# "created_by": 5,
|
14
|
+
# "created_on": 1392300984,
|
15
|
+
# "custom_expected": "..",
|
16
|
+
# "custom_preconds": "..",
|
17
|
+
# "custom_steps": "..",
|
18
|
+
# "custom_steps_separated": [
|
19
|
+
# {
|
20
|
+
# "content": "Step 1",
|
21
|
+
# "expected": "Expected Result 1"
|
22
|
+
# },
|
23
|
+
# {
|
24
|
+
# "content": "Step 2",
|
25
|
+
# "expected": "Expected Result 2"
|
26
|
+
# }
|
27
|
+
# ],
|
28
|
+
# "estimate": "1m 5s",
|
29
|
+
# "estimate_forecast": null,
|
30
|
+
# "id": 1,
|
31
|
+
# "milestone_id": 7,
|
32
|
+
# "priority_id": 2,
|
33
|
+
# "refs": "RF-1, RF-2",
|
34
|
+
# "section_id": 1,
|
35
|
+
# "suite_id": 1,
|
36
|
+
# "title": "Change document attributes (author, title, organization)",
|
37
|
+
# "type_id": 4,
|
38
|
+
# "updated_by": 1,
|
39
|
+
# "updated_on": 1393586511
|
40
|
+
# }
|
7
41
|
# @see http://docs.gurock.com/testrail-api2/reference-cases
|
8
|
-
def get_case(case_id
|
9
|
-
send_get("get_case/:#{case_id.to_s}"
|
42
|
+
def get_case(case_id)
|
43
|
+
send_get("get_case/:#{case_id.to_s}")
|
10
44
|
end
|
11
45
|
|
46
|
+
##########################++
|
47
|
+
####get_cases###############
|
48
|
+
############################
|
12
49
|
# Returns a list of test cases for a test suite or specific section in a test suite.
|
13
50
|
# @param project_id [int] The id of the project that contains your tests
|
14
51
|
# @param [Hash] opts
|
15
|
-
# @
|
16
|
-
#
|
52
|
+
# @option opts [int] :suite_id The ID of the test suite (optional if the project is operating in single suite mode)
|
53
|
+
# @option opts [int] :section_id The ID of the section (optional)
|
54
|
+
# @option opts [unix timestamp] :created_after Only return test cases created after this date (as UNIX timestamp).
|
55
|
+
# @option opts [unix timestamp] :created_before Only return test cases created before this date (as UNIX timestamp).
|
56
|
+
# @option opts [int(list)] :created_by A comma-separated list of creators (user IDs) to filter by.
|
57
|
+
# @option opts [int(list)] :milestone_id A comma-separated list of milestone IDs to filter by (not available if the milestone field is disabled for the project).
|
58
|
+
# @option opts [int(list)] :priority_id A comma-separated list of priority IDs to filter by.
|
59
|
+
# @option opts [int(list)] :template_id A comma-separated list of template IDs to filter by (requires TestRail 5.2 or later)
|
60
|
+
# @option opts [int(list)] :type_id A comma-separated list of case type IDs to filter by.
|
61
|
+
# @option opts [unix timestamp] :updated_after Only return test cases updated after this date (as UNIX timestamp).
|
62
|
+
# @option opts [unix timestamp] :updated_before Only return test cases updated before this date (as UNIX timestamp).
|
63
|
+
# @option opts [int(list)] :updated_by A comma-separated list of users who updated test cases to filter by.
|
64
|
+
# @example Code Example
|
65
|
+
# @client.get_cases(1, {"suite_id":1, "section_id":1})
|
66
|
+
# @example Endpoint Example
|
67
|
+
# GET index.php?/api/v2/get_cases/1&suite_id=1§ion_id=1
|
68
|
+
# @example Response Example
|
69
|
+
# [
|
70
|
+
# { "id": 1, "title": "..", .. },
|
71
|
+
# { "id": 2, "title": "..", .. },
|
72
|
+
# ..
|
73
|
+
# ]
|
17
74
|
# @see http://docs.gurock.com/testrail-api2/reference-cases
|
18
75
|
def get_cases(project_id, opts = {})
|
19
76
|
send_get("get_cases/:#{project_id.to_s}", opts)
|
20
77
|
end
|
21
78
|
|
79
|
+
##################deprecated
|
80
|
+
####get_cases_by_section####
|
81
|
+
############################
|
22
82
|
# Return all test cases in a given project by suite_id and section_id
|
23
|
-
# @
|
24
|
-
# @param suite_id [int] The id of the suite within the project
|
25
|
-
# @param section_id [int] The id of the section within the suite
|
26
|
-
# @param [Hash] opts
|
27
|
-
# @example Endpoint
|
28
|
-
# index.php?/api/v2/get_cases/:project_id&suite_id=:suite_id§ion_id=:section_id
|
29
|
-
# @see http://docs.gurock.com/testrail-api2/reference-cases
|
83
|
+
# @deprecated use get_cases instead
|
30
84
|
def get_cases_by_section(project_id, suite_id, section_id, opts = {})
|
31
85
|
send_get("get_cases/:#{project_id.to_s}&suite_id=:#{suite_id.to_s}§ion_id=:#{section_id.to_s}", opts)
|
32
86
|
end
|
33
87
|
|
88
|
+
##################deprecated
|
89
|
+
####get_cases_by_suite######
|
90
|
+
############################
|
34
91
|
# Return all test cases in a given project by suite_id
|
35
|
-
# @
|
36
|
-
# @param suite_id [int] The id of the suite within the project
|
37
|
-
# @param [Hash] opts
|
38
|
-
# @example Endpoint
|
39
|
-
# index.php?/api/v2/get_cases/:project_id&suite_id=:suite_id
|
40
|
-
# @see http://docs.gurock.com/testrail-api2/reference-cases
|
92
|
+
# @deprecated use get_cases instead
|
41
93
|
def get_cases_by_suite(project_id, suite_id, opts = {})
|
42
94
|
send_get("get_cases/:#{project_id.to_s}&suite_id=:#{suite_id.to_s}", opts)
|
43
95
|
end
|
44
96
|
|
97
|
+
############################
|
98
|
+
####add_case################
|
99
|
+
############################
|
45
100
|
# Creates a new test case
|
46
101
|
# @param section_id [int] The id of the test case
|
47
102
|
# @param [Hash] opts
|
48
|
-
# @
|
49
|
-
#
|
103
|
+
# @option opts [string] :title The title of the test case (required)
|
104
|
+
# @option opts [int] :template_id The ID of the template (field layout) (requires TestRail 5.2 or later)
|
105
|
+
# @option opts [int] :type_id The ID of the case type
|
106
|
+
# @option opts [int] :priority_id The ID of the case priority
|
107
|
+
# @option opts [timespan] :estimate The estimate, e.g. "30s" or "1m 45s"
|
108
|
+
# @option opts [int] :milestone_id The ID of the milestone to link to the test case
|
109
|
+
# @option opts [string] :refs A comma-separated list of references/requirements
|
110
|
+
# @example Code Example
|
111
|
+
# @client.add_case(1, {"title":"testCaseName", "type_id":1})
|
112
|
+
# @example Endpoint Example
|
113
|
+
# index.php?/api/v2/add_case/1&title="foo"&type_id=1
|
50
114
|
# @see http://docs.gurock.com/testrail-api2/reference-cases
|
51
115
|
def add_case(section_id, opts = {})
|
52
116
|
send_post("add_case/:#{section_id.to_s}", opts)
|
53
117
|
end
|
54
118
|
|
119
|
+
############################
|
120
|
+
####update_case#############
|
121
|
+
############################
|
55
122
|
# Update test result by case id
|
56
123
|
# @param case_id [int] The id of the test case
|
57
124
|
# @param [Hash] opts
|
58
|
-
# @example Endpoint
|
125
|
+
# @example Endpoint Example
|
59
126
|
# index.php?/api/v2/update_case/:case_id
|
60
127
|
# @see http://docs.gurock.com/testrail-api2/reference-cases
|
61
128
|
def update_case(case_id, opts = {})
|
62
129
|
send_post("update_case/:#{case_id.to_s}", opts)
|
63
130
|
end
|
64
131
|
|
132
|
+
############################
|
133
|
+
####delete_case################
|
134
|
+
############################
|
65
135
|
# Delete test case by case id
|
66
136
|
# @param case_id [int] The id of the test case
|
67
137
|
# @param [Hash] opts
|
68
|
-
# @example Endpoint
|
138
|
+
# @example Endpoint Example
|
69
139
|
# index.php?/api/v2/delete_case/:case_id
|
70
140
|
# @see http://docs.gurock.com/testrail-api2/reference-cases
|
71
141
|
def delete_case(case_id, opts = {})
|
72
142
|
send_post("delete_case/:#{case_id.to_s}", opts)
|
73
143
|
end
|
74
144
|
|
145
|
+
############################
|
146
|
+
####get_suite###############
|
147
|
+
############################
|
75
148
|
# Return suite by suite id
|
76
149
|
# @param suite_id [int] The suite id
|
77
150
|
# @param [Hash] opts
|
78
|
-
# @example Endpoint
|
151
|
+
# @example Endpoint Example
|
79
152
|
# index.php?/api/v2/get_suite/:suite_id
|
80
153
|
# @see http://docs.gurock.com/testrail-api2/reference-suites
|
81
154
|
def get_suite(suite_id, opts = {})
|
82
155
|
send_get("get_suite/:#{suite_id.to_s}", opts)
|
83
156
|
end
|
84
157
|
|
158
|
+
############################
|
159
|
+
####get_suites##############
|
160
|
+
############################
|
85
161
|
# Return all suites in project by project id
|
86
|
-
# @param project_id
|
162
|
+
# @param project_id (see get_cases)
|
87
163
|
# @param [Hash] opts
|
88
|
-
# @example Endpoint
|
164
|
+
# @example Endpoint Example
|
89
165
|
# index.php?/api/v2/get_suites/:project_id
|
90
166
|
# @see http://docs.gurock.com/testrail-api2/reference-suites
|
91
167
|
def get_suites(project_id, opts = {})
|
92
168
|
send_get("get_suites/:#{project_id.to_s}", opts)
|
93
169
|
end
|
94
170
|
|
171
|
+
############################
|
172
|
+
####add_suite###############
|
173
|
+
############################
|
95
174
|
# Add a test suite
|
96
175
|
# @param project_id [int] The id of the project containing suites
|
97
176
|
# @param [Hash] opts
|
98
|
-
# @example Endpoint
|
177
|
+
# @example Endpoint Example
|
99
178
|
# index.php?/api/v2/add_suite/:project_id
|
100
179
|
# @see http://docs.gurock.com/testrail-api2/reference-suites
|
101
180
|
def add_suite(project_id, opts = {})
|
102
181
|
send_post("add_suite/:#{project_id.to_s}", opts)
|
103
182
|
end
|
104
183
|
|
184
|
+
############################
|
185
|
+
####update_suite############
|
186
|
+
############################
|
105
187
|
# update a test suite
|
106
188
|
# @param suite_id [int] The suite id
|
107
189
|
# @param [Hash] opts
|
108
|
-
# @example Endpoint
|
190
|
+
# @example Endpoint Example
|
109
191
|
# index.php?/api/v2/update_suite/:suite_id
|
110
192
|
# @see http://docs.gurock.com/testrail-api2/reference-suites
|
111
193
|
def update_suite(suite_id, opts = {})
|
112
194
|
send_post("update_suite/:#{suite_id.to_s}", opts)
|
113
195
|
end
|
114
196
|
|
197
|
+
############################
|
198
|
+
####delete_suite############
|
199
|
+
############################
|
115
200
|
# Delete a test suite
|
116
201
|
# @param suite_id [int] The suite id
|
117
202
|
# @param [Hash] opts
|
118
|
-
# @example Endpoint
|
203
|
+
# @example Endpoint Example
|
119
204
|
# index.php?/api/v2/delete_suite/:suite_id
|
120
205
|
# @see http://docs.gurock.com/testrail-api2/reference-suites
|
121
206
|
def delete_suite(suite_id, opts = {})
|
122
207
|
send_post("delete_suite/:#{suite_id.to_s}", opts)
|
123
208
|
end
|
124
209
|
|
210
|
+
|
211
|
+
############################
|
212
|
+
####get_section#############
|
213
|
+
############################
|
125
214
|
# Return section by id
|
126
215
|
# @param section_id [int]
|
127
216
|
# @param [Hash] opts
|
128
|
-
# @example Endpoint
|
217
|
+
# @example Endpoint Example
|
129
218
|
# index.php?/api/v2/get_section/:section_id
|
130
219
|
# @see http://docs.gurock.com/testrail-api2/reference-sections
|
131
220
|
def get_section(section_id, opts = {})
|
132
221
|
send_get("get_section/:#{section_id.to_s}", opts)
|
133
222
|
end
|
134
223
|
|
224
|
+
############################
|
225
|
+
####get_sections############
|
226
|
+
############################
|
135
227
|
# Get sections for suite
|
136
228
|
# @param suite_id [int]
|
137
229
|
# @param [Hash] opts
|
138
|
-
# @example Endpoint
|
230
|
+
# @example Endpoint Example
|
139
231
|
# index.php?/api/v2/get_sections/:project_id&suite_id=:suite_id
|
140
232
|
# @see http://docs.gurock.com/testrail-api2/reference-sections
|
141
233
|
def get_sections(project_id, suite_id, opts = {})
|
142
234
|
send_get("get_sections/#{project_id.to_s}&suite_id=#{suite_id.to_s}", opts)
|
143
235
|
end
|
144
236
|
|
237
|
+
############################
|
238
|
+
####add_section#############
|
239
|
+
############################
|
145
240
|
# Add section to suite
|
146
241
|
# @param project_id [int]
|
147
242
|
# @param [Hash] opts
|
148
243
|
# @option opts [Int] suite_id
|
149
244
|
# @option opts [String] name
|
150
245
|
# @option opts [Int] parent_id
|
151
|
-
# @example Endpoint
|
246
|
+
# @example Endpoint Example
|
152
247
|
# index.php?/api/v2/add_section/:project_id
|
153
|
-
# @example Code
|
248
|
+
# @example Code Example
|
154
249
|
# @client.add_section(1, {"suite_id": 5, "name": "This is a new section", "parent_id": 10})
|
155
250
|
# @see http://docs.gurock.com/testrail-api2/reference-sections
|
156
251
|
def add_section(project_id, opts = {})
|
157
252
|
send_post("add_section/#{project_id.to_s}", opts)
|
158
253
|
end
|
159
254
|
|
255
|
+
############################
|
256
|
+
####get_milestone###########
|
257
|
+
############################
|
160
258
|
# Get milestone by milestone id
|
161
259
|
# @param milestone_id [int]
|
162
260
|
# @param [Hash] opts
|
163
|
-
# @example Endpoint
|
261
|
+
# @example Endpoint Example
|
164
262
|
# index.php?/api/v2/get_milestone/:milestone_id
|
165
263
|
# @see http://docs.gurock.com/testrail-api2/reference-milestones
|
166
264
|
def get_milestone(milestone_id, opts = {})
|
167
265
|
send_get("get_milestone/:#{milestone_id.to_s}", opts)
|
168
266
|
end
|
169
267
|
|
268
|
+
############################
|
269
|
+
####get_milestones##########
|
270
|
+
############################
|
170
271
|
# Get project milestones by project id
|
171
272
|
# @param project_id [int]
|
172
273
|
# @param [Hash] opts
|
173
|
-
# @example Endpoint
|
274
|
+
# @example Endpoint Example
|
174
275
|
# index.php?/api/v2/get_milestones/:project_id
|
175
276
|
# @see http://docs.gurock.com/testrail-api2/reference-milestones
|
176
277
|
def get_milestones(project_id, opts = {})
|
177
278
|
send_get("get_milestones/:#{project_id.to_s}", opts)
|
178
279
|
end
|
179
280
|
|
281
|
+
############################
|
282
|
+
####add_milestone###########
|
283
|
+
############################
|
180
284
|
# Add milestone to project id
|
181
285
|
# @param project_id [int]
|
182
286
|
# @param [Hash] opts
|
183
|
-
# @example Endpoint
|
287
|
+
# @example Endpoint Example
|
184
288
|
# index.php?/api/v2/add_milestone/:project_id
|
185
289
|
# @see http://docs.gurock.com/testrail-api2/reference-milestones
|
186
290
|
def add_milestone(project_id, opts = {})
|
187
291
|
send_post("add_milestone/:#{project_id.to_s}", opts)
|
188
292
|
end
|
189
293
|
|
294
|
+
############################
|
295
|
+
####update_milestone########
|
296
|
+
############################
|
190
297
|
# Add milestone to project id
|
191
298
|
# @param milestone_id [int]
|
192
299
|
# @param [Hash] opts
|
193
|
-
# @example Endpoint
|
300
|
+
# @example Endpoint Example
|
194
301
|
# index.php?/api/v2/update_milestone/:milestone_id
|
195
302
|
# @see http://docs.gurock.com/testrail-api2/reference-milestones
|
196
303
|
def update_milestone(milestone_id, opts = {})
|
197
304
|
send_post("update_milestone/:#{milestone_id.to_s}", opts)
|
198
305
|
end
|
199
306
|
|
307
|
+
############################
|
308
|
+
####delete_milestone########
|
309
|
+
############################
|
200
310
|
# Add milestone to project id
|
201
311
|
# @param milestone_id [int]
|
202
312
|
# @param [Hash] opts
|
203
|
-
# @example Endpoint
|
313
|
+
# @example Endpoint Example
|
204
314
|
# index.php?/api/v2/delete_milestone/:milestone_id
|
205
315
|
# @see http://docs.gurock.com/testrail-api2/reference-milestones
|
206
316
|
def delete_milestone(milestone_id, opts = {})
|
207
317
|
send_post("delete_milestone/:#{milestone_id.to_s}", opts)
|
208
318
|
end
|
209
319
|
|
320
|
+
############################
|
321
|
+
####get_plan################
|
322
|
+
############################
|
210
323
|
# Get plan by id
|
211
324
|
# @param plan_id [int]
|
212
325
|
# @param [Hash] opts
|
213
|
-
# @example Endpoint
|
326
|
+
# @example Endpoint Example
|
214
327
|
# index.php?/api/v2/get_plan/:plan_id
|
215
328
|
# @see http://docs.gurock.com/testrail-api2/reference-plans
|
216
329
|
def get_plan(plan_id, opts = {})
|
217
330
|
send_get("get_plan/:#{plan_id.to_s}", opts)
|
218
331
|
end
|
219
332
|
|
333
|
+
############################
|
334
|
+
####get_plans###############
|
335
|
+
############################
|
220
336
|
# Get plans in project by project id
|
221
337
|
# @param project_id [int]
|
222
338
|
# @param [Hash] opts
|
223
|
-
# @example Endpoint
|
339
|
+
# @example Endpoint Example
|
224
340
|
# index.php?/api/v2/get_plans/:project_id
|
225
341
|
# @see http://docs.gurock.com/testrail-api2/reference-plans
|
226
342
|
def get_plans(project_id, opts = {})
|
227
343
|
send_get("get_plans/:#{project_id.to_s}", opts)
|
228
344
|
end
|
229
345
|
|
346
|
+
############################
|
347
|
+
####add_plan################
|
348
|
+
############################
|
230
349
|
# Add plan to project by project id
|
231
350
|
# @param project_id [int]
|
232
351
|
# @param [Hash] opts
|
233
|
-
# @example Endpoint
|
352
|
+
# @example Endpoint Example
|
234
353
|
# index.php?/api/v2/add_plan/:project_id
|
235
354
|
# @see http://docs.gurock.com/testrail-api2/reference-plans
|
236
355
|
def add_plan(project_id, opts = {})
|
237
356
|
send_post("add_plan/:#{project_id.to_s}", opts)
|
238
357
|
end
|
239
358
|
|
359
|
+
############################
|
360
|
+
####add_plan_entry##########
|
361
|
+
############################
|
240
362
|
# Add plan entries by plan id
|
241
363
|
# @param plan_id [int]
|
242
364
|
# @param [Hash] opts
|
243
|
-
# @example Endpoint
|
365
|
+
# @example Endpoint Example
|
244
366
|
# index.php?/api/v2/add_plan_entry/:plan_id
|
245
367
|
# @see http://docs.gurock.com/testrail-api2/reference-plans
|
246
368
|
def add_plan_entry(plan_id, opts = {})
|
247
369
|
send_post("add_plan_entry/:#{plan_id.to_s}", opts)
|
248
370
|
end
|
249
371
|
|
372
|
+
############################
|
373
|
+
####update_plan#############
|
374
|
+
############################
|
250
375
|
# Update plan by plan id
|
251
376
|
# @param plan_id [int]
|
252
377
|
# @param [Hash] opts
|
253
|
-
# @example Endpoint
|
378
|
+
# @example Endpoint Example
|
254
379
|
# index.php?/api/v2/update_plan/:plan_id
|
255
380
|
# @see http://docs.gurock.com/testrail-api2/reference-plans
|
256
381
|
def update_plan(plan_id, opts = {})
|
257
382
|
send_post("update_plan/:#{plan_id.to_s}", opts)
|
258
383
|
end
|
259
384
|
|
385
|
+
############################
|
386
|
+
####update_plan_entry#######
|
387
|
+
############################
|
260
388
|
# Update plan entry by plan id
|
261
389
|
# @param plan_id [int]
|
262
390
|
# @param entry_id [int] Id of entry
|
263
391
|
# @param [Hash] opts
|
264
|
-
# @example Endpoint
|
392
|
+
# @example Endpoint Example
|
265
393
|
# index.php?/api/v2/update_plan_entry/:plan_id/:entry_id
|
266
394
|
# @see http://docs.gurock.com/testrail-api2/reference-plans
|
267
395
|
def update_plan_entry(plan_id, entry_id, opts = {})
|
268
396
|
send_post("update_plan_entry/:#{plan_id.to_s}/:#{entry_id.to_s}", opts)
|
269
397
|
end
|
270
398
|
|
399
|
+
############################
|
400
|
+
####close_plan##############
|
401
|
+
############################
|
271
402
|
# Close plan by plan id
|
272
403
|
# @param plan_id [int]
|
273
404
|
# @param [Hash] opts
|
274
|
-
# @example Endpoint
|
405
|
+
# @example Endpoint Example
|
275
406
|
# index.php?/api/v2/close_plan/:plan_id
|
276
407
|
# @see http://docs.gurock.com/testrail-api2/reference-plans
|
277
408
|
def close_plan(plan_id, opts = {})
|
278
409
|
send_post("close_plan/:#{plan_id.to_s}", opts)
|
279
410
|
end
|
280
411
|
|
281
|
-
|
412
|
+
############################
|
413
|
+
####delete_plan#############
|
414
|
+
############################
|
415
|
+
# @example Endpoint Example
|
282
416
|
# index.php?/api/v2/delete_plan/:plan_id
|
283
417
|
# @see http://docs.gurock.com/testrail-api2/reference-plans
|
284
418
|
def delete_plan(plan_id, opts)
|
285
419
|
send_post("delete_plan/:#{plan_id.to_s}", opts)
|
286
420
|
end
|
287
421
|
|
288
|
-
|
422
|
+
############################
|
423
|
+
####delete_plan_by_entry####
|
424
|
+
############################
|
425
|
+
# @example Endpoint Example
|
289
426
|
# index.php?/api/v2/delete_plan_entry/:plan_id/:entry_id
|
290
427
|
def delete_plan_entry(plan_id, entry_id, opts = {})
|
291
428
|
send_post("delete_plan_entry/:#{plan_id.to_s}/:#{entry_id.to_s}", opts)
|
292
429
|
end
|
293
430
|
|
431
|
+
############################
|
432
|
+
####get_project#############
|
433
|
+
############################
|
294
434
|
# Get project by project id
|
295
435
|
# @param project_id [int]
|
296
436
|
# @param [Hash] opts
|
297
|
-
# @example Endpoint
|
437
|
+
# @example Endpoint Example
|
298
438
|
# index.php?/api/v2/get_project/:project_id
|
299
439
|
# @see http://docs.gurock.com/testrail-api2/reference-projects
|
300
440
|
def get_project(project_id, opts = {})
|
301
441
|
send_get("get_project/:#{project_id.to_s}", opts)
|
302
442
|
end
|
303
443
|
|
444
|
+
############################
|
445
|
+
####get_projects############
|
446
|
+
############################
|
304
447
|
# Get all projects
|
305
448
|
# @param [Hash] opts
|
306
|
-
# @example Endpoint
|
449
|
+
# @example Endpoint Example
|
307
450
|
# index.php?/api/v2/get_projects
|
308
451
|
# @see http://docs.gurock.com/testrail-api2/reference-projects
|
309
452
|
def get_projects(opts = {})
|
310
453
|
send_get('get_projects', opts)
|
311
454
|
end
|
312
455
|
|
456
|
+
############################
|
457
|
+
####add_project#############
|
458
|
+
############################
|
313
459
|
# Add a project
|
314
460
|
# @param [Hash] opts
|
315
|
-
# @example Endpoint
|
461
|
+
# @example Endpoint Example
|
316
462
|
# index.php?/api/v2/add_project
|
317
463
|
# @see http://docs.gurock.com/testrail-api2/reference-projects
|
318
464
|
def add_project(opts = {})
|
319
465
|
send_post("add_project", opts)
|
320
466
|
end
|
321
467
|
|
468
|
+
############################
|
469
|
+
####update_project##########
|
470
|
+
############################
|
322
471
|
# Update a project
|
323
472
|
# @param project_id [int] The project you want to update
|
324
473
|
# @param [Hash] opts
|
325
|
-
# @example Endpoint
|
474
|
+
# @example Endpoint Example
|
326
475
|
# index.php?/api/v2/update_project/:project_id
|
327
476
|
# @see http://docs.gurock.com/testrail-api2/reference-projects
|
328
477
|
def update_project(project_id, opts)
|
329
478
|
send_post("update_project/:#{project_id.to_s}", opts)
|
330
479
|
end
|
331
480
|
|
332
|
-
|
481
|
+
############################
|
482
|
+
####delete_project##########
|
483
|
+
############################
|
333
484
|
# Delete a project
|
334
485
|
# @param project_id [int] The project you want to delete
|
335
486
|
# @param [Hash] opts
|
336
|
-
# @example Endpoint
|
487
|
+
# @example Endpoint Example
|
337
488
|
# index.php?/api/v2/delete_project/:project_id
|
338
489
|
# @see http://docs.gurock.com/testrail-api2/reference-projects
|
339
490
|
def delete_project(project_id, opts)
|
340
491
|
send_post("delete_project/:#{project_id.to_s}", opts)
|
341
492
|
end
|
342
493
|
|
494
|
+
############################
|
495
|
+
####get_results#############
|
496
|
+
############################
|
343
497
|
# Returns a list of test results for a test
|
344
498
|
# @param test_id [int]
|
345
499
|
# @param [Hash] opts
|
346
|
-
# @example Endpoint
|
500
|
+
# @example Endpoint Example
|
347
501
|
# index.php?/api/v2/get_results/:test_id
|
348
502
|
# @see http://docs.gurock.com/testrail-api2/reference-results
|
349
503
|
def get_results(test_id, opts = {})
|
350
504
|
send_get("get_results/:#{test_id.to_s}", opts)
|
351
505
|
end
|
352
506
|
|
507
|
+
############################
|
508
|
+
####get_results_for_case####
|
509
|
+
############################
|
353
510
|
# Returns a list of test results for a test run and case combination
|
354
511
|
# @param run_id [int]
|
355
512
|
# @param case_id [int]
|
356
513
|
# @param [Hash] opts
|
357
|
-
# @example Endpoint
|
514
|
+
# @example Endpoint Example
|
358
515
|
# index.php?/api/v2/get_results_for_case/:run_id/:case_id
|
359
516
|
# @see http://docs.gurock.com/testrail-api2/reference-results
|
360
517
|
def get_results_for_case(run_id, case_id, opts = {})
|
361
518
|
send_get("get_results_for_case/:#{run_id.to_s}/:#{case_id.to_s}", opts)
|
362
519
|
end
|
363
520
|
|
521
|
+
############################
|
522
|
+
####get_results_for_run#####
|
523
|
+
############################
|
364
524
|
# Returns a list of test results for a test run
|
365
525
|
# @param run_id [int]
|
366
526
|
# @param [Hash] opts
|
367
|
-
# @example Endpoint
|
527
|
+
# @example Endpoint Example
|
368
528
|
# index.php?/api/v2/get_results_for_run/:run_id
|
369
529
|
# @see http://docs.gurock.com/testrail-api2/reference-results
|
370
530
|
def get_results_for_run(run_id, opts = {})
|
371
531
|
send_get("get_results_for_run/:#{run_id.to_s}", opts)
|
372
532
|
end
|
373
533
|
|
534
|
+
############################
|
535
|
+
####add_result##############
|
536
|
+
############################
|
374
537
|
# 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.
|
375
538
|
# @param test_id [int]
|
376
539
|
# @param [Hash] opts
|
377
|
-
# @example Endpoint
|
540
|
+
# @example Endpoint Example
|
378
541
|
# index.php?/api/v2/add_result/:test_id
|
379
542
|
# @see http://docs.gurock.com/testrail-api2/reference-results
|
380
543
|
def add_result(test_id, opts = {})
|
381
544
|
send_post("add_result/:#{test_id.to_s}", opts)
|
382
545
|
end
|
383
546
|
|
547
|
+
############################
|
548
|
+
####add_result_for_case#####
|
549
|
+
############################
|
384
550
|
# Adds a new test result, comment or assigns a test (for a test run and case combination)
|
385
551
|
# @param run_id [int]
|
386
552
|
# @param case_id [int]
|
387
553
|
# @param [Hash] opts
|
388
|
-
# @example Endpoint
|
554
|
+
# @example Endpoint Example
|
389
555
|
# index.php?/api/v2/add_result_for_case/:run_id/:case_id
|
390
556
|
# @see http://docs.gurock.com/testrail-api2/reference-results
|
391
557
|
def add_result_for_case(run_id, case_id, opts = {})
|
392
558
|
send_post("add_result_for_case/:#{run_id.to_s}/:#{case_id.to_s}", opts)
|
393
559
|
end
|
394
560
|
|
561
|
+
############################
|
562
|
+
####add_results#############
|
563
|
+
############################
|
395
564
|
# Adds one or more new test results, comments or assigns one or more tests
|
396
565
|
# @param run_id [int]
|
397
566
|
# @param [Hash] opts
|
398
|
-
# @example Endpoint
|
567
|
+
# @example Endpoint Example
|
399
568
|
# index.php?/api/v2/add_results/:run_id
|
400
569
|
# @see http://docs.gurock.com/testrail-api2/reference-results
|
401
570
|
def add_results(run_id, opts = {})
|
402
571
|
send_post("add_results/:#{run_id.to_s}", opts)
|
403
572
|
end
|
404
573
|
|
574
|
+
############################
|
575
|
+
####add_results_for_cases###
|
576
|
+
############################
|
405
577
|
# Adds one or more new test results, comments or assigns one or more tests (using the case IDs)
|
406
578
|
# @param run_id [int]
|
407
579
|
# @param [Hash] opts
|
408
|
-
# @example Endpoint
|
580
|
+
# @example Endpoint Example
|
409
581
|
# index.php?/api/v2/add_results_for_cases/:run_id
|
410
582
|
# @see http://docs.gurock.com/testrail-api2/reference-results
|
411
583
|
def add_results_for_cases(run_id, opts = {})
|
412
584
|
send_post("add_results_for_cases/:#{run_id.to_s}", opts)
|
413
585
|
end
|
414
586
|
|
587
|
+
############################
|
588
|
+
####get_run#################
|
589
|
+
############################
|
415
590
|
# Get run by run id
|
416
591
|
# @param run_id [int]
|
417
592
|
# @param [Hash] opts
|
418
|
-
# @example Endpoint
|
593
|
+
# @example Endpoint Example
|
419
594
|
# index.php?/api/v2/get_run/:run_id
|
420
595
|
# @see http://docs.gurock.com/testrail-api2/reference-runs
|
421
596
|
def get_run(run_id, opts = {})
|
422
597
|
send_get("get_run/:#{run_id.to_s}", opts)
|
423
598
|
end
|
424
599
|
|
600
|
+
############################
|
601
|
+
####get_runs################
|
602
|
+
############################
|
425
603
|
# Get runs by project id
|
426
604
|
# @param project_id [int]
|
427
605
|
# @param plan_id [int]
|
428
606
|
# @param [Hash] opts
|
429
|
-
# @example Endpoint
|
607
|
+
# @example Endpoint Example
|
430
608
|
# index.php?/api/v2/get_runs/:project_id
|
431
609
|
# @see http://docs.gurock.com/testrail-api2/reference-runs
|
432
610
|
def get_runs(project_id, opts = {})
|
433
611
|
send_get("get_runs/#{project_id.to_s}", opts)
|
434
612
|
end
|
435
613
|
|
614
|
+
############################
|
615
|
+
####add_run#################
|
616
|
+
############################
|
436
617
|
# Add run by suite id
|
437
618
|
# @param project_id [int]
|
438
619
|
# @param [Hash] opts
|
439
|
-
# @example Endpoint
|
620
|
+
# @example Endpoint Example
|
440
621
|
# index.php?/api/v2/add_run/:project_id
|
441
622
|
# @see http://docs.gurock.com/testrail-api2/reference-runs
|
442
623
|
def add_run(project_id, opts = {})
|
443
624
|
send_post("add_run/:#{project_id.to_s}", opts)
|
444
625
|
end
|
445
626
|
|
627
|
+
############################
|
628
|
+
####update_run##############
|
629
|
+
############################
|
446
630
|
# Updates existing test run
|
447
631
|
# @param run_id [int]
|
448
632
|
# @param [Hash] opts
|
449
|
-
# @example Endpoint
|
633
|
+
# @example Endpoint Example
|
450
634
|
# index.php?/api/v2/update_run/:run_id
|
451
635
|
# @see http://docs.gurock.com/testrail-api2/reference-runs
|
452
636
|
def update_run(run_id, opts = {})
|
453
637
|
send_post("update_run/:#{run_id.to_s}", opts)
|
454
638
|
end
|
455
639
|
|
640
|
+
############################
|
641
|
+
####close_run###############
|
642
|
+
############################
|
456
643
|
# Closes an existing test run and archives its tests & results
|
457
644
|
# @param run_id [int]
|
458
645
|
# @param [Hash] opts
|
459
|
-
# @example Endpoint
|
646
|
+
# @example Endpoint Example
|
460
647
|
# index.php?/api/v2/close_run/:run_id
|
461
648
|
# @see http://docs.gurock.com/testrail-api2/reference-runs
|
462
649
|
def close_run(run_id, opts = {})
|
463
650
|
send_post("close_run/#{run_id.to_s}", opts)
|
464
651
|
end
|
465
652
|
|
653
|
+
############################
|
654
|
+
####delete_run##############
|
655
|
+
############################
|
466
656
|
# Deletes an existing test run.
|
467
657
|
# @param run_id [int]
|
468
658
|
# @param [Hash] opts
|
469
|
-
# @example Endpoint
|
659
|
+
# @example Endpoint Example
|
470
660
|
# index.php?/api/v2/delete_run/:run_id
|
471
661
|
# @see http://docs.gurock.com/testrail-api2/reference-runs
|
472
662
|
def delete_run(run_id, opts = {})
|
473
663
|
send_post("delete_run/:#{run_id.to_s}", opts)
|
474
664
|
end
|
475
665
|
|
666
|
+
############################
|
667
|
+
####get_test################
|
668
|
+
############################
|
476
669
|
# Returns an existing test
|
477
670
|
# @param test_id [int]
|
478
671
|
# @param [Hash] opts
|
479
|
-
# @example Endpoint
|
672
|
+
# @example Endpoint Example
|
480
673
|
# index.php?/api/v2/get_test/:test_id
|
481
674
|
# @see http://docs.gurock.com/testrail-api2/reference-tests
|
482
675
|
def get_test(test_id, opts = {})
|
483
676
|
send_get("get_test/:#{test_id.to_s}", opts)
|
484
677
|
end
|
485
678
|
|
679
|
+
############################
|
680
|
+
####get_tests###############
|
681
|
+
############################
|
486
682
|
# Returns a list of tests for a test run
|
487
683
|
# @param run_id [int]
|
488
684
|
# @param [Hash] opts
|
489
|
-
# @example Endpoint
|
685
|
+
# @example Endpoint Example
|
490
686
|
# index.php?/api/v2/get_tests/:run_id
|
491
687
|
# @see http://docs.gurock.com/testrail-api2/reference-tests
|
492
688
|
def get_tests(run_id, opts = {})
|
data/lib/version.rb
CHANGED