unobtainium-cucumber 0.1.0 → 0.2.0

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: 1e548c830ba46d389e732d11a3cee4e48c00a31b
4
- data.tar.gz: f939dffce9e566047ed81b0ebdef13dfe48b2202
3
+ metadata.gz: 0eb7d2ecabf4bca9fa46b5a490bd3383cff40e47
4
+ data.tar.gz: 7890da6b2a045957f5465d2c495628eb9431958a
5
5
  SHA512:
6
- metadata.gz: c53e8436432b1a60edcb2ec8e2beed3e8756ab9c1e368773c86d12561229e1357b3ba84f07753eefbe84132d236b8cdf84cff3f0ce5643f31c330ec437c19b7f
7
- data.tar.gz: c6f3ba4a52a937b58b7e4c30510b486b4925e13d0922ac2a40d798d4525955be40e72bd8deff612f8e2668d89ff989a24981e05371b86063de77f8bb17924d3c
6
+ metadata.gz: 27efbf017c3342919f597ebd8e796504a666217d8cf4019327ead9620156add0e8bfd0a38927aa4606c94636754adf9cdbdb5c5706cc54b2629e708db8b22100
7
+ data.tar.gz: 7ef96b3bf4779ebbd70dc974a24bba4a058546536fddfcb9a32e9807cde60cf9beb97869bc77289161db9994baa96cab0e2042a99c8306eaf21bb397ed9972cd
data/Gemfile.lock CHANGED
@@ -1,17 +1,18 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- unobtainium-cucumber (0.1.0)
4
+ unobtainium-cucumber (0.2.0)
5
5
  cucumber (~> 2.0)
6
+ octiron (~> 0.1)
6
7
  unobtainium (~> 0.10)
7
8
 
8
9
  GEM
9
10
  remote: https://rubygems.org/
10
11
  specs:
11
- appium_lib (8.2.1)
12
+ appium_lib (9.0.0)
12
13
  awesome_print (~> 1.6)
13
14
  json (~> 1.8)
14
- nokogiri (~> 1.6.6)
15
+ nokogiri (~> 1.6, >= 1.6.6)
15
16
  selenium-webdriver (~> 2.50)
16
17
  tomlrb (~> 1.1)
17
18
  archive-zip (0.7.0)
@@ -46,11 +47,15 @@ GEM
46
47
  gherkin (4.0.0)
47
48
  io-like (0.3.0)
48
49
  json (1.8.3)
50
+ lazy_priority_queue (0.1.1)
49
51
  mini_portile2 (2.1.0)
50
52
  multi_json (1.12.1)
51
53
  multi_test (0.1.2)
52
54
  nokogiri (1.6.8.1)
53
55
  mini_portile2 (~> 2.1.0)
56
+ octiron (0.1.0)
57
+ collapsium (~> 0.8)
58
+ rgl (~> 0.5)
54
59
  parser (2.3.3.1)
55
60
  ast (~> 2.2)
56
61
  phantomjs (2.1.1.0)
@@ -58,6 +63,9 @@ GEM
58
63
  ptools (1.3.3)
59
64
  rainbow (2.1.0)
60
65
  rake (11.3.0)
66
+ rgl (0.5.2)
67
+ lazy_priority_queue (~> 0.1.0)
68
+ stream (~> 0.5.0)
61
69
  rubocop (0.46.0)
62
70
  parser (>= 2.3.1.1, < 3.0)
63
71
  powerpack (~> 0.1)
@@ -75,9 +83,10 @@ GEM
75
83
  json (>= 1.8, < 3)
76
84
  simplecov-html (~> 0.10.0)
77
85
  simplecov-html (0.10.0)
86
+ stream (0.5)
78
87
  sys-proctable (1.1.3)
79
88
  tomlrb (1.2.3)
80
- unicode-display_width (1.1.1)
89
+ unicode-display_width (1.1.2)
81
90
  unobtainium (0.10.0)
82
91
  collapsium (~> 0.8)
83
92
  collapsium-config (~> 0.4)
@@ -91,7 +100,7 @@ PLATFORMS
91
100
 
92
101
  DEPENDENCIES
93
102
  appium_lib
94
- bundler (~> 1.12)
103
+ bundler (~> 1.13)
95
104
  chromedriver-helper
96
105
  codeclimate-test-reporter
97
106
  phantomjs
data/README.md CHANGED
@@ -148,3 +148,25 @@ You might have to use fully qualified names.
148
148
 
149
149
  Custom actions have limited support facilities in the `Action::Support` module.
150
150
  Check it out if you write your own.
151
+
152
+ ### Cucumber Events
153
+
154
+ Cucumber provides an event bus which lets you register handlers for [cucumber's
155
+ own events](http://www.rubydoc.info/gems/cucumber/Cucumber/Events). While that
156
+ is going to be very helpful for hooking into the flow of execution, this gem
157
+ adds [octiron](https://github.com/jfinkhaeuser/octiron) for further event
158
+ processing, by publishing all cucumber events on octiron's event bus.
159
+
160
+ Require `unobtainium-cucumber` as before, but also require the event processing
161
+ code:
162
+
163
+ ```ruby
164
+ # env.rb
165
+ require 'unobtainium-cucumber'
166
+ require 'unobtainium-cucumber/octiron_events'
167
+
168
+ World(Octiron::World)
169
+ ```
170
+
171
+ You can now register transmogrifiers for any of the cucumber event classes,
172
+ and use the power of octiron's event processing pipeline.
@@ -0,0 +1,6 @@
1
+ Feature:
2
+ Translation to Octiron Events
3
+
4
+ Scenario: An Event
5
+ Given I register a handler for AfterTestStep
6
+ Then I expect that handler to be fired
@@ -0,0 +1,32 @@
1
+ # coding: utf-8
2
+ #
3
+ # unobtainium-cucumber
4
+ # https://github.com/jfinkhaeuser/unobtainium-cucumber
5
+ #
6
+ # Copyright (c) 2016 Jens Finkhaeuser and other unobtainium-cucumber
7
+ # contributors. All rights reserved.
8
+ #
9
+
10
+ # Test handler for Octiron events
11
+ class OctironHandler
12
+ def initialize
13
+ @called = false
14
+ end
15
+
16
+ attr_reader :called
17
+
18
+ def call(_event, *_args)
19
+ @called = true
20
+ end
21
+ end
22
+
23
+ Given(/^I register a handler for AfterTestStep$/) do
24
+ @handler = OctironHandler.new
25
+ on_event(::Cucumber::Events::AfterTestStep, @handler)
26
+ end
27
+
28
+ Then(/^I expect that handler to be fired$/) do
29
+ if not @handler.called
30
+ raise "Handler was not called!"
31
+ end
32
+ end
@@ -15,13 +15,14 @@ end
15
15
 
16
16
  # Other requires after SimpleCov
17
17
  require "unobtainium-cucumber"
18
+ require "unobtainium-cucumber/octiron_events"
18
19
 
19
20
  # Extensions used for testing
20
21
  module MyExtensions
21
22
  def method_from_own_extension(*args, &block); end
22
23
  end # module MyExtensions
23
24
 
24
- World(MyExtensions)
25
+ World(MyExtensions, Octiron::World)
25
26
 
26
27
  # Utility code for testing
27
28
  require_relative './utils'
@@ -0,0 +1,29 @@
1
+ # coding: utf-8
2
+ #
3
+ # unobtainium-cucumber
4
+ # https://github.com/jfinkhaeuser/unobtainium-cucumber
5
+ #
6
+ # Copyright (c) 2016 Jens Finkhaeuser and other unobtainium-cucumber
7
+ # contributors. All rights reserved.
8
+ #
9
+
10
+ require 'octiron'
11
+ require 'cucumber'
12
+
13
+ AfterConfiguration do |config|
14
+ # Register handlers for all Cucumber events on cucumber's event bus.
15
+ CUKE_EVENTS ||= [
16
+ :after_test_case,
17
+ :after_test_step,
18
+ :before_test_case,
19
+ :before_test_step,
20
+ :finished_testing,
21
+ :step_match
22
+ ].freeze
23
+
24
+ CUKE_EVENTS.each do |event_name|
25
+ config.on_event(event_name) do |event|
26
+ ::Octiron::World.event_bus.publish(event)
27
+ end
28
+ end
29
+ end
@@ -9,6 +9,6 @@
9
9
  module Unobtainium
10
10
  module Cucumber
11
11
  # The current release version
12
- VERSION = "0.1.0".freeze
12
+ VERSION = "0.2.0".freeze
13
13
  end # module Cucumber
14
14
  end # module Unobtainium
@@ -36,7 +36,7 @@ Gem::Specification.new do |spec|
36
36
 
37
37
  spec.required_ruby_version = '>= 2.0'
38
38
 
39
- spec.add_development_dependency "bundler", "~> 1.12"
39
+ spec.add_development_dependency "bundler", "~> 1.13"
40
40
  spec.add_development_dependency "rubocop", "~> 0.46"
41
41
  spec.add_development_dependency "rake", "~> 11.2"
42
42
  spec.add_development_dependency "simplecov", "~> 0.12"
@@ -48,6 +48,7 @@ Gem::Specification.new do |spec|
48
48
 
49
49
  spec.add_dependency "unobtainium", "~> 0.10"
50
50
  spec.add_dependency "cucumber", "~> 2.0"
51
+ spec.add_dependency "octiron", "~> 0.1"
51
52
  end
52
53
  # rubocop:enable Metrics/BlockLength
53
54
  # rubocop:enable Style/SpaceAroundOperators
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unobtainium-cucumber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jens Finkhaeuser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-06 00:00:00.000000000 Z
11
+ date: 2016-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.12'
19
+ version: '1.13'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.12'
26
+ version: '1.13'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rubocop
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -164,6 +164,20 @@ dependencies:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
166
  version: '2.0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: octiron
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: '0.1'
174
+ type: :runtime
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: '0.1'
167
181
  description: "\n The unobtainium-cucucmber gem adds some convenient cucumber specific
168
182
  hooks\n for use with unobtainium.\n "
169
183
  email:
@@ -187,12 +201,14 @@ files:
187
201
  - features/action_support.feature
188
202
  - features/driver_reset.feature
189
203
  - features/extensions.feature
204
+ - features/octiron_events.feature
190
205
  - features/status_actions.feature
191
206
  - features/step_definitions/action.rb
192
207
  - features/step_definitions/action_support.rb
193
208
  - features/step_definitions/driver_reset.rb
194
209
  - features/step_definitions/extensions.rb
195
210
  - features/step_definitions/mocks/scenario.rb
211
+ - features/step_definitions/octiron_events.rb
196
212
  - features/step_definitions/status_actions.rb
197
213
  - features/support/env.rb
198
214
  - features/support/utils.rb
@@ -201,6 +217,7 @@ files:
201
217
  - lib/unobtainium-cucumber/action/screenshot.rb
202
218
  - lib/unobtainium-cucumber/action/support/naming.rb
203
219
  - lib/unobtainium-cucumber/driver_reset.rb
220
+ - lib/unobtainium-cucumber/octiron_events.rb
204
221
  - lib/unobtainium-cucumber/status_actions.rb
205
222
  - lib/unobtainium-cucumber/version.rb
206
223
  - unobtainium-cucumber.gemspec
@@ -233,12 +250,14 @@ test_files:
233
250
  - features/action_support.feature
234
251
  - features/driver_reset.feature
235
252
  - features/extensions.feature
253
+ - features/octiron_events.feature
236
254
  - features/status_actions.feature
237
255
  - features/step_definitions/action.rb
238
256
  - features/step_definitions/action_support.rb
239
257
  - features/step_definitions/driver_reset.rb
240
258
  - features/step_definitions/extensions.rb
241
259
  - features/step_definitions/mocks/scenario.rb
260
+ - features/step_definitions/octiron_events.rb
242
261
  - features/step_definitions/status_actions.rb
243
262
  - features/support/env.rb
244
263
  - features/support/utils.rb