kanoah_rspec_formatter 0.2.8 → 0.2.9
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/lib/kanoah_result_formatter.rb +27 -9
- data/lib/kanoah_rspec_formatter/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b94012cc15e1e609a6a805d1393b572ee3682056
|
4
|
+
data.tar.gz: 0b110246c7e258f4e8aa5e3557def958d8ffa081
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|