cucumber-report-format 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +0 -11
- data/README.md +28 -0
- data/Rakefile +1 -1
- data/bin/cucumber-report-format +1 -1
- data/cucumber-report-format.gemspec +1 -1
- data/templates/markdown.erb +3 -4
- data/templates/overall_summary.erb +2 -2
- data/templates/summary.erb +3 -3
- 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: f8ca70cfb91509a76b54a99ba60a6eb3a855d5e2
|
4
|
+
data.tar.gz: a03a86f221f01ce67aac039298dd398535ffdf5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73bb4e80bffda79a9e01b613b85a532bcbca511f36301a93ec223161e0a9a78b3c746efb7c9f7e034bd4e6f0d82fa8693aef6b4bc2641c4de15998aae107fe05
|
7
|
+
data.tar.gz: 52af72464329afec2d6cf2103ddd40a9d8b696c0b9994e6bdd018f95559d4e0f4b679ec1d6f53fcf7927f8d1dd52cfcdfafae144ceb557e1549179d5cd055833
|
data/.rubocop.yml
CHANGED
@@ -1,14 +1,3 @@
|
|
1
|
-
# This configuration was generated by
|
2
|
-
# `rubocop --auto-gen-config`
|
3
|
-
# on 2017-01-16 21:03:27 +0100 using RuboCop version 0.44.1.
|
4
|
-
# The point is for the user to remove these configuration records
|
5
|
-
# one by one as the offenses are removed from the code base.
|
6
|
-
# Note that changes in the inspected code, or installation of new
|
7
|
-
# versions of RuboCop, may require this file to be generated again.
|
8
|
-
|
9
|
-
# Offense count: 1
|
10
1
|
Style/Documentation:
|
11
2
|
Exclude:
|
12
|
-
- 'spec/**/*'
|
13
|
-
- 'test/**/*'
|
14
3
|
- 'bin/cucumber-report-format'
|
data/README.md
CHANGED
@@ -1,2 +1,30 @@
|
|
1
|
+
[![Build Status](https://travis-ci.org/funkwerk/cucumber-report-format.svg)](https://travis-ci.org/funkwerk/cucumber-report-format)
|
2
|
+
[![Code Climate](https://codeclimate.com/github/funkwerk/cucumber-report-format/badges/gpa.svg)](https://codeclimate.com/github/funkwerk/cucumber-report-format)
|
3
|
+
|
1
4
|
# cucumber-report-format
|
2
5
|
Formats Cucumber Reports
|
6
|
+
|
7
|
+
## Usage
|
8
|
+
|
9
|
+
`cucumber-report-format --template templates/summary.erb cucumber-report.json`
|
10
|
+
|
11
|
+
Will output something like:
|
12
|
+
```
|
13
|
+
## Summary
|
14
|
+
|
15
|
+
| Tests | 6 |
|
16
|
+
| - | - |
|
17
|
+
| Passed | 1 |
|
18
|
+
| Failed | 2 |
|
19
|
+
| Not Executed | 3 |
|
20
|
+
|
21
|
+
```
|
22
|
+
|
23
|
+
## Predefined Templates
|
24
|
+
|
25
|
+
| name | description |
|
26
|
+
| ---- | ----------- |
|
27
|
+
| markdown | Markdown Output of detailed Report |
|
28
|
+
| overall_summary | Prints an overall summary of the executed tests |
|
29
|
+
| summary | Print a summary of the executed tests |
|
30
|
+
| tag_overview | Provides an overview over the used tags |
|
data/Rakefile
CHANGED
data/bin/cucumber-report-format
CHANGED
@@ -38,7 +38,7 @@ OptionParser.new do |opts|
|
|
38
38
|
opts.on('--template [TEMPLATE]', 'Renders into template') do |template|
|
39
39
|
options[:template] = template
|
40
40
|
end
|
41
|
-
opts.on('
|
41
|
+
opts.on('--stdin', 'Reads from stdin') do
|
42
42
|
options[:stdin] = true
|
43
43
|
end
|
44
44
|
end.parse!
|
data/templates/markdown.erb
CHANGED
@@ -82,8 +82,7 @@ def test_result(test)
|
|
82
82
|
status = step['result']['status'] if step['result'].key? 'status'
|
83
83
|
step['result']['error_message'].each { |a| error.push a } if step['result'].key? 'error_message'
|
84
84
|
end
|
85
|
-
|
86
|
-
{'status' => status, 'duration' => duration, 'error' => error}
|
85
|
+
{:status => status, :duration => duration, :error => error}
|
87
86
|
end
|
88
87
|
|
89
88
|
def hover_div(scenario)
|
@@ -93,7 +92,7 @@ def hover_div(scenario)
|
|
93
92
|
end
|
94
93
|
|
95
94
|
def test_comment(scenario)
|
96
|
-
errors = test_result(scenario)[
|
95
|
+
errors = test_result(scenario)[:error]
|
97
96
|
return '' if errors.empty?
|
98
97
|
errors.last
|
99
98
|
end
|
@@ -126,6 +125,6 @@ end
|
|
126
125
|
|
127
126
|
| No | Scenario | Type | Result | Comment |
|
128
127
|
|----|----------|------|--------|---------|
|
129
|
-
<% for @scenario in scenarios(@feature) %><% number += 1 %>| <%= number %> | <%= hover_div(@scenario) %> | <%= is_automatic?(@scenario) ? 'automatic' : 'manual' %> | <%= test_result(@scenario)[
|
128
|
+
<% for @scenario in scenarios(@feature) %><% number += 1 %>| <%= number %> | <%= hover_div(@scenario) %> | <%= is_automatic?(@scenario) ? 'automatic' : 'manual' %> | <%= test_result(@scenario)[:status] %> | <%= test_comment(@scenario) %> |
|
130
129
|
<% end %>
|
131
130
|
<% end %>
|
@@ -23,7 +23,7 @@ def test_result(test)
|
|
23
23
|
next if status == 'failed'
|
24
24
|
status = result['status'] if result.key? 'status'
|
25
25
|
end
|
26
|
-
{
|
26
|
+
{:status => status, duration => duration}
|
27
27
|
end
|
28
28
|
|
29
29
|
def is_executed?(test)
|
@@ -32,4 +32,4 @@ def is_executed?(test)
|
|
32
32
|
end
|
33
33
|
true
|
34
34
|
end
|
35
|
-
%><%= all_tests(@features).length %> | <%= all_tests(@features).select { |test| test_result(test)[
|
35
|
+
%><%= all_tests(@features).length %> | <%= all_tests(@features).select { |test| test_result(test)[:status] == 'passed' }.length %> | <%= all_tests(@features).select { |test| test_result(test)[:status] == 'failed' }.length %> | <%= all_tests(@features).select { |test| !is_executed? test }.length %>
|
data/templates/summary.erb
CHANGED
@@ -23,7 +23,7 @@ def test_result(test)
|
|
23
23
|
next if status == 'failed'
|
24
24
|
status = result['status'] if result.key? 'status'
|
25
25
|
end
|
26
|
-
{
|
26
|
+
{:status => status, :duration => duration}
|
27
27
|
end
|
28
28
|
|
29
29
|
def is_executed?(test)
|
@@ -37,6 +37,6 @@ end
|
|
37
37
|
|
38
38
|
| Tests | <%= all_tests(@features).length %> |
|
39
39
|
| - | - |
|
40
|
-
| Passed | <%= all_tests(@features).select { |test| test_result(test)[
|
41
|
-
| Failed | <%= all_tests(@features).select { |test| test_result(test)[
|
40
|
+
| Passed | <%= all_tests(@features).select { |test| test_result(test)[:status] == 'passed' }.length %> |
|
41
|
+
| Failed | <%= all_tests(@features).select { |test| test_result(test)[:status] == 'failed' }.length %> |
|
42
42
|
| Not Executed | <%= all_tests(@features).select { |test| !is_executed? test }.length %> |
|