cukerail 0.0.9 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 66343a93c60cfe15d03e38401b48d5ebf7cf2016
4
- data.tar.gz: c4d4777b290d374c4fd5821cbecee6d01feed315
3
+ metadata.gz: 6dd3b90d489a9ccc378f9f37b67b85372501affd
4
+ data.tar.gz: 6b77ffe9909fc103fc0b17eb87995bde6c787e45
5
5
  SHA512:
6
- metadata.gz: 651441f7d9354a6b292525f9e2f906cf380786738664b7ba4e13de8594d51b2df0dc199f13a0df1193091a5ec82d456ebd7ce2233e9185f38dc8c2bbede9ccfa
7
- data.tar.gz: 53dd0678946cda73413fd90d77b7a11b012427c13c3a41cf2a2d8d9a3db5352c2f38a96d23a817de27f86d99844e512f77941e8ef7b88fd99984c118cb285f87
6
+ metadata.gz: aa6b5a5f7df8af0726302e031e6c49550f0c3448e14ae8927a8d6bc2afd54135ccdc3d3dff329127b010eb2b5d235789f31b833ac2d8dc74538d105ae42d0bc8
7
+ data.tar.gz: 229488f7e28312ae349732d3eb8a2f7b979783309b2832824df57af24f171e73a7c4aa0767a70f5ea6203e6d140c522d745d93172904170b140d0f55efe175fe
@@ -1,3 +1,3 @@
1
1
  module Cukerail
2
- VERSION = "0.0.9"
2
+ VERSION = "0.1.0"
3
3
  end
data/lib/cukerail.rb CHANGED
@@ -92,14 +92,22 @@ module Cukerail
92
92
  str
93
93
  end.join("\n")
94
94
  is_manual = test_case.tags.any?{|tag| tag.name =~/manual/}
95
- data = {'title'=>extract_title(test_case),'type_id'=>(is_manual ? 7 : 1 ),'custom_steps'=>steps_as_string}
95
+ data = {'title'=>extract_title(test_case),
96
+ 'type_id'=>(is_manual ? 7 : 1 ),
97
+ 'custom_steps'=>steps_as_string,
98
+ 'refs'=>defects(test_case)
99
+ }
96
100
  testrail_api_client.send_post("update_case/#{id}",data)
97
101
  end
98
102
 
99
103
  def create_new_case(project_id,suite_id,sub_section_id,test_case)
100
104
  is_manual = test_case.tags.any?{|tag| tag.name =~/manual/}
101
105
  steps_as_string = test_case.test_steps.map{|step| step.source.last}.select{|step| step.is_a?(Cucumber::Core::Ast::Step)}.map{|step| "#{step.keyword}#{step.name}"}.join("\n")
102
- data = {'title'=>extract_title(test_case),'type_id'=>(is_manual ? 7 : 1 ),'custom_steps'=>steps_as_string}
106
+ data = {'title'=>extract_title(test_case),
107
+ 'type_id'=>(is_manual ? 7 : 1 ),
108
+ 'custom_steps'=>steps_as_string,
109
+ 'refs'=>defects(test_case)
110
+ }
103
111
  testrail_api_client.send_post("add_case/#{sub_section_id || suite_id}", data)
104
112
  end
105
113
 
@@ -123,8 +131,7 @@ module Cukerail
123
131
  else
124
132
  failure_message = nil
125
133
  end
126
- defects = test_case.tags.select{|tag| tag.name =~/jira_/}.map{|ticket| /STORE-\d+/.match(ticket.name)[0]}.join(" ")
127
- report_on_result = {status_id:testrail_status[:id],comment:failure_message,defects:defects}
134
+ report_on_result = {status_id:testrail_status[:id],comment:failure_message,defects:defects(test_case)}
128
135
  begin
129
136
  testrail_api_client.send_post("add_result_for_case/#{testrun}/#{id}",report_on_result)
130
137
  rescue => e
@@ -147,6 +154,10 @@ module Cukerail
147
154
  test_case.tags + test_case.feature.tags
148
155
  end
149
156
 
157
+ def defects(test_case)
158
+ all_tags(test_case).select{|tag| tag.name =~/jira_/}.map{|ticket| /STORE-\d+/.match(ticket.name)[0]}.join(" ")
159
+ end
160
+
150
161
  end
151
162
 
152
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.0.9
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Small
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-11 00:00:00.000000000 Z
11
+ date: 2015-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -120,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
120
  version: '0'
121
121
  requirements: []
122
122
  rubyforge_project:
123
- rubygems_version: 2.2.2
123
+ rubygems_version: 2.4.8
124
124
  signing_key:
125
125
  specification_version: 4
126
126
  summary: Integrates Cucumber and Testrail from Gurock Software