testrail_api 0.1.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/README.md +10 -5
- data/lib/core_ext/array/to_list.rb +5 -0
- data/lib/core_ext/array.rb +1 -0
- data/lib/testrail_api/api.rb +37 -0
- data/lib/testrail_api/client/case_fields.rb +9 -9
- data/lib/testrail_api/client/case_types.rb +10 -2
- data/lib/testrail_api/client/cases.rb +92 -64
- data/lib/testrail_api/client/milestones.rb +3 -1
- data/lib/testrail_api/client/plans.rb +3 -1
- data/lib/testrail_api/client/priorities.rb +7 -5
- data/lib/testrail_api/client/projects.rb +26 -23
- data/lib/testrail_api/client/result_fields.rb +3 -1
- data/lib/testrail_api/client/results.rb +94 -92
- data/lib/testrail_api/client/runs.rb +60 -58
- data/lib/testrail_api/client/sections.rb +45 -48
- data/lib/testrail_api/client/statuses.rb +7 -6
- data/lib/testrail_api/client/suites.rb +31 -29
- data/lib/testrail_api/client/tests.rb +27 -30
- data/lib/testrail_api/client/users.rb +23 -22
- data/lib/testrail_api/client.rb +31 -25
- data/lib/testrail_api/default.rb +16 -0
- data/lib/testrail_api/version.rb +1 -1
- data/testrail_api.gemspec +3 -4
- metadata +12 -10
- data/lib/testrail_api/endpoints.rb +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52c66fb3d7da04169026a46c64ee81a9b3678eda
|
4
|
+
data.tar.gz: e9d7db52100d0b6be5fa8935a3082e17555e3435
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a1669767ea5341ebb7c2079157d79ff89ce84a6fd127944e1b7eb4d54250606ed4c73e28fe0d058fbda57df0bf7b98c1851eab99b7986959d23eef8590e3df0
|
7
|
+
data.tar.gz: afc8b886fbd51b9e642a12baa0e1df756ce0b3244647510db7eb847af0b9d44ef0ea20589300713731b4b8d9f53161efd646c29f8f0bca647994055e4bee7a18
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,14 +1,15 @@
|
|
1
|
-
# Testrail API v2
|
1
|
+
# Testrail API v2
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
[TestRail API v2](http://docs.gurock.com/testrail-api2/start) wrapper, written in Ruby.
|
4
|
+
|
5
|
+
[![Gem Version](https://badge.fury.io/rb/testrail_api.svg)](http://badge.fury.io/rb/testrail_api)
|
5
6
|
|
6
7
|
## Installation
|
7
8
|
|
8
9
|
Add this line to your application's Gemfile:
|
9
10
|
|
10
11
|
```ruby
|
11
|
-
gem 'testrail_api'
|
12
|
+
gem 'testrail_api', '~> 0.1.1'
|
12
13
|
```
|
13
14
|
|
14
15
|
And then execute:
|
@@ -26,6 +27,10 @@ client = TestRail::Client.new('example.testrail.com', 'admin@example.com', 'pass
|
|
26
27
|
puts client.projects
|
27
28
|
```
|
28
29
|
|
30
|
+
## Documentation
|
31
|
+
|
32
|
+
[http://www.rubydoc.info/gems/testrail_api](http://www.rubydoc.info/gems/testrail_api)
|
33
|
+
|
29
34
|
## Development
|
30
35
|
|
31
36
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
@@ -33,7 +38,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
33
38
|
## Contributing
|
34
39
|
|
35
40
|
Bug reports and pull requests are welcome on GitHub at https://github.com/kirillzh/testrail_api. This project is
|
36
|
-
intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
|
41
|
+
intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org/) code of conduct.
|
37
42
|
|
38
43
|
|
39
44
|
## License
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'array/to_list'
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'testrail_api/client/case_fields'
|
2
|
+
require 'testrail_api/client/case_types'
|
3
|
+
require 'testrail_api/client/cases'
|
4
|
+
require 'testrail_api/client/milestones'
|
5
|
+
require 'testrail_api/client/plans'
|
6
|
+
require 'testrail_api/client/priorities'
|
7
|
+
require 'testrail_api/client/projects'
|
8
|
+
require 'testrail_api/client/result_fields'
|
9
|
+
require 'testrail_api/client/results'
|
10
|
+
require 'testrail_api/client/runs'
|
11
|
+
require 'testrail_api/client/sections'
|
12
|
+
require 'testrail_api/client/statuses'
|
13
|
+
require 'testrail_api/client/suites'
|
14
|
+
require 'testrail_api/client/tests'
|
15
|
+
require 'testrail_api/client/users'
|
16
|
+
|
17
|
+
module TestRail
|
18
|
+
class Client
|
19
|
+
module API
|
20
|
+
include TestRail::Client::CaseFields
|
21
|
+
include TestRail::Client::CaseTypes
|
22
|
+
include TestRail::Client::Cases
|
23
|
+
include TestRail::Client::Milestones
|
24
|
+
include TestRail::Client::Plans
|
25
|
+
include TestRail::Client::Priorities
|
26
|
+
include TestRail::Client::Projects
|
27
|
+
include TestRail::Client::ResultFields
|
28
|
+
include TestRail::Client::Results
|
29
|
+
include TestRail::Client::Runs
|
30
|
+
include TestRail::Client::Sections
|
31
|
+
include TestRail::Client::Statuses
|
32
|
+
include TestRail::Client::Suites
|
33
|
+
include TestRail::Client::Tests
|
34
|
+
include TestRail::Client::Users
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -1,17 +1,17 @@
|
|
1
1
|
module TestRail
|
2
2
|
class Client
|
3
3
|
# Methods for the Case Fields API
|
4
|
+
#
|
4
5
|
# Use the following API methods to request details about custom fields for test cases.
|
5
|
-
|
6
6
|
# @see http://docs.gurock.com/testrail-api2/reference-cases-fields
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
7
|
+
module CaseFields
|
8
|
+
# List all available test case custom fields
|
9
|
+
#
|
10
|
+
# @return [Array<Hash>] a list of available test case custom fields
|
11
|
+
# @see http://docs.gurock.com/testrail-api2/reference-cases-fields#get_case_fields
|
12
|
+
def case_fields
|
13
|
+
get('get_case_fields')
|
14
|
+
end
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
@@ -2,9 +2,17 @@ module TestRail
|
|
2
2
|
class Client
|
3
3
|
# Methods for the Case Types API
|
4
4
|
#
|
5
|
+
# Use the following API methods to request details about custom types for test cases.
|
5
6
|
# @see http://docs.gurock.com/testrail-api2/reference-cases-types
|
6
|
-
|
7
|
-
|
7
|
+
module CaseTypes
|
8
|
+
# List all available test case custom types
|
9
|
+
#
|
10
|
+
# @return [Array<Hash>] a list of available test case custom types
|
11
|
+
# @see http://docs.gurock.com/testrail-api2/reference-cases-types#get_case_types
|
12
|
+
def case_types
|
13
|
+
get('get_case_types')
|
14
|
+
end
|
8
15
|
end
|
9
16
|
end
|
10
17
|
end
|
18
|
+
|
@@ -2,77 +2,105 @@ module TestRail
|
|
2
2
|
class Client
|
3
3
|
# Methods for the Cases API
|
4
4
|
#
|
5
|
+
# Use the following API methods to request details about test cases and to create or modify test cases.
|
5
6
|
# @see http://docs.gurock.com/testrail-api2/reference-cases
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
7
|
+
module Cases
|
8
|
+
# Returns an existing test case
|
9
|
+
#
|
10
|
+
# @param case_id [Integer, String] The ID of the test case
|
11
|
+
# @return [Hash] an existing test case
|
12
|
+
# @see http://docs.gurock.com/testrail-api2/reference-cases#get_case
|
13
|
+
def case(case_id)
|
14
|
+
get("get_case/#{case_id}")
|
15
|
+
end
|
15
16
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
17
|
+
#
|
18
|
+
# Returns a list of test cases for a test suite or specific section in a test suite.
|
19
|
+
#
|
20
|
+
# @param project_id [Integer, String] The ID of the project the test run should be added to
|
21
|
+
# @param suite_id [Integer, String] The ID of the test suite (optional if the project is operating in single suite mode)
|
22
|
+
# @param filters [Hash] A customizable set of filters
|
23
|
+
# @option filters [Integer, String] :section_id The ID of the section
|
24
|
+
# @option filters [Integer, String] :created_after Only return test cases created after this date (as UNIX timestamp).
|
25
|
+
# @option filters [Integer, String] :created_before Only return test cases created before this date (as UNIX timestamp).
|
26
|
+
# @option filters [Array<Integer>] :created_by A comma-separated list of creators (user IDs) to filter by.
|
27
|
+
# @option filters [Array<Integer>] :milestone_id A comma-separated list of milestone IDs to filter by (not available if the milestone field is disabled for the project).
|
28
|
+
# @option filters [Array<Integer>] :priority_id A comma-separated list of priority IDs to filter by.
|
29
|
+
# @option filters [Array<Integer>] :type_id A comma-separated list of case type IDs to filter by.
|
30
|
+
# @option filters [Integer, String] :updated_after Only return test cases updated after this date (as UNIX timestamp).
|
31
|
+
# @option filters [Integer, String] :updated_before Only return test cases updated before this date (as UNIX timestamp).
|
32
|
+
# @option filters [Array<Integer>] :updated_by A comma-separated list of users who updated test cases to filter by.
|
33
|
+
# @return a list of test cases for a test suite or specific section in a test suite.
|
34
|
+
# The response includes an array of test cases.
|
35
|
+
# Each test case in this list follows the same format as TestRail#Client#Cases#case
|
36
|
+
# @see http://docs.gurock.com/testrail-api2/reference-cases#get_cases
|
37
|
+
def cases(project_id, suite_id, filters = {})
|
38
|
+
get("get_cases/#{project_id}&suite_id=#{suite_id}",
|
39
|
+
params: {
|
40
|
+
section_id: filters[:section_id],
|
41
|
+
created_after: filters[:created_after],
|
42
|
+
created_before: filters[:created_before],
|
43
|
+
created_by: filters[:created_by].to_list,
|
44
|
+
milestone_id: filters[:milestone_id].to_list,
|
45
|
+
priority_id: filters[:priority_id].to_list,
|
46
|
+
type_id: filters[:type_id].to_list,
|
47
|
+
updated_after: filters[:updated_after],
|
48
|
+
updated_before: filters[:updated_before],
|
49
|
+
updated_by: filters[:updated_by].to_list
|
50
|
+
})
|
51
|
+
end
|
37
52
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
53
|
+
#
|
54
|
+
# Creates a new test case.
|
55
|
+
#
|
56
|
+
# @param section_id [Integer, String] The ID of the section the test case should be added to
|
57
|
+
# @param filters [Hash] A customizable set of filters
|
58
|
+
# @option filters [String] :title The title of the test case (required)
|
59
|
+
# @option filters [Integer] :type_id The ID of the case type
|
60
|
+
# @option filters [Integer] :priority_id The ID of the case priority
|
61
|
+
# @option filters [String, Integer] :estimate The estimate, e.g. "30s" or "1m 45s"
|
62
|
+
# @option filters [Integer] :milestone_id The ID of the milestone to link to the test case
|
63
|
+
# @option filters [String] :refs A comma-separated list of references/requirements
|
64
|
+
# @return [Hash] created case
|
65
|
+
# TODO: finish custom fields
|
66
|
+
# @see http://docs.gurock.com/testrail-api2/reference-cases#add_case
|
67
|
+
def add_case(section_id, filters)
|
68
|
+
post("add_case/#{section_id}",
|
69
|
+
body: {
|
70
|
+
title: filters[:title],
|
71
|
+
type_id: filters[:type_id].to_list,
|
72
|
+
priority_id: filters[:priority_id].to_list,
|
73
|
+
estimate: filters[:estimate],
|
74
|
+
milestone_id: filters[:milestone_id],
|
75
|
+
refs: filters[:refs]
|
76
|
+
}.to_json)
|
77
|
+
end
|
55
78
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
def case_by_name(_case_name)
|
61
|
-
# TODO: implement get_case_by_name
|
62
|
-
end
|
79
|
+
# @return [Array] array of cases IDs using TestRail#Client#Case#cases method (parameters are the same)
|
80
|
+
def cases_ids(project_id, suite_id, filters = {})
|
81
|
+
cases(project_id, suite_id, filters).map { |x| x['id'] }
|
82
|
+
end
|
63
83
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
cases(project_id, suite_id, section_id).map { |x| x['id'] }
|
68
|
-
end
|
84
|
+
def cases_by_title(title, project_id, suite_id, filters = {})
|
85
|
+
cases(project_id, suite_id, filters).find { |test_case| test_case['title'] == title }
|
86
|
+
end
|
69
87
|
|
70
|
-
|
71
|
-
#
|
72
|
-
|
88
|
+
# Updates an existing test case (partial updates are supported, i.e. you can submit and update specific fields only).
|
89
|
+
# This method supports the same POST fields as TestRail#Client#Case#add_case (except section_id)
|
90
|
+
def update_case(case_id, body)
|
91
|
+
body[:type_id] = body[:type_id].to_list if body[:type_id]
|
92
|
+
body[:priority_id] = body[:priority_id].to_list if body[:type_id]
|
93
|
+
post("update_case/#{case_id}", body: body)
|
94
|
+
end
|
73
95
|
|
74
|
-
|
75
|
-
#
|
96
|
+
# Deletes an existing test case.
|
97
|
+
# Please note: Deleting a test case cannot be undone and also permanently deletes all test results in active test
|
98
|
+
# runs (i.e. test runs that haven't been closed (archived) yet).
|
99
|
+
#
|
100
|
+
# @param case_id [Integer, String] The ID of the test case
|
101
|
+
def delete_case(case_id)
|
102
|
+
post("delete_case/#{case_id}")
|
103
|
+
end
|
76
104
|
end
|
77
105
|
end
|
78
106
|
end
|
@@ -3,11 +3,13 @@ module TestRail
|
|
3
3
|
# Methods for the Priorities API
|
4
4
|
#
|
5
5
|
# @see http://docs.gurock.com/testrail-api2/reference-priorities
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
6
|
+
module Priorities
|
7
|
+
#
|
8
|
+
# Returns a list of available priorities
|
9
|
+
#
|
10
|
+
def priorities
|
11
|
+
get('get_priorities')
|
12
|
+
end
|
11
13
|
end
|
12
14
|
end
|
13
15
|
end
|
@@ -3,32 +3,35 @@ module TestRail
|
|
3
3
|
# Methods for the Projects API
|
4
4
|
#
|
5
5
|
# @see http://docs.gurock.com/testrail-api2/reference-projects
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
6
|
+
module Projects
|
7
|
+
#
|
8
|
+
# Returns the list of available projects.
|
9
|
+
#
|
10
|
+
def projects
|
11
|
+
get('get_projects')
|
12
|
+
end
|
12
13
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
#
|
18
|
-
def project(project_id)
|
19
|
-
get("get_project/#{project_id}")
|
20
|
-
end
|
14
|
+
# TODO: finish docs
|
15
|
+
def projects_ids
|
16
|
+
projects.map { |x| x['id'] }
|
17
|
+
end
|
21
18
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
19
|
+
#
|
20
|
+
# Returns an existing project by its ID.
|
21
|
+
#
|
22
|
+
# :project_id The ID of the project
|
23
|
+
#
|
24
|
+
def project(project_id)
|
25
|
+
get("get_project/#{project_id}")
|
26
|
+
end
|
27
|
+
|
28
|
+
#
|
29
|
+
# Returns an existing project by its name.
|
30
|
+
#
|
31
|
+
# :project_name The name of the project
|
32
|
+
#
|
33
|
+
def project_by_name(project_name)
|
29
34
|
projects.find { |project| project['name'].casecmp(project_name) == 0 }
|
30
|
-
else
|
31
|
-
projects.find { |project| project['name'] == project_name }
|
32
35
|
end
|
33
36
|
end
|
34
37
|
end
|
@@ -5,104 +5,106 @@ module TestRail
|
|
5
5
|
# Use the following API methods to request details about test results and to add new test results.
|
6
6
|
#
|
7
7
|
# @see http://docs.gurock.com/testrail-api2/reference-results
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
8
|
+
module Results
|
9
|
+
#
|
10
|
+
# Returns a list of test results for a test.
|
11
|
+
#
|
12
|
+
# @param [Integer, String] test_id The ID of the test
|
13
|
+
# @return a list of test results for a test
|
14
|
+
# @see http://docs.gurock.com/testrail-api2/reference-results#get_results
|
15
|
+
def results(test_id)
|
16
|
+
get("get_results/#{test_id}")
|
17
|
+
end
|
17
18
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
19
|
+
#
|
20
|
+
# Returns a list of test results for a test run and case combination.
|
21
|
+
# The difference to get_results is that this method expects a test run + test case instead of a test. In TestRail,
|
22
|
+
# tests are part of a test run and the test cases are part of the related test suite.
|
23
|
+
# So, when you create a new test run, TestRail creates a test for each test case found in the test suite of the run.
|
24
|
+
# You can therefore think of a test as an “instance” of a test case which can have test results, comments and a test status.
|
25
|
+
# Please also see TestRail's getting started guide for more details about the differences between test cases and tests.
|
26
|
+
#
|
27
|
+
# This method uses the same response format as get_results.
|
28
|
+
#
|
29
|
+
# :run_id The ID of the test run
|
30
|
+
# :case_id The ID of the test case
|
31
|
+
#
|
32
|
+
def results_for_case(run_id, case_id)
|
33
|
+
get("get_results_for_case/#{run_id}/#{case_id}")
|
34
|
+
end
|
34
35
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
36
|
+
#
|
37
|
+
# Returns a list of test results for a test run.
|
38
|
+
#
|
39
|
+
# :run_id The ID of the test run
|
40
|
+
#
|
41
|
+
def results_for_run(run_id)
|
42
|
+
get("get_results_for_run/#{run_id}")
|
43
|
+
end
|
43
44
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
45
|
+
# TODO: add custom fields docs
|
46
|
+
#
|
47
|
+
# Adds a new test result, comment or assigns a test.
|
48
|
+
# It's recommended to use #add_results instead if you plan to add results for multiple tests.
|
49
|
+
#
|
50
|
+
# @param [Integer, String] test_id The ID of the test the result should be added to
|
51
|
+
# @param data [Hash]: Optional query data
|
52
|
+
# @option data [Integer, String] :status_id The ID of the test status. The built-in system statuses have the
|
53
|
+
# following IDs:
|
54
|
+
# 1 Passed
|
55
|
+
# 2 Blocked
|
56
|
+
# 3 Untested (not allowed when adding a result)
|
57
|
+
# 4 Retest
|
58
|
+
# 5 Failed
|
59
|
+
# You can get a full list of system and custom statuses via #TestRail#Client#Statuses#get_statuses.
|
60
|
+
# @option data [String] :comment The comment / description for the test result
|
61
|
+
# @option data [String] :version The version or build you tested against
|
62
|
+
# @option data [String] :elapsed The time it took to execute the test, e.g. "30s" or "1m 45s"
|
63
|
+
# @option data [Array<Integer>, Array<String>] :defects A comma-separated list of defects to link to the test result
|
64
|
+
# @option data [Integer, String] :assignedto_id The ID of a user the test should be assigned to
|
65
|
+
# @return the new test result using the same response format as get_results, but with a single result instead of a list of results.
|
66
|
+
# @see http://docs.gurock.com/testrail-api2/reference-results#add_result
|
67
|
+
def add_result(test_id, data)
|
68
|
+
post("add_result/#{test_id}", data)
|
69
|
+
end
|
69
70
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
71
|
+
#
|
72
|
+
# Adds a new test result, comment or assigns a test (for a test run and case combination).
|
73
|
+
# It's recommended to use add_results_for_cases instead if you plan to add results for multiple test cases.
|
74
|
+
# The difference to add_result is that this method expects a test run + test case instead of a test.
|
75
|
+
# In TestRail, tests are part of a test run and the test cases are part of the related test suite.
|
76
|
+
# So, when you create a new test run, TestRail creates a test for each test case found in the test suite of the run.
|
77
|
+
# You can therefore think of a test as an “instance” of a test case which can have test results, comments and a test status.
|
78
|
+
# Please also see TestRail's getting started guide for more details about the differences between test cases and tests.
|
79
|
+
#
|
80
|
+
# This method supports the same POST fields as add_result.
|
81
|
+
#
|
82
|
+
# :run_id The ID of the test run
|
83
|
+
# :case_id The ID of the test case
|
84
|
+
#
|
85
|
+
def add_result_for_case(run_id, case_id, data)
|
86
|
+
post("add_result_for_case/#{run_id}/#{case_id}", data)
|
87
|
+
end
|
87
88
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
89
|
+
#
|
90
|
+
# Adds a new test result, comment or assigns a test.
|
91
|
+
# It's recommended to use add_results instead if you plan to add results for multiple tests.
|
92
|
+
#
|
93
|
+
# :run_id The ID of the test run
|
94
|
+
#
|
95
|
+
def add_results(run_id, data)
|
96
|
+
post("add_results/#{run_id}", data)
|
97
|
+
end
|
97
98
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
99
|
+
#
|
100
|
+
# Adds one or more new test results, comments or assigns one or more tests (using the case IDs).
|
101
|
+
# Ideal for test automation to bulk-add multiple test results in one step.
|
102
|
+
#
|
103
|
+
# :run_id The ID of the test run the results should be added to
|
104
|
+
#
|
105
|
+
def add_results_for_cases(run_id, data)
|
106
|
+
post("add_results_for_cases/#{run_id}", data)
|
107
|
+
end
|
106
108
|
end
|
107
109
|
end
|
108
110
|
end
|