kanoah_rspec_formatter 0.2.8 → 0.2.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bf1bb8e256e837c290e636cab0ae0cc7027bd2da
4
- data.tar.gz: 95594d4094dced171c857590d09194a7e7d7cbac
3
+ metadata.gz: b94012cc15e1e609a6a805d1393b572ee3682056
4
+ data.tar.gz: 0b110246c7e258f4e8aa5e3557def958d8ffa081
5
5
  SHA512:
6
- metadata.gz: 140a07b2a0c60e6d9de6d5079e5661e67e6c60f435388464d851c0246c17acd909e7c3e1a042a22b24dcb802c342c687530067fc8583e1bd902cace4b09d8a38
7
- data.tar.gz: 8ce6b5832bafc41c0faa7cef2fd62fec2f2e849d7fa5c67ba012c60dc4632dd8fa3fe270995fbd7fd25f7706c55a54cc0e7e9768d9f51ff1c4f08516a6b992bb
6
+ metadata.gz: 3674ffae8b55c64519b625afedb53f3163c566055dfd708228e1d255ab7958a676a466462b22daa4b3c63d6e377529ce91d5457ce24fa824113e7ef5fba16c73
7
+ data.tar.gz: 13962828b8e4b9f1e45b710e23091d9f5579b1db709161970b9cc1e07e5511d62435f66f8abe5c2839669ca7c41185d2a527c89e5d6e404d598c2cd1a5e3d3ee
@@ -29,13 +29,7 @@ class KanoahResultFormatter < KanoahRSpecFormatter::BaseFormatter
29
29
  private
30
30
 
31
31
  def proccess_result(example)
32
- body = {
33
- test_case: test_id(example),
34
- status: status(example.metadata[:execution_result]),
35
- comment: comment(example.metadata),
36
- execution_time: run_time(example.metadata[:execution_result]),
37
- script_results: steps(example.metadata)
38
- }
32
+ body = example.metadata[:steps].nil? ? without_steps(example) : with_steps(example)
39
33
  @api.test_run_id ? @api.post_new_result_to_run(body) : @api.post_new_result(body)
40
34
  end
41
35
 
@@ -51,8 +45,13 @@ class KanoahResultFormatter < KanoahRSpecFormatter::BaseFormatter
51
45
  scenario.run_time.to_i * 1000
52
46
  end
53
47
 
54
- def comment(scenario)
55
- scenario[:kanoah_evidence][:title] + "\n" + scenario[:kanoah_evidence][:path] unless scenario[:kanoah_evidence].nil?
48
+ def comment(scenario) # TODO: need to be changed
49
+ if scenario[:kanoah_evidence].nil?
50
+ "#{scenario[:execution_result].exception.inspect}: <br />
51
+ #{scenario[:execution_result].exception.backtrace.map{ |t| t + '<br />' }}"
52
+ else
53
+ scenario[:kanoah_evidence][:title] + "\n" + scenario[:kanoah_evidence][:path]
54
+ end
56
55
  end
57
56
 
58
57
  def steps(scenario) # TODO: Make this better
@@ -61,6 +60,25 @@ class KanoahResultFormatter < KanoahRSpecFormatter::BaseFormatter
61
60
  arr
62
61
  end
63
62
 
63
+ def with_steps(example) # TODO: Make this better
64
+ {
65
+ test_case: test_id(example),
66
+ status: status(example.metadata[:execution_result]),
67
+ comment: comment(example.metadata),
68
+ execution_time: run_time(example.metadata[:execution_result]),
69
+ script_results: steps(example.metadata)
70
+ }
71
+ end
72
+
73
+ def without_steps(example) # TODO: Make this better
74
+ {
75
+ test_case: test_id(example),
76
+ status: status(example.metadata[:execution_result]),
77
+ comment: comment(example.metadata),
78
+ execution_time: run_time(example.metadata[:execution_result]),
79
+ }
80
+ end
81
+
64
82
  def status_code(status)
65
83
  case status
66
84
  when :failed, :passed then
@@ -1,3 +1,3 @@
1
1
  module KanoahRSpecFormatter
2
- VERSION = '0.2.8'
2
+ VERSION = '0.2.9'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kanoah_rspec_formatter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Automation Wizards