watir_testlink_framework 0.0.6 → 0.0.7
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/CHANGELOG.md +4 -0
- data/lib/watir_testlink_framework.rb +61 -34
- data/lib/watir_testlink_framework/version.rb +1 -1
- 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: 158a06042f03c1dc83a97908ec2dcb2353969876
|
4
|
+
data.tar.gz: 16765ce4ed663d508cc73f2a99169396c0bd881c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef9f3086b3e419b0c460d63388797ddd7d563553f698e8b37400ead244a31f68fc77af9e858a13d9b89a4c61fbdb97440d2044edd6ad9add22f1638000216a0b
|
7
|
+
data.tar.gz: 16cf3c20f683b2ef7b9e8f0759ea233a7b7bf097100f150d3dfa5f82862c2b0bd8af6fe1f9eeb1bedadb8f4bd49ba8067d5195a0853567d7f14326ccc43c1fcc
|
data/CHANGELOG.md
CHANGED
@@ -45,27 +45,28 @@ module WatirTestlinkFramework
|
|
45
45
|
$config['testlink']['testplans'][plan.strip].each do | envname, envarr |
|
46
46
|
|
47
47
|
#create new build
|
48
|
-
buildname = "build_#{
|
48
|
+
buildname = "build_#{Time.new}_#{envname}"
|
49
49
|
tl.create_build(plan_id, buildname, 'created by watir_testlink_framework')
|
50
50
|
|
51
|
+
### REPORT PER CASE
|
51
52
|
envstr = make_env_string(envarr)
|
52
|
-
self.execute_cases(tl,
|
53
|
-
|
53
|
+
self.execute_cases(tl,plan_id,envstr, spectask, test_cases, dryrun)
|
54
|
+
# self.report_cases(tl, plan_id, test_cases, envstr) if spectask=='junit' && !dryrun
|
54
55
|
end
|
55
56
|
|
56
57
|
else
|
57
58
|
buildname = "build_#{Time.new}"
|
58
59
|
tl.create_build(plan_id, buildname, 'created by watir_testlink_framework')
|
59
60
|
envstr = make_env_string($config['testlink']['testplans'][plan.strip])
|
60
|
-
self.execute_cases(tl, envstr, spectask, test_cases, dryrun)
|
61
|
-
self.report_cases(tl, plan_id, test_cases, envstr) if spectask=='junit' && !dryrun
|
61
|
+
self.execute_cases(tl, plan_id, envstr, spectask, test_cases, dryrun)
|
62
|
+
# self.report_cases(tl, plan_id, test_cases, envstr) if spectask=='junit' && !dryrun
|
62
63
|
end
|
63
64
|
|
64
65
|
end
|
65
66
|
|
66
67
|
end
|
67
68
|
|
68
|
-
def self.execute_cases(tl,
|
69
|
+
def self.execute_cases(tl, plan_id, envstring, spectask, test_cases, dryrun)
|
69
70
|
test_cases.each do |tc|
|
70
71
|
|
71
72
|
tc_customfield = tl.test_case_custom_field_design_value(tl.project_id($config['testlink']['project']),
|
@@ -73,11 +74,22 @@ module WatirTestlinkFramework
|
|
73
74
|
tc[1][0]['version'].to_i,
|
74
75
|
'RSPEC CASE ID',{:details=>''})
|
75
76
|
|
76
|
-
exec_string = "#{
|
77
|
+
exec_string = "#{envstring}bundle exec rake testlink:#{spectask} SPEC_OPTS=\"-e #{tc_customfield}\""
|
77
78
|
if dryrun
|
78
79
|
puts exec_string
|
79
80
|
else
|
81
|
+
print "\nRunning testcase #{tc_customfield} with ENV: #{envstring}\n"
|
80
82
|
system exec_string
|
83
|
+
print "Reporting testcase #{tc_customfield}\n"
|
84
|
+
|
85
|
+
begin
|
86
|
+
self.report_a_case(tl, plan_id, tc, envstring) if spectask=='junit'
|
87
|
+
rescue Exception => e
|
88
|
+
print "EXCEPTION------------------------------------\n"
|
89
|
+
puts e.message
|
90
|
+
puts e.backtrace.inspect
|
91
|
+
end
|
92
|
+
|
81
93
|
end
|
82
94
|
end
|
83
95
|
end
|
@@ -90,41 +102,56 @@ module WatirTestlinkFramework
|
|
90
102
|
return envstr
|
91
103
|
end
|
92
104
|
|
93
|
-
def self.
|
105
|
+
def self.read_report_array
|
94
106
|
cases_arr ={}
|
95
|
-
require 'pp'
|
96
107
|
Dir["reports/*.xml"].each do | report |
|
97
108
|
case_arr = XmlSimple::xml_in(report)
|
98
109
|
cases_arr[case_arr['testcase'][0]['name']] = case_arr
|
99
110
|
end
|
111
|
+
return cases_arr
|
112
|
+
end
|
100
113
|
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
tl.report_test_case_result(plan_id, tc[0], status, options)
|
114
|
+
def self.report_a_case(tl, plan_id, tc, envstring)
|
115
|
+
|
116
|
+
cases_arr = self.read_report_array
|
117
|
+
|
118
|
+
tc_customfield = tl.test_case_custom_field_design_value(tl.project_id($config['testlink']['project']),
|
119
|
+
tc[1][0]['full_external_id'],
|
120
|
+
tc[1][0]['version'].to_i,
|
121
|
+
'RSPEC CASE ID',{:details=>''})
|
122
|
+
if cases_arr.has_key?(tc_customfield)
|
123
|
+
options = {}
|
124
|
+
notes=''
|
125
|
+
if cases_arr[tc_customfield]['failures'] == '0'
|
126
|
+
status ='p'
|
127
|
+
elsif cases_arr[tc_customfield]['failures'] == '1'
|
128
|
+
notes += "Message: " + cases_arr[tc_customfield]['testcase'][0]['failure'][0]['message']
|
129
|
+
notes += "\n"
|
130
|
+
notes += "Type: " + cases_arr[tc_customfield]['testcase'][0]['failure'][0]['type']
|
131
|
+
notes += "\n"
|
132
|
+
notes += "Content: " + cases_arr[tc_customfield]['testcase'][0]['failure'][0]['content']
|
133
|
+
notes += "\n"
|
134
|
+
notes += "EnvString: " + envstring
|
135
|
+
status ='f'
|
136
|
+
else
|
137
|
+
status = 'b'
|
126
138
|
end
|
127
139
|
|
140
|
+
options['notes'] = notes
|
141
|
+
tl.report_test_case_result(plan_id, tc[0], status, options)
|
142
|
+
end
|
143
|
+
|
144
|
+
end
|
145
|
+
|
146
|
+
def self.report_cases(tl, plan_id, cases, envstring)
|
147
|
+
cases_arr ={}
|
148
|
+
Dir["reports/*.xml"].each do | report |
|
149
|
+
case_arr = XmlSimple::xml_in(report)
|
150
|
+
cases_arr[case_arr['testcase'][0]['name']] = case_arr
|
151
|
+
end
|
152
|
+
|
153
|
+
cases.each do | tc |
|
154
|
+
self.report_a_case(tl, plan_id, tc, envstring)
|
128
155
|
end
|
129
156
|
end
|
130
157
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: watir_testlink_framework
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pim Snel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|