qaxqa 1.1.1 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/qaxqa/all_suite.rb +4 -3
- data/lib/qaxqa/cli/migrate.rb +22 -4
- data/lib/qaxqa/step.rb +10 -0
- data/lib/qaxqa/testcase.rb +1 -1
- data/lib/qaxqa/testsuite.rb +36 -8
- data/lib/qaxqa/version.rb +1 -1
- data/output.xlsx +0 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 409afbda05836886fdf360aad8b0ed9efa2d8d49
|
4
|
+
data.tar.gz: a2efffbf3a61e1818c65f6e543bec76bce0b31fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1ed8f65b873d33acbd190ed58e6acfa8185b56c6790d5c05e9a50154c95cef922d355f2181b83e4cff3181caade9b7d24549287eb9fc8840adb3d0604d6b5ac
|
7
|
+
data.tar.gz: 654aaf984f4aaad10f4f8fb7b4b2b839cfafdd21dfc2c67067ca892310f32704f0700e9f9afff5e8f614cf9f0ce48b727f35ff8147fc1865ec05659d10b5efb6
|
data/lib/qaxqa/all_suite.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
require "qaxqa/testcase"
|
2
2
|
require "qaxqa/testsuite"
|
3
|
+
require "qaxqa/step"
|
4
|
+
|
3
5
|
module Qaxqa
|
4
6
|
|
5
7
|
# Module class to set XML parsed attributes
|
@@ -18,9 +20,8 @@ module Qaxqa
|
|
18
20
|
def fetch!(path)
|
19
21
|
require 'nokogiri'
|
20
22
|
@doc = Nokogiri::XML(File.open(path))
|
21
|
-
|
22
|
-
|
23
|
-
end
|
23
|
+
|
24
|
+
@testsuites = Testsuite.parse(@doc)
|
24
25
|
end
|
25
26
|
|
26
27
|
end
|
data/lib/qaxqa/cli/migrate.rb
CHANGED
@@ -14,13 +14,31 @@ module Qaxqa
|
|
14
14
|
private
|
15
15
|
|
16
16
|
def to_hpqc(file)
|
17
|
-
extract file
|
18
|
-
|
17
|
+
suites = extract file
|
19
18
|
workbook = RubyXL::Workbook.new
|
20
19
|
worksheet = workbook.worksheets[0]
|
21
20
|
set_header worksheet
|
22
|
-
|
23
|
-
|
21
|
+
line = 0
|
22
|
+
suites.testsuites.each_with_index do |s|
|
23
|
+
line += 1
|
24
|
+
worksheet.add_cell(line, 0, s.subject)
|
25
|
+
worksheet.add_cell(line, 1, s.test_name)
|
26
|
+
worksheet.add_cell(line, 2, s.details)
|
27
|
+
s.testcases.each_with_index do |tc|
|
28
|
+
tc.steps.each_with_index do |step|
|
29
|
+
line +=1
|
30
|
+
worksheet.add_cell(line, 0, tc.subject)
|
31
|
+
worksheet.add_cell(line, 1, tc.test_name)
|
32
|
+
worksheet.add_cell(line, 2, tc.summary)
|
33
|
+
worksheet.add_cell(line, 3, tc.preconditions)
|
34
|
+
worksheet.add_cell(line, 4, step.step_number)
|
35
|
+
worksheet.add_cell(line, 5, step.actions)
|
36
|
+
worksheet.add_cell(line, 6, step.expectedresults)
|
37
|
+
worksheet.add_cell(line, 7, tc.test_type)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
workbook.write("output.xlsx")
|
24
42
|
end
|
25
43
|
|
26
44
|
def extract(xml)
|
data/lib/qaxqa/step.rb
ADDED
data/lib/qaxqa/testcase.rb
CHANGED
data/lib/qaxqa/testsuite.rb
CHANGED
@@ -3,16 +3,44 @@ module Qaxqa
|
|
3
3
|
# Module class to set XML parsed attributes to a suitecase object
|
4
4
|
class Testsuite
|
5
5
|
|
6
|
-
attr_accessor :subject, :test_name
|
6
|
+
attr_accessor :subject, :test_name, :details, :testcases
|
7
7
|
|
8
|
-
def
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
def self.parse(doc)
|
9
|
+
root = doc.xpath("//testsuite/testsuite")
|
10
|
+
main_subject = root.first.attributes["name"].value
|
11
|
+
suites = []
|
12
|
+
# Parse suites
|
13
|
+
root.each do |node|
|
14
|
+
unless node.attributes["name"].nil?
|
15
|
+
suite = Testsuite.new
|
16
|
+
suite.subject = main_subject
|
17
|
+
suite.test_name = node.attributes["name"].value
|
18
|
+
suite.details = node.xpath("./details").text
|
19
|
+
suite.testcases = []
|
20
|
+
# Parse testcases
|
21
|
+
node.children.xpath("./testcase").each do |tc|
|
22
|
+
testcase = Testcase.new
|
23
|
+
testcase.steps = []
|
24
|
+
testcase.subject = suite.subject
|
25
|
+
testcase.test_name = tc.attributes["name"].value
|
26
|
+
testcase.summary = tc.xpath("./summary").text
|
27
|
+
testcase.preconditions = tc.xpath("./preconditions").text
|
28
|
+
testcase.test_type = "Manual"
|
29
|
+
# Parse steps
|
30
|
+
tc.xpath("./steps/*").each do |step_node|
|
31
|
+
step = Step.new
|
32
|
+
step.step_number = step_node.xpath("./step_number").text
|
33
|
+
step.actions = step_node.xpath("./actions").text
|
34
|
+
step.expectedresults = step_node.xpath("./expectedresults").text
|
35
|
+
testcase.steps << step
|
36
|
+
end
|
13
37
|
|
14
|
-
|
15
|
-
|
38
|
+
suite.testcases << testcase
|
39
|
+
end
|
40
|
+
suites << suite
|
41
|
+
end
|
42
|
+
end
|
43
|
+
return suites
|
16
44
|
end
|
17
45
|
|
18
46
|
end
|
data/lib/qaxqa/version.rb
CHANGED
data/output.xlsx
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qaxqa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ronaldo Possan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -177,6 +177,7 @@ files:
|
|
177
177
|
- lib/qaxqa/all_suite.rb
|
178
178
|
- lib/qaxqa/cli.rb
|
179
179
|
- lib/qaxqa/cli/migrate.rb
|
180
|
+
- lib/qaxqa/step.rb
|
180
181
|
- lib/qaxqa/testcase.rb
|
181
182
|
- lib/qaxqa/testsuite.rb
|
182
183
|
- lib/qaxqa/version.rb
|