testrail-ruby 0.0.28 → 0.0.29
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/endpoints.rb +34 -15
- data/lib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9fababdb47877a98b0af381779e41742b0473b9d
|
4
|
+
data.tar.gz: e07143b1223c7bf4b2bedd23ce8b40f7865ac380
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c56f29fdab8c80181aa06aa97254c683ae91da48e0cc61b229471b6625ab7ddabe805e5a45edaeff3cbd46662eeb9a10fc604f20537e2dc5d21289ddb46f26b
|
7
|
+
data.tar.gz: 54f6efd89094778832c9121afaba520c32dadf7d513a3b174a3f1f0b9cbd5b0e429e0c6c7b55c9c75aafd37a8e3b7348e18317bc7f7b7c88cd9095dbe5beef57
|
data/lib/endpoints.rb
CHANGED
@@ -81,20 +81,22 @@ module Endpoints
|
|
81
81
|
####add_case################
|
82
82
|
############################
|
83
83
|
# Creates a new test case
|
84
|
-
# @param section_id [int] The
|
85
|
-
# @param [Hash] opts
|
86
|
-
# @option opts [string] :title
|
87
|
-
# @option opts [int] :template_id
|
88
|
-
# @option opts [int] :type_id
|
89
|
-
# @option opts [int] :priority_id
|
90
|
-
# @option opts [timespan] :estimate
|
91
|
-
# @option opts [int] :milestone_id
|
92
|
-
# @option opts [string] :refs
|
84
|
+
# @param section_id [int] The ID of the section the test case should be added to
|
85
|
+
# @param [Hash] opts
|
86
|
+
# @option opts [string] :title The title of the test case (required)
|
87
|
+
# @option opts [int] :template_id The ID of the template (field layout) (requires TestRail 5.2 or later)
|
88
|
+
# @option opts [int] :type_id The ID of the case type
|
89
|
+
# @option opts [int] :priority_id The ID of the case priority
|
90
|
+
# @option opts [timespan] :estimate The estimate, e.g. "30s" or "1m 45s"
|
91
|
+
# @option opts [int] :milestone_id The ID of the milestone to link to the test case
|
92
|
+
# @option opts [string] :refs A comma-separated list of references/requirements
|
93
|
+
# @option opts [varies] :custom_fields Custom fields are supported as well and must be submitted with their system name, prefixed with 'custom_'
|
93
94
|
# @example Code Example
|
94
95
|
# @client.add_case(1, {"title":"testCaseName", "type_id":1})
|
95
96
|
# @example Endpoint Example
|
96
97
|
# index.php?/api/v2/add_case/1&title="foo"&type_id=1
|
97
98
|
# @see http://docs.gurock.com/testrail-api2/reference-cases
|
99
|
+
# @note For more information about custom fields, see guroc docs
|
98
100
|
def add_case(section_id, opts = {})
|
99
101
|
send_post("add_case/#{section_id.to_s}", opts)
|
100
102
|
end
|
@@ -204,17 +206,21 @@ module Endpoints
|
|
204
206
|
send_get("get_section/:#{section_id.to_s}", opts)
|
205
207
|
end
|
206
208
|
|
207
|
-
|
209
|
+
##########################++
|
208
210
|
####get_sections############
|
209
211
|
############################
|
210
212
|
# Get sections for suite
|
211
|
-
# @param
|
213
|
+
# @param project_id [int]
|
212
214
|
# @param [Hash] opts
|
215
|
+
# @options opts [int] :suite_id
|
213
216
|
# @example Endpoint Example
|
214
|
-
# index.php?/api/v2/get_sections
|
217
|
+
# index.php?/api/v2/get_sections/1&suite_id=2
|
218
|
+
# @example Code Example
|
219
|
+
# client.get_sections(1, {"suite_id":2})
|
215
220
|
# @see http://docs.gurock.com/testrail-api2/reference-sections
|
216
|
-
def get_sections(project_id,
|
217
|
-
|
221
|
+
def get_sections(project_id, opts = {})
|
222
|
+
options = opts.to_a.map { |x| "#{x[0]}=#{x[1]}" }.join("&")
|
223
|
+
send_get("get_sections/#{project_id.to_s}&#{options}")
|
218
224
|
end
|
219
225
|
|
220
226
|
############################
|
@@ -425,13 +431,26 @@ module Endpoints
|
|
425
431
|
send_get("get_project/#{project_id.to_s}&#{options}")
|
426
432
|
end
|
427
433
|
|
428
|
-
|
434
|
+
##########################++
|
429
435
|
####get_projects############
|
430
436
|
############################
|
431
437
|
# Get all projects
|
432
438
|
# @param [Hash] opts
|
439
|
+
# @option opts [bool] :is_completed 1 == completed projects, 2 == active projects
|
433
440
|
# @example Endpoint Example
|
434
441
|
# index.php?/api/v2/get_projects
|
442
|
+
# @example Code Example [get all projects]
|
443
|
+
# client.get_projects
|
444
|
+
# @example Code Example [get active projects]
|
445
|
+
# client.get_projects({'is_completed':0})
|
446
|
+
# @example Code Example [get completed projects]
|
447
|
+
# client.get_projects({'is_completed':1})
|
448
|
+
# @example Response Example
|
449
|
+
# [
|
450
|
+
# { "id": 1, "name": "Project1", ... },
|
451
|
+
# { "id": 2, "name": "Project2", ... },
|
452
|
+
# ..
|
453
|
+
# ]
|
435
454
|
# @see http://docs.gurock.com/testrail-api2/reference-projects
|
436
455
|
def get_projects(opts = {})
|
437
456
|
options = opts.to_a.map { |x| "#{x[0]}=#{x[1]}" }.join("&")
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: testrail-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.29
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Frances Morales
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|