jericho 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jericho.rb +13 -13
- data/lib/jericho/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b06003f5c14f86350642c907b595e551482a2ae34ebee48b30d22e68d6b41007
|
4
|
+
data.tar.gz: e12f2cae08afae64201810f95d8d117193244ff220a81c2b300daf86bb78938d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d17ee9257d73ecdbc32931e6b6b0312fc24d70a557603e1119b7c68e95acb03b7532960d9c9201808fed1bc2cd992258587a02f6f89ad83bc01b4fe72a5f821a
|
7
|
+
data.tar.gz: 892d490e3691694a64fbefa049dd5c087c9a8b75f6e4943896cb1b2fda5f22c2c9dbd19f80afa37e15e409fbef55d0eb7cf6009baf331577b3b185b3f63cb285
|
data/lib/jericho.rb
CHANGED
@@ -2,30 +2,30 @@ require "jericho/version"
|
|
2
2
|
|
3
3
|
module Jericho
|
4
4
|
def self.reporter(parsed_report)
|
5
|
-
|
5
|
+
list_of_scenarios_purifys = {}
|
6
6
|
parsed_report.each do |element|
|
7
7
|
element['elements'].each do |scenario|
|
8
8
|
scenario_status = 'Passed'
|
9
9
|
scenario['steps'].each do |step|
|
10
|
-
scenario_status = 'Failed' if step['
|
10
|
+
scenario_status = 'Failed' if step['purify']['status'] != 'passed'
|
11
11
|
end
|
12
|
-
|
12
|
+
list_of_scenarios_purifys[(scenario['name']).to_s] = scenario_status
|
13
13
|
end
|
14
14
|
end
|
15
|
-
|
15
|
+
list_of_scenarios_purifys
|
16
16
|
end
|
17
17
|
|
18
|
-
def self.comparison_reporter(
|
19
|
-
failed_tests =
|
18
|
+
def self.comparison_reporter(list_of_scenarios_purifys1, list_of_scenarios_purifys2)
|
19
|
+
failed_tests = list_of_scenarios_purifys2.select { |k, v| v == 'Failed' }.map do |k, v|
|
20
20
|
{
|
21
21
|
test_name: k === '' ? k = 'Background' : k,
|
22
22
|
actual_status: v,
|
23
|
-
previous_status:
|
23
|
+
previous_status: list_of_scenarios_purifys1[k]
|
24
24
|
}.reject { |_k, v| v.nil? }
|
25
25
|
end
|
26
26
|
|
27
27
|
{
|
28
|
-
passed:
|
28
|
+
passed: list_of_scenarios_purifys2.size - failed_tests.size,
|
29
29
|
failed: failed_tests.size,
|
30
30
|
failed_tests: failed_tests
|
31
31
|
}
|
@@ -35,7 +35,7 @@ module Jericho
|
|
35
35
|
arr = Dir['*.json'].sort!
|
36
36
|
arr.length <= 1 ? parsed_report1 = {} : parsed_report1 = JSON.parse(File.read(arr[-2]))
|
37
37
|
parsed_report2 = JSON.parse(File.read(arr.last))
|
38
|
-
|
38
|
+
purify = comparison_reporter(reporter(parsed_report1), reporter(parsed_report2))
|
39
39
|
end
|
40
40
|
|
41
41
|
def self.repent
|
@@ -43,13 +43,13 @@ module Jericho
|
|
43
43
|
client.chat_postMessage(
|
44
44
|
channel: '#autotests',
|
45
45
|
text:
|
46
|
-
"Test run
|
47
|
-
Passed tests count: #{
|
48
|
-
Failed tests count: #{
|
46
|
+
"Test run purifys for #{$driver.caps[:deviceName]}, #{$driver.caps[:platformName]} #{$driver.caps[:platformVersion]}:
|
47
|
+
Passed tests count: #{purify[:passed]},
|
48
|
+
Failed tests count: #{purify[:failed]},",
|
49
49
|
attachments: [
|
50
50
|
{
|
51
51
|
text: "*Failed tests*:
|
52
|
-
#{'Test name and previous status:' + ("\n") +
|
52
|
+
#{'Test name and previous status:' + ("\n") + purify[:failed_tests].map { |t| t.values_at(:test_name, :previous_status) }.join("\n") }
|
53
53
|
",
|
54
54
|
color: 'danger'
|
55
55
|
}
|
data/lib/jericho/version.rb
CHANGED