cukerail 0.7.2 → 0.7.3
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/lib/cukerail/version.rb +1 -1
- data/lib/junit_sender.rb +27 -19
- 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: 71308b92fe0b602b84883e2293b7ebd3c27d366f
|
4
|
+
data.tar.gz: 31e3b544466ea24d09cccad40d5b9af2c57cc08d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e00468b852392bbe8c1312ce3906f6337d19978e163226353d3ccd347c2c638f134db403fe4c7739047f2f4cfef4170ce79d4afe289504f3d7b3a2fda154d4a
|
7
|
+
data.tar.gz: d4ac59453711286e7dba7fd4d4d0671d261c7547776299c55be2799eac92fed471986bcdda94306e6fe734c3d83f54b0a84448f0b66919133c60bd94a3b63f8d
|
data/lib/cukerail/version.rb
CHANGED
data/lib/junit_sender.rb
CHANGED
@@ -19,23 +19,31 @@ module Cukerail
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def load
|
22
|
-
results
|
23
|
-
recurse_down(child)
|
24
|
-
end
|
22
|
+
recurse_down(results)
|
25
23
|
end
|
26
24
|
|
27
25
|
def recurse_down(element,level=0,parent_id=nil)
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
26
|
+
if element.name == 'document'
|
27
|
+
element.children.each do |child|
|
28
|
+
recurse_down(child)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
if element.name == 'testsuite'
|
32
|
+
section_id = get_section_id(element,parent_id)
|
33
|
+
end
|
34
|
+
element.children.select{|n| n.name=='testsuite'}.each do |testsuite|
|
35
|
+
recurse_down(testsuite,level+1,(section_id || parent_id))
|
36
|
+
end
|
37
|
+
element.children.select{|n| n.name=='testcase'}.each do |testcase|
|
38
|
+
case_id = get_testcase_id(testcase,(section_id || parent_id))
|
39
|
+
report_result(case_id,testcase) if run_id
|
40
|
+
end
|
36
41
|
end
|
37
42
|
|
43
|
+
#return nil if a section cannot be fouind or created
|
38
44
|
def get_section_id(testsuite,parent_id=nil)
|
45
|
+
# some elements don't have names
|
46
|
+
return nil if testsuite.attributes['name'].value.empty?
|
39
47
|
section = sections.detect{|s| s['name'] == testsuite.attributes['name'].value}
|
40
48
|
unless section
|
41
49
|
section = testrail_api_client.send_post("add_section/#{project_id}",{suite_id:suite_id,name:testsuite.attributes['name'].value,parent_id:parent_id})
|
@@ -53,14 +61,14 @@ module Cukerail
|
|
53
61
|
end
|
54
62
|
|
55
63
|
def get_testcase_id(testcase,section_id)
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
+
unless testcases[section_id]
|
65
|
+
testcases[section_id] = testrail_api_client.send_get("get_cases/#{project_id}&suite_id=#{suite_id}§ion_id=#{section_id}")
|
66
|
+
end
|
67
|
+
unless testcases[section_id].detect{|tc| tc['title'] == testcase.attributes['name'].value}
|
68
|
+
new_tc = testrail_api_client.send_post("add_case/#{section_id}",{title:testcase.attributes['name'].value,type_id:1})
|
69
|
+
testcases[section_id] << new_tc
|
70
|
+
end
|
71
|
+
testcases[section_id].detect{|tc| tc['title'] == testcase.attributes['name'].value}['id']
|
64
72
|
end
|
65
73
|
|
66
74
|
def report_result(case_id,testcase)
|
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.7.
|
4
|
+
version: 0.7.3
|
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-08-
|
11
|
+
date: 2016-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cucumber
|