cukerail 0.6.3 → 0.6.4
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/.gitignore +1 -0
- data/lib/cukerail/version.rb +1 -1
- data/lib/cukerail.rb +7 -6
- data/lib/json_sender.rb +16 -10
- 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: acbe632026d6a5cd33ee306e3945632d4d6dbd36
|
4
|
+
data.tar.gz: 6e77965518ae731c673d8ed1448b96ea9716700f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd9cb997cef8ea267464400419803a777dee9c2c1dedf7f9e25ac2c2322aa4a0e15e12c3b3d35691d0b5358c00636287f5c44771145ed134e2c61df20cadbbc0
|
7
|
+
data.tar.gz: 491648c6ed448ef4f51fa15d183d2336a50efb433f6a64c2c215b3f19e0959753944182567f224a74864e8eeedeebf0f9ca9a3ed4ee8c4c38550f64535c336dc
|
data/.gitignore
CHANGED
data/lib/cukerail/version.rb
CHANGED
data/lib/cukerail.rb
CHANGED
@@ -62,16 +62,17 @@ module Cukerail
|
|
62
62
|
if tagged_id
|
63
63
|
result = /testcase_(\d+)/.match(tagged_id.name)[1]
|
64
64
|
else
|
65
|
-
tags =
|
66
|
-
project_id = /\d+/.match(tags.select{|tag| tag.name =~/project/}.
|
67
|
-
suite_id = /\d+/.match(tags.select{|tag| tag.name =~/suite/}.
|
65
|
+
tags = test_case.tags
|
66
|
+
project_id = /\d+/.match(tags.select{|tag| tag.name =~/project/}.last.name)[0]
|
67
|
+
suite_id = /\d+/.match(tags.select{|tag| tag.name =~/suite/}.last.name)[0]
|
68
|
+
section_id = /\d+/.match(tags.select{|tag| tag.name =~/sub_section/}.last.name)[0]
|
69
|
+
puts section_id
|
68
70
|
title = extract_title(test_case)
|
69
|
-
found_case = testrail_api_client.send_get("get_cases/#{project_id}&suite_id=#{suite_id}").select{|c| c['title'] == title}.first
|
71
|
+
found_case = testrail_api_client.send_get("get_cases/#{project_id}&suite_id=#{suite_id}§ion_id=#{section_id}").select{|c| c['title'] == title}.first
|
70
72
|
if found_case
|
71
73
|
result= found_case['id']
|
72
74
|
else
|
73
|
-
|
74
|
-
result = create_new_case(project_id,suite_id,sub_section_id,test_case)['id']
|
75
|
+
result = create_new_case(project_id,suite_id,section_id,test_case)['id']
|
75
76
|
end
|
76
77
|
end
|
77
78
|
return result
|
data/lib/json_sender.rb
CHANGED
@@ -25,11 +25,17 @@ module Cukerail
|
|
25
25
|
|
26
26
|
def get_id(scenario,background_steps,project_id,suite_id,sub_section_id)
|
27
27
|
title = get_name(scenario)
|
28
|
-
|
28
|
+
scenario_level_sub_section = scenario['tags'].select{|j| j['name']=~/sub_section_\d+/}.last
|
29
|
+
if scenario_level_sub_section
|
30
|
+
sub_section_id_override = /sub_section_(\d+)/.match(scenario_level_sub_section['name'])[1]
|
31
|
+
else
|
32
|
+
sub_section_id_override=sub_section_id
|
33
|
+
end
|
34
|
+
found_case = testrail_api_client.send_get("get_cases/#{project_id}&suite_id=#{suite_id}§ion_id=#{sub_section_id_override}").select{|c| c['title'] == title}.first
|
29
35
|
if found_case
|
30
36
|
result= found_case['id']
|
31
37
|
else
|
32
|
-
test_case = create_new_case(scenario,background_steps,project_id,suite_id,
|
38
|
+
test_case = create_new_case(scenario,background_steps,project_id,suite_id,sub_section_id_override)
|
33
39
|
result = test_case ? test_case['id'] : nil
|
34
40
|
end
|
35
41
|
return result
|
@@ -105,17 +111,17 @@ module Cukerail
|
|
105
111
|
end
|
106
112
|
|
107
113
|
def defects(scenario)
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
114
|
+
if scenario['tags']
|
115
|
+
tags = [scenario['tags']].flatten.compact
|
116
|
+
tags.select{|tag| tag['name'] =~/(?:jira|defect)_/}.map{|ticket| /(?:jira|defect)_(\w+-\d+)$/.match(ticket['name'])[1]}.uniq.join(",")
|
117
|
+
end
|
112
118
|
end
|
113
119
|
|
114
120
|
def refs(scenario)
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
121
|
+
if scenario['tags']
|
122
|
+
tags = [scenario['tags']].flatten.compact
|
123
|
+
tags.select{|tag| tag['name'] =~/(?:jira|ref)_/}.map{|ticket| /(?:jira|ref)_(\w+-\d+)$/.match(ticket['name'])[1]}.uniq.join(",")
|
124
|
+
end
|
119
125
|
end
|
120
126
|
|
121
127
|
def send_result(scenario,id,run_id)
|
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.6.
|
4
|
+
version: 0.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Small
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cucumber
|