allure-cucumber 0.5.5 → 0.5.6
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/README.md +35 -0
- data/lib/allure-cucumber/formatter.rb +28 -8
- data/lib/allure-cucumber/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0077693a9c0bdd71f2fa6825d5b6f336b4e2e67a
|
4
|
+
data.tar.gz: 9b66a368135a9484ba86ffe2f32ba92352d6b4b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a33782e23b845089ce27ef69bc6175c6b7640be8c9a45fdd24571d194e4451315a205fdf3475c1e7902a4cc2933c657feebfb4e65ffdd2c54cf56624b758b996
|
7
|
+
data.tar.gz: 1ac2a818ccfd3748ed88b168486e30241283b62a8c7a96216980f1896764aa99bbd0517c922f62ca4cb635faa68afaeda93e76c4cade0cc5ecdf6b6979ec3474
|
data/README.md
CHANGED
@@ -37,6 +37,41 @@ AllureCucumber.configure do |c|
|
|
37
37
|
end
|
38
38
|
```
|
39
39
|
|
40
|
+
By default, allure-cucumber will analyze your cucumber tags looking for Test Management, Issue Management, and Severity hooks. These hooks will be displayed in the generated allure report (see allure-core for further info).
|
41
|
+
|
42
|
+
```ruby
|
43
|
+
DEFAULT_TMS_PREFIX = '@TMS:'
|
44
|
+
DEFAULT_ISSUE_PREFIX = '@ISSUE:'
|
45
|
+
DEFAULT_SEVERITY_PREFIX = '@SEVERITY:'
|
46
|
+
```
|
47
|
+
|
48
|
+
Example:
|
49
|
+
```gherkin
|
50
|
+
@SEVERITY:trivial @ISSUE:YZZ-100 @TMS:9901
|
51
|
+
Scenario: Leave First Name Blank
|
52
|
+
When I register an account without a first name
|
53
|
+
Then exactly (1) [validation_error] should be visible
|
54
|
+
```
|
55
|
+
|
56
|
+
You can configure what allure-cucumber looks for by making the following changes
|
57
|
+
|
58
|
+
```ruby
|
59
|
+
AllureCucumber.configure do |c|
|
60
|
+
c.clean_dir = false
|
61
|
+
c.tms_prefix = '@HIPTEST--'
|
62
|
+
c.issue_prefix = '@JIRA++'
|
63
|
+
c.severity_prefix = '@URGENCY:'
|
64
|
+
end
|
65
|
+
```
|
66
|
+
|
67
|
+
Example:
|
68
|
+
```gherkin
|
69
|
+
@URGENCY:critical @JIRA++YZZ-100 @HIPTEST--9901
|
70
|
+
Scenario: Leave First Name Blank
|
71
|
+
When I register an account without a first name
|
72
|
+
Then exactly (1) [validation_error] should be visible
|
73
|
+
```
|
74
|
+
|
40
75
|
## Usage
|
41
76
|
|
42
77
|
Put the following in your `features/support/env.rb` file:
|
@@ -59,22 +59,34 @@ module AllureCucumber
|
|
59
59
|
@header_row = true
|
60
60
|
@row_count = 0
|
61
61
|
end
|
62
|
-
|
62
|
+
|
63
|
+
def before_scenario(scenario)
|
64
|
+
# not used now, but keeping for later.
|
65
|
+
end
|
66
|
+
|
63
67
|
# Start the test for normal scenarios
|
64
68
|
def before_steps(steps)
|
65
69
|
if !@scenario_outline
|
66
70
|
start_test
|
67
71
|
end
|
68
72
|
end
|
69
|
-
|
73
|
+
|
70
74
|
# Stop the test for normal scenarios
|
71
75
|
def after_steps(steps)
|
72
|
-
if !@scenario_outline
|
73
|
-
result = test_result(steps)
|
74
|
-
stop_test(result)
|
76
|
+
if !@scenario_outline
|
77
|
+
@result = test_result(steps)
|
75
78
|
end
|
76
79
|
end
|
77
|
-
|
80
|
+
|
81
|
+
def after_scenario(scenario)
|
82
|
+
@result[:status] = cucumber_status_to_allure_status(scenario.status)
|
83
|
+
stop_test(@result)
|
84
|
+
end
|
85
|
+
|
86
|
+
def after_feature_element(feature_element)
|
87
|
+
after_scenario(feature_element)
|
88
|
+
end
|
89
|
+
|
78
90
|
# Start the test for scenario examples
|
79
91
|
def before_table_row(table_row)
|
80
92
|
if @scenario_outline && !@header_row && !@in_multiline_arg
|
@@ -107,7 +119,11 @@ module AllureCucumber
|
|
107
119
|
end
|
108
120
|
|
109
121
|
def after_test_step(test_step, result)
|
110
|
-
if
|
122
|
+
if test_step.name == 'Before hook'
|
123
|
+
if (!@before_hook_exception) && result.methods.include?(:exception)
|
124
|
+
@before_hook_exception = result.exception
|
125
|
+
end
|
126
|
+
elsif test_step.name != 'After hook'
|
111
127
|
if @tracker.scenario_name
|
112
128
|
status = step_status(result)
|
113
129
|
stop_step(status)
|
@@ -154,7 +170,11 @@ module AllureCucumber
|
|
154
170
|
|
155
171
|
def test_result(result)
|
156
172
|
status = cucumber_status_to_allure_status(result.status)
|
157
|
-
|
173
|
+
if @before_hook_exception
|
174
|
+
exception = @before_hook_exception
|
175
|
+
else
|
176
|
+
exception = status == 'failed' && result.exception.nil? ? Exception.new("Some steps were undefined") : result.exception
|
177
|
+
end
|
158
178
|
if exception
|
159
179
|
return {:status => status, :exception => exception}
|
160
180
|
else
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: allure-cucumber
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Imran Khan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cucumber
|
@@ -107,5 +107,5 @@ rubyforge_project:
|
|
107
107
|
rubygems_version: 2.4.8
|
108
108
|
signing_key:
|
109
109
|
specification_version: 4
|
110
|
-
summary: allure-cucumber-0.5.
|
110
|
+
summary: allure-cucumber-0.5.6
|
111
111
|
test_files: []
|