jericho 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/jericho.rb +13 -13
  3. data/lib/jericho/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b5a5435e3f39b0e0073eca55c1764891ccc566157f90c3f67085a50db4db2e10
4
- data.tar.gz: ae906c5404be57c3ecddac037a0d040b160121982d7df0698be38dc95cbe6db3
3
+ metadata.gz: b06003f5c14f86350642c907b595e551482a2ae34ebee48b30d22e68d6b41007
4
+ data.tar.gz: e12f2cae08afae64201810f95d8d117193244ff220a81c2b300daf86bb78938d
5
5
  SHA512:
6
- metadata.gz: 8bb1c5391b1a9be056aec25b199b6ba4564e6de2c2c83cbcecd916aede87fd48e396c618e97dc1526e58af50193d055caba529723d452c24bd2b0c978c485723
7
- data.tar.gz: aa9c2695854962390d5159d1d572a588c93bd19e3adaec5552395f0ce6f9f6ced33a1e22db74938dc0db155f83d023336e557469fd5dcba44e9841bf0cf8ca9e
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
- list_of_scenarios_results = {}
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['result']['status'] != 'passed'
10
+ scenario_status = 'Failed' if step['purify']['status'] != 'passed'
11
11
  end
12
- list_of_scenarios_results[(scenario['name']).to_s] = scenario_status
12
+ list_of_scenarios_purifys[(scenario['name']).to_s] = scenario_status
13
13
  end
14
14
  end
15
- list_of_scenarios_results
15
+ list_of_scenarios_purifys
16
16
  end
17
17
 
18
- def self.comparison_reporter(list_of_scenarios_results1, list_of_scenarios_results2)
19
- failed_tests = list_of_scenarios_results2.select { |k, v| v == 'Failed' }.map do |k, v|
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: list_of_scenarios_results1[k]
23
+ previous_status: list_of_scenarios_purifys1[k]
24
24
  }.reject { |_k, v| v.nil? }
25
25
  end
26
26
 
27
27
  {
28
- passed: list_of_scenarios_results2.size - failed_tests.size,
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
- result = comparison_reporter(reporter(parsed_report1), reporter(parsed_report2))
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 results for #{$driver.caps[:deviceName]}, #{$driver.caps[:platformName]} #{$driver.caps[:platformVersion]}:
47
- Passed tests count: #{result[:passed]},
48
- Failed tests count: #{result[:failed]},",
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") + result[:failed_tests].map { |t| t.values_at(:test_name, :previous_status) }.join("\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
  }
@@ -1,3 +1,3 @@
1
1
  module Jericho
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jericho
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kirill