cucumber_characteristics 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,6 +1,27 @@
1
1
  # CucumberCharacteristics
2
2
 
3
- Gem to profile cucumber steps and features
3
+ Gem to profile cucumber steps and features.
4
+
5
+ ## High level features
6
+
7
+ Step analysis including
8
+ + Location of step in steps file & regex
9
+ + Step usage location and number of times executed (background/outline etc)
10
+ + Counts for success/failure/pending/etc
11
+ + Total time taken in test run
12
+ + Average, fastest, slowest times per step
13
+ + Variation, variance & standard deviation calculations
14
+
15
+ Feature analysis including
16
+ + Feature location
17
+ + Time taken to run feature
18
+ + Result of feature test (pass, fail etc)
19
+ + Number of steps run
20
+ + Breakdown of feature by individual example run if a secario outline
21
+
22
+ Other features.
23
+ + Reporting of ambiguous step calls
24
+ + Reporting of unused step definitions
4
25
 
5
26
  ## Installation
6
27
 
@@ -39,19 +39,18 @@
39
39
  </div>
40
40
  <div class='alert alert-info'>
41
41
  <span>
42
- 10 Scenarios,
43
- 36 Steps completed
42
+ 2 Scenarios,
43
+ 8 Steps completed
44
44
  <span class='text-muted'>
45
- (Failed: 2, Passed: 31, Skipped: 2, Undefined: 1)<br>
45
+ (Passed: 8)<br>
46
46
  </span>
47
- 1/2 failures due to ambiguous matches<br>
48
- Test duration 12.0048s.
47
+ Test duration 1.6180s.
49
48
  <span class='text-muted'>
50
- (11.9254s steps, 0.0794s non-steps)
49
+ (1.6146s steps, 0.0034s non-steps)
51
50
  </span>
52
51
  </span>
53
52
  <span class='text-muted pull-right small'>
54
- Finished on 2014-06-25 20:13:34 -0400
53
+ Finished on 2014-06-26 07:05:36 -0400
55
54
  </span>
56
55
  </div>
57
56
  <ul class='nav nav-tabs'>
@@ -61,6 +60,9 @@
61
60
  <li>
62
61
  <a data-toggle='tab' href='#features'>Features</a>
63
62
  </li>
63
+ <li>
64
+ <a data-toggle='tab' href='#unused_steps'>Unused Steps (3)</a>
65
+ </li>
64
66
  </ul>
65
67
  <div class='tab-content'>
66
68
  <div class='tab-pane active' id='steps'>
@@ -87,76 +89,26 @@
87
89
  <td>
88
90
  <abbr title='/^I wait ([\d\.]+) seconds$/'>features/step_definitions/wait_steps.rb:1</abbr>
89
91
  </td>
90
- <td>11.9254</td>
91
- <td>
92
- <abbr title='features/failure.feature:4&#x000A;features/pending.feature:4&#x000A;features/scenario.feature:4&#x000A;features/scenario.feature:5&#x000A;features/scenario.feature:6&#x000A;features/scenario_outline.feature:4 (x2)&#x000A;features/scenario_outline.feature:5 (x2)&#x000A;features/scenario_outline.feature:6 (x2)&#x000A;features/scenario_outline.feature:7 (x2)&#x000A;features/scenario_outline_with_background.feature:4 (x2)&#x000A;features/scenario_outline_with_background.feature:7 (x2)&#x000A;features/scenario_outline_with_background.feature:8 (x2)&#x000A;features/scenario_outline_with_background.feature:9 (x2)&#x000A;features/scenario_outline_with_background.feature:10 (x2)&#x000A;features/scenario_with_background.feature:4 (x2)&#x000A;features/scenario_with_background.feature:7&#x000A;features/scenario_with_background.feature:8&#x000A;features/scenario_with_background.feature:9&#x000A;features/scenario_with_background.feature:12&#x000A;features/scenario_with_background.feature:13&#x000A;features/scenario_with_background.feature:14'>31</abbr>
93
- </td>
94
- <td>0.3847</td>
95
- <td>0.1006</td>
96
- <td>1.0004</td>
97
- <td>0.8998</td>
98
- <td>0.0562</td>
99
- <td>0.2371</td>
100
- <td>
101
- <abbr title='features/failure.feature:6&#x000A;features/pending.feature:6'>2</abbr>
102
- </td>
103
- <td>
104
- 0
105
- </td>
106
- <td>
107
- 0
108
- </td>
109
- <td>33</td>
110
- </tr>
111
- <tr>
112
- <td>
113
- <abbr title='/^I fail$/'>features/step_definitions/fail_steps.rb:1</abbr>
114
- </td>
115
- <td>-</td>
92
+ <td>1.6146</td>
116
93
  <td>
117
- 0
94
+ <abbr title='features/scenario_outline.feature:4 (x2)&#x000A;features/scenario_outline.feature:5 (x2)&#x000A;features/scenario_outline.feature:6 (x2)&#x000A;features/scenario_outline.feature:7 (x2)'>8</abbr>
118
95
  </td>
119
- <td>-</td>
120
- <td>-</td>
121
- <td>-</td>
122
- <td>-</td>
123
- <td>-</td>
124
- <td>-</td>
96
+ <td>0.2018</td>
97
+ <td>0.1024</td>
98
+ <td>0.3006</td>
99
+ <td>0.1982</td>
100
+ <td>0.0049</td>
101
+ <td>0.0701</td>
125
102
  <td>
126
103
  0
127
104
  </td>
128
- <td>
129
- <abbr title='features/failure.feature:5'>1</abbr>
130
- </td>
131
105
  <td>
132
106
  0
133
107
  </td>
134
- <td>1</td>
135
- </tr>
136
- <tr>
137
- <td>
138
- <abbr title=''>I call a pending step</abbr>
139
- </td>
140
- <td>-</td>
141
108
  <td>
142
109
  0
143
110
  </td>
144
- <td>-</td>
145
- <td>-</td>
146
- <td>-</td>
147
- <td>-</td>
148
- <td>-</td>
149
- <td>-</td>
150
- <td>
151
- 0
152
- </td>
153
- <td>
154
- 0
155
- </td>
156
- <td>
157
- <abbr title='features/pending.feature:5'>1</abbr>
158
- </td>
159
- <td>1</td>
111
+ <td>8</td>
160
112
  </tr>
161
113
  </tbody>
162
114
  </table>
@@ -173,52 +125,9 @@
173
125
  </tr>
174
126
  </thead>
175
127
  <tbody>
176
- <tr class='danger'>
177
- <td>features/failure.feature:3</td>
178
- <td>1.0004</td>
179
- <td>3</td>
180
- <td>failed</td>
181
- <td>
182
- </td>
183
- </tr>
184
- <tr class='danger'>
185
- <td>features/ambiguous.feature:3</td>
186
- <td>-</td>
187
- <td>1</td>
188
- <td>failed</td>
189
- <td>
190
- </td>
191
- </tr>
192
- <tr class='warning'>
193
- <td>features/pending.feature:3</td>
194
- <td>1.0004</td>
195
- <td>3</td>
196
- <td>undefined</td>
197
- <td>
198
- </td>
199
- </tr>
200
- <tr class=''>
201
- <td>features/scenario_outline_with_background.feature:6</td>
202
- <td>3.6076</td>
203
- <td>10</td>
204
- <td>passed</td>
205
- <td>
206
- <button class='btn btn-primary' data-target='#ee4ab50980effe45ea18c9afc38e97e5' data-toggle='modal'>
207
- 2 Examples
208
- </button>
209
- </td>
210
- </tr>
211
- <tr class=''>
212
- <td>features/scenario_with_background.feature:11</td>
213
- <td>2.2036</td>
214
- <td>4</td>
215
- <td>passed</td>
216
- <td>
217
- </td>
218
- </tr>
219
128
  <tr class=''>
220
129
  <td>features/scenario_outline.feature:3</td>
221
- <td>1.6051</td>
130
+ <td>1.6146</td>
222
131
  <td>8</td>
223
132
  <td>passed</td>
224
133
  <td>
@@ -227,72 +136,8 @@
227
136
  </button>
228
137
  </td>
229
138
  </tr>
230
- <tr class=''>
231
- <td>features/scenario.feature:3</td>
232
- <td>1.5057</td>
233
- <td>3</td>
234
- <td>passed</td>
235
- <td>
236
- </td>
237
- </tr>
238
- <tr class=''>
239
- <td>features/scenario_with_background.feature:6</td>
240
- <td>1.0026</td>
241
- <td>4</td>
242
- <td>passed</td>
243
- <td>
244
- </td>
245
- </tr>
246
139
  </tbody>
247
140
  </table>
248
- <div aria-hidden='true' aria-labelledby='myLargeModalLabel' class='modal fade bs-example-modal-lg' id='ee4ab50980effe45ea18c9afc38e97e5' role='dialog' tabindex='-1'>
249
- <div class='modal-dialog modal-lg'>
250
- <div class='modal-content'>
251
- <div class='modal-header'>
252
- <h4>features/scenario_outline_with_background.feature:6</h4>
253
- </div>
254
- <div class='modal-body'>
255
- <table class='table table-striped table-bordered table-condensed'>
256
- <thead>
257
- <tr>
258
- <th>Example</th>
259
- <th>Total time</th>
260
- <th>Step count</th>
261
- <th>Status</th>
262
- </tr>
263
- </thead>
264
- <tbody>
265
- <tr class=''>
266
- <td>| 0.5 | 0.6 | 0.7 |</td>
267
- <td>2.4043</td>
268
- <td>5</td>
269
- <td>passed</td>
270
- </tr>
271
- <tr class=''>
272
- <td>| 0.1 | 0.2 | 0.3 |</td>
273
- <td>1.2033</td>
274
- <td>5</td>
275
- <td>passed</td>
276
- </tr>
277
- </tbody>
278
- <tfooter>
279
- <tr>
280
- <th></th>
281
- <th>3.6076</th>
282
- <th>10</th>
283
- <th>passed</th>
284
- </tr>
285
- </tfooter>
286
- </table>
287
- </div>
288
- <div class='modal-footer'>
289
- <button class='btn btn-default' data-dismiss='modal' type='button'>
290
- Close
291
- </button>
292
- </div>
293
- </div>
294
- </div>
295
- </div>
296
141
  <div aria-hidden='true' aria-labelledby='myLargeModalLabel' class='modal fade bs-example-modal-lg' id='76f61671f111ebbc40b80f6aa9f5f838' role='dialog' tabindex='-1'>
297
142
  <div class='modal-dialog modal-lg'>
298
143
  <div class='modal-content'>
@@ -312,13 +157,13 @@
312
157
  <tbody>
313
158
  <tr class=''>
314
159
  <td>| 0.3 | 0.2 | 0.1 |</td>
315
- <td>0.8025</td>
160
+ <td>0.8073</td>
316
161
  <td>4</td>
317
162
  <td>passed</td>
318
163
  </tr>
319
164
  <tr class=''>
320
165
  <td>| 0.1 | 0.2 | 0.3 |</td>
321
- <td>0.8025</td>
166
+ <td>0.8073</td>
322
167
  <td>4</td>
323
168
  <td>passed</td>
324
169
  </tr>
@@ -326,7 +171,7 @@
326
171
  <tfooter>
327
172
  <tr>
328
173
  <th></th>
329
- <th>1.6051</th>
174
+ <th>1.6146</th>
330
175
  <th>8</th>
331
176
  <th>passed</th>
332
177
  </tr>
@@ -342,6 +187,30 @@
342
187
  </div>
343
188
  </div>
344
189
  </div>
190
+ <div class='tab-pane' id='unused_steps'>
191
+ <table class='table table-striped table-bordered table-condensed tablesorter' id='unmatched_steps_table'>
192
+ <thead>
193
+ <tr>
194
+ <th>Step Location</th>
195
+ <th>Step</th>
196
+ </tr>
197
+ </thead>
198
+ <tbody>
199
+ <tr>
200
+ <td>features/step_definitions/ambiguous_steps.rb:1</td>
201
+ <td>/^I wait some/</td>
202
+ </tr>
203
+ <tr>
204
+ <td>features/step_definitions/ambiguous_steps.rb:4</td>
205
+ <td>/^I wait some seconds$/</td>
206
+ </tr>
207
+ <tr>
208
+ <td>features/step_definitions/fail_steps.rb:1</td>
209
+ <td>/^I fail$/</td>
210
+ </tr>
211
+ </tbody>
212
+ </table>
213
+ </div>
345
214
  </div>
346
215
  </div>
347
216
  <script src='https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js'></script>
@@ -1 +1 @@
1
- [["features/step_definitions/wait_steps.rb:1",{"total_count":33,"passed":{"count":31,"feature_location":{"features/failure.feature:4":[1.000400775],"features/pending.feature:4":[1.000400775],"features/scenario.feature:4":[0.501914414],"features/scenario.feature:5":[0.501914414],"features/scenario.feature:6":[0.501914414],"features/scenario_outline.feature:4":[0.100597662,0.30053452],"features/scenario_outline.feature:5":[0.200701096,0.200701096],"features/scenario_outline.feature:6":[0.30053452,0.100597662],"features/scenario_outline.feature:7":[0.200701096,0.200701096],"features/scenario_outline_with_background.feature:4":[0.400732052,0.400732052],"features/scenario_outline_with_background.feature:7":[0.100597662,0.501914414],"features/scenario_outline_with_background.feature:8":[0.200701096,0.600408111],"features/scenario_outline_with_background.feature:9":[0.30053452,0.700576606],"features/scenario_outline_with_background.feature:10":[0.200701096,0.200701096],"features/scenario_with_background.feature:4":[0.400732052,0.400732052],"features/scenario_with_background.feature:7":[0.100597662],"features/scenario_with_background.feature:8":[0.200701096],"features/scenario_with_background.feature:9":[0.30053452],"features/scenario_with_background.feature:12":[0.501914414],"features/scenario_with_background.feature:13":[0.600408111],"features/scenario_with_background.feature:14":[0.700576606]}},"failed":{"count":0,"feature_location":{}},"skipped":{"count":2,"feature_location":{"features/failure.feature:6":[],"features/pending.feature:6":[]}},"undefined":{"count":0,"feature_location":{}},"regexp":"/^I wait ([\\d\\.]+) seconds$/","fastest":0.100597662,"slowest":1.000400775,"average":0.3846906050967743,"total_duration":11.925408758000003,"standard_deviation":0.2370893233738576,"variation":0.8998031129999999,"variance":0.05621134725787363}],["features/step_definitions/fail_steps.rb:1",{"total_count":1,"passed":{"count":0,"feature_location":{}},"failed":{"count":1,"feature_location":{"features/failure.feature:5":[]}},"skipped":{"count":0,"feature_location":{}},"undefined":{"count":0,"feature_location":{}},"regexp":"/^I fail$/","fastest":null,"slowest":null,"average":null,"total_duration":null,"standard_deviation":null,"variation":null}],["I call a pending step",{"total_count":1,"passed":{"count":0,"feature_location":{}},"failed":{"count":0,"feature_location":{}},"skipped":{"count":0,"feature_location":{}},"undefined":{"count":1,"feature_location":{"features/pending.feature:5":[]}},"fastest":null,"slowest":null,"average":null,"total_duration":null,"standard_deviation":null,"variation":null}]]
1
+ [["features/step_definitions/wait_steps.rb:1",{"total_count":8,"passed":{"count":8,"feature_location":{"features/scenario_outline.feature:4":[0.102381726,0.300628711],"features/scenario_outline.feature:5":[0.202134351,0.202134351],"features/scenario_outline.feature:6":[0.300628711,0.102381726],"features/scenario_outline.feature:7":[0.202134351,0.202134351]}},"failed":{"count":0,"feature_location":{}},"skipped":{"count":0,"feature_location":{}},"undefined":{"count":0,"feature_location":{}},"regexp":"/^I wait ([\\d\\.]+) seconds$/","fastest":0.102381726,"slowest":0.300628711,"average":0.20181978475,"total_duration":1.614558278,"standard_deviation":0.07009159960098225,"variation":0.198246985,"variance":0.0049128323346244165}]]
@@ -22,11 +22,5 @@ module Cucumber
22
22
  class StepInvocation
23
23
  attr_reader :step_match
24
24
  end
25
-
26
- class OutlineTable
27
- class ExampleRow
28
- attr_reader :step_invocations
29
- end
30
- end
31
25
  end
32
26
  end
@@ -41,8 +41,8 @@ module CucumberCharacteristics
41
41
  feature_profiles[feature_id] ||= {name: f.scenario_outline.name, total_duration: 0, step_count: 0, example_count: 0, examples: {} }
42
42
  example_id = f.name
43
43
  feature_profiles[feature_id][:examples][example_id] ||= {total_duration: 0, step_count: 0}
44
- feature_profiles[feature_id][:examples][example_id][:total_duration] = f.step_invocations.select{|s| s.status == :passed}.map{|s| s.step_match.duration}.inject(&:+)
45
- feature_profiles[feature_id][:examples][example_id][:step_count] = f.step_invocations.count
44
+ feature_profiles[feature_id][:examples][example_id][:total_duration] = f.instance_variable_get(:@step_invocations).select{|s| s.status == :passed}.map{|s| s.step_match.duration}.inject(&:+)
45
+ feature_profiles[feature_id][:examples][example_id][:step_count] = f.instance_variable_get(:@step_invocations).count
46
46
  feature_profiles[feature_id][:examples][example_id][:status] = f.status
47
47
  else
48
48
  feature_id = f.file_colon_line
@@ -1,3 +1,3 @@
1
1
  module CucumberCharacteristics
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber_characteristics
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: