cukerail 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/cukerail.gemspec +1 -1
- data/lib/cukerail/version.rb +1 -1
- data/lib/cukerail.rb +1 -1
- data/lib/json_sender.rb +20 -15
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc30db711911d6de4d7fb78e417bfd5bdd0ec556
|
4
|
+
data.tar.gz: bdb566591c7568519c5a4955491b56906745871d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4dc65897d681b33a247e1d880b8a4c6c0c2588aed8c3eb85637848cdb9b1183287cc09beef706b78c9416b86f4b99af303346e5254d21d539a6d19c9e0b8c60b
|
7
|
+
data.tar.gz: df9d419fd7e60e2dbe8e08b01addd3e28d49e58a0c784aad580c4e5773baef04c0b7c213985e4df5c27a8c082e5e91998fb86e0fe3fff7490aea2b77f5dbef35
|
data/cukerail.gemspec
CHANGED
@@ -23,5 +23,5 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.add_development_dependency "rake","~>10.4"
|
24
24
|
spec.add_development_dependency "rspec","~>3.2"
|
25
25
|
spec.add_development_dependency "pry","~>0.10"
|
26
|
-
spec.add_development_dependency "
|
26
|
+
spec.add_development_dependency "awesome_print"
|
27
27
|
end
|
data/lib/cukerail/version.rb
CHANGED
data/lib/cukerail.rb
CHANGED
@@ -186,7 +186,7 @@ module Cukerail
|
|
186
186
|
end
|
187
187
|
|
188
188
|
def defects(test_case)
|
189
|
-
all_tags(test_case).select{|tag| tag.name =~/jira_/}.map{|ticket|
|
189
|
+
all_tags(test_case).select{|tag| tag.name =~/jira_/}.map{|ticket| /\w+-\d+/.match(ticket.name)[0]}.join(" ")
|
190
190
|
end
|
191
191
|
|
192
192
|
def update_run(testrun,case_ids)
|
data/lib/json_sender.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require_relative "cukerail/version"
|
2
2
|
require_relative "cukerail/testrail"
|
3
3
|
require 'json' unless JSON
|
4
|
+
require 'awesome_print'
|
4
5
|
module Cukerail
|
5
6
|
class JsonSender
|
6
7
|
attr_reader :testrail_api_client,:results
|
@@ -117,42 +118,46 @@ module Cukerail
|
|
117
118
|
end
|
118
119
|
|
119
120
|
def get_run(run_id)
|
120
|
-
testrail_api_client.send_get("get_run/#{run_id}")
|
121
|
+
@test_run ||= testrail_api_client.send_get("get_run/#{run_id}")
|
122
|
+
ap @test_run
|
123
|
+
puts "test plan = #{@test_run['plan_id']}"
|
124
|
+
@test_run
|
121
125
|
end
|
122
126
|
|
123
127
|
def get_tests_in_a_run(run_id)
|
124
|
-
testrail_api_client.send_get("get_tests/#{run_id}")
|
128
|
+
@all_tests ||= testrail_api_client.send_get("get_tests/#{run_id}")
|
125
129
|
end
|
126
130
|
|
127
|
-
def update_run(
|
131
|
+
def update_run(testrun_id,case_ids)
|
132
|
+
run = get_run(testrun_id)
|
128
133
|
begin
|
129
|
-
testrail_api_client.send_post("update_run/#{
|
134
|
+
testrail_api_client.send_post("update_run/#{testrun_id}",case_ids)
|
130
135
|
rescue => e
|
131
|
-
puts "#{e.message} testrun=#{
|
136
|
+
puts "#{e.message} testrun=#{testrun_id} test case ids=#{case_ids}"
|
132
137
|
end
|
133
138
|
end
|
134
139
|
|
135
|
-
def remove_case_from_test_run(testcase,
|
140
|
+
def remove_case_from_test_run(testcase,testrun_id)
|
136
141
|
testcase_id = get_id(testcase)
|
137
|
-
run = get_run(
|
142
|
+
run = get_run(testrun_id)
|
138
143
|
unless run['include_all']
|
139
|
-
case_ids = get_tests_in_a_run(
|
140
|
-
update_run(
|
144
|
+
case_ids = get_tests_in_a_run(testrun_id).map{|h| h['case_id']} - [testcase_id]
|
145
|
+
update_run(testrun_id,{'case_ids'=>case_ids})
|
141
146
|
end
|
142
147
|
end
|
143
148
|
|
144
149
|
def add_case_to_test_run(testcase_id,testrun)
|
145
|
-
run = get_run(
|
150
|
+
run = get_run(testrun_id)
|
146
151
|
unless run['include_all']
|
147
|
-
case_ids = get_tests_in_a_run(
|
148
|
-
update_run(
|
152
|
+
case_ids = get_tests_in_a_run(testrun_id).map{|h| h['case_id']} + [testcase_id]
|
153
|
+
update_run(testrun_id,{'case_ids'=>case_ids})
|
149
154
|
end
|
150
155
|
end
|
151
156
|
|
152
|
-
def remove_all_except_these_cases_from_testrun(testcases,
|
153
|
-
run = get_run(
|
157
|
+
def remove_all_except_these_cases_from_testrun(testcases,testrun_id)
|
158
|
+
run = get_run(testrun_id)
|
154
159
|
unless run['include_all']
|
155
|
-
case_ids = get_tests_in_a_run(
|
160
|
+
case_ids = get_tests_in_a_run(testrun_id).map{|h| h['case_id']} & testcases
|
156
161
|
update_run(testrun,{'case_ids'=>case_ids})
|
157
162
|
end
|
158
163
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cukerail
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Small
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -67,19 +67,19 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0.10'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: awesome_print
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '0
|
75
|
+
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '0
|
82
|
+
version: '0'
|
83
83
|
description: Allows you to sync your Testrail testcases from feature files and send
|
84
84
|
test results into Testrail testruns
|
85
85
|
email:
|