kookaburra 0.12.0 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +51 -8
- data/VERSION +1 -1
- data/kookaburra.gemspec +2 -3
- data/lib/kookaburra/ui_driver/mixins/has_ui_component.rb +1 -0
- data/lib/kookaburra/ui_driver/ui_component.rb +0 -2
- data/test/kookaburra/ui_driver/ui_component_test.rb +17 -3
- metadata +4 -5
- data/lib/kookaburra/ui_driver/mixins/has_subcomponents.rb +0 -10
data/README.markdown
CHANGED
@@ -177,15 +177,15 @@ might look:
|
|
177
177
|
end
|
178
178
|
|
179
179
|
Then "I see my order summary" do
|
180
|
-
ui.
|
180
|
+
ui.should be_displaying_order_summary
|
181
181
|
end
|
182
182
|
|
183
183
|
Then "I see that my default payment options will be used" do
|
184
|
-
ui.
|
184
|
+
ui.should be_displaying_account_default_payment_options_in_order_summary
|
185
185
|
end
|
186
186
|
|
187
187
|
Then "I see that my default shipping options will be used" do
|
188
|
-
ui.
|
188
|
+
ui.should be_displaying_account_default_shipping_options_in_order_summary
|
189
189
|
end
|
190
190
|
|
191
191
|
The step definitions contain neither explicitly shared state (instance
|
@@ -199,11 +199,11 @@ scenario, it's not a big deal to have the following in your step definitions (as
|
|
199
199
|
long as the author of the spec confirms that they really mean the same thing):
|
200
200
|
|
201
201
|
Then "I see my order summary" do
|
202
|
-
ui.
|
202
|
+
ui.should be_displaying_order_summary
|
203
203
|
end
|
204
204
|
|
205
205
|
Then "I see a summary of my order" do
|
206
|
-
ui.
|
206
|
+
ui.should be_displaying_order_summary
|
207
207
|
end
|
208
208
|
|
209
209
|
The step definitions are nothing more than a natural language reference to an
|
@@ -234,8 +234,8 @@ Using RSpec, the test implementation would be as follows:
|
|
234
234
|
ui.choose_to_check_out
|
235
235
|
|
236
236
|
ui.order_summary.should be_visible
|
237
|
-
ui.
|
238
|
-
ui.
|
237
|
+
ui.should be_displaying_account_default_payment_options_in_order_summary
|
238
|
+
ui.should be_displaying_account_default_shipping_options_in_order_summary
|
239
239
|
end
|
240
240
|
end
|
241
241
|
|
@@ -371,7 +371,7 @@ within your subclass:
|
|
371
371
|
|
372
372
|
class MyApplication::Kookaburra::UIDriver < Kookaburra::UIDriver
|
373
373
|
# makes an instance of MyApplication::Kookaburra::UIDriver::SignInScreen
|
374
|
-
# available via the instance method #sign_in_screen
|
374
|
+
# available via the private instance method #sign_in_screen
|
375
375
|
ui_component :sign_in_screen
|
376
376
|
|
377
377
|
def sign_in(account_nickname)
|
@@ -381,6 +381,12 @@ within your subclass:
|
|
381
381
|
end
|
382
382
|
end
|
383
383
|
|
384
|
+
The call to `Kookaburra::UIDriver.ui_component` defines the UIComponent accessor
|
385
|
+
as a private method in order to discourage accessing your UIComponent objects
|
386
|
+
directly in the test implementation layer. Instead, you should build out your
|
387
|
+
testing DSL in the `UIDriver` subclass as was done with the `#sign_in` method
|
388
|
+
above.
|
389
|
+
|
384
390
|
### The Window Driver Layer ###
|
385
391
|
|
386
392
|
While your `GivenDriver` and `UIDriver` provide a DSL that represents actions
|
@@ -430,6 +436,43 @@ You describe the various user interface components by sub-classing
|
|
430
436
|
end
|
431
437
|
end
|
432
438
|
|
439
|
+
A `UIComponent` subclass can also contain nested components of its own. For
|
440
|
+
instance:
|
441
|
+
|
442
|
+
class MyApplication::Kookaburra::UIDriver::UserList::NewUserForm < Kookaburra::UIDriver::UIComponent
|
443
|
+
component_locator '#new_user_form'
|
444
|
+
end
|
445
|
+
|
446
|
+
class MyApplication::Kookaburra::UIDriver::UserList < Kookaburra::UIDriver::UIComponent
|
447
|
+
component_locator '#user_list'
|
448
|
+
|
449
|
+
ui_component :new_user_form
|
450
|
+
end
|
451
|
+
|
452
|
+
In this case, `UserList#new_user_form` is still defined as a private method. In
|
453
|
+
order to manipulate it from your domain driver, you can define either explicit
|
454
|
+
methods or delegators on `UserList`:
|
455
|
+
|
456
|
+
class MyApplication::Kookaburra::UIDriver::UserList < Kookaburra::UIDriver::UIComponent
|
457
|
+
def fill_in_new_user_form(username, password, full_name)
|
458
|
+
new_user_form.username = username
|
459
|
+
new_user_form.password = password
|
460
|
+
new_user_form.full_name = full_name
|
461
|
+
end
|
462
|
+
|
463
|
+
delegate :submit!, :to => :new_user_form, :prefix => true
|
464
|
+
end
|
465
|
+
|
466
|
+
class MyApplication::Kookaburra::UIDriver < Kookaburra::UIDriver
|
467
|
+
ui_component :user_list
|
468
|
+
|
469
|
+
def create_new_user_with_valid_data
|
470
|
+
user = default_user_data # factory method defined elsewhere
|
471
|
+
user_list.fill_in_new_user_form(user[:username], user[:password], user[:full_name])
|
472
|
+
user_list.new_user_form_submit!
|
473
|
+
end
|
474
|
+
end
|
475
|
+
|
433
476
|
### The Application Driver Layer ###
|
434
477
|
|
435
478
|
`Kookaburra::APIDriver`, `Kookaburra::UIDriver` and
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.13.0
|
data/kookaburra.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "kookaburra"
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.13.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Renewable Funding, LLC"]
|
12
|
-
s.date = "2012-01-
|
12
|
+
s.date = "2012-01-29"
|
13
13
|
s.description = "Cucumber + Capybara = Kookaburra? It made sense at the time."
|
14
14
|
s.email = "devteam@renewfund.com"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -35,7 +35,6 @@ Gem::Specification.new do |s|
|
|
35
35
|
"lib/kookaburra/ui_driver.rb",
|
36
36
|
"lib/kookaburra/ui_driver/mixins/has_browser.rb",
|
37
37
|
"lib/kookaburra/ui_driver/mixins/has_strategies.rb",
|
38
|
-
"lib/kookaburra/ui_driver/mixins/has_subcomponents.rb",
|
39
38
|
"lib/kookaburra/ui_driver/mixins/has_ui_component.rb",
|
40
39
|
"lib/kookaburra/ui_driver/ui_component.rb",
|
41
40
|
"test/helper.rb",
|
@@ -1,6 +1,5 @@
|
|
1
1
|
require 'kookaburra/ui_driver/mixins/has_browser'
|
2
2
|
require 'kookaburra/ui_driver/mixins/has_strategies'
|
3
|
-
require 'kookaburra/ui_driver/mixins/has_subcomponents'
|
4
3
|
require 'kookaburra/ui_driver/mixins/has_ui_component'
|
5
4
|
|
6
5
|
module Kookaburra
|
@@ -10,7 +9,6 @@ module Kookaburra
|
|
10
9
|
include HasBrowser
|
11
10
|
include HasStrategies
|
12
11
|
include HasUIComponent
|
13
|
-
extend HasSubcomponents
|
14
12
|
|
15
13
|
##### Class macros #####
|
16
14
|
def self.component_locator(locator)
|
@@ -3,12 +3,26 @@ require 'minitest/mock'
|
|
3
3
|
|
4
4
|
describe Kookaburra::UIDriver::UIComponent do
|
5
5
|
it 'can have nested UIComponents' do
|
6
|
-
|
6
|
+
InnerComponentA = Class.new(Kookaburra::UIDriver::UIComponent) do
|
7
|
+
def visible?
|
8
|
+
true
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
InnerComponentB = Class.new(Kookaburra::UIDriver::UIComponent) do
|
13
|
+
def visible?
|
14
|
+
false
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
7
18
|
OuterComponent = Class.new(Kookaburra::UIDriver::UIComponent) do
|
8
|
-
ui_component :
|
19
|
+
ui_component :inner_component_a
|
20
|
+
ui_component :inner_component_b
|
9
21
|
end
|
22
|
+
|
10
23
|
component = OuterComponent.new(:browser => Object.new)
|
11
|
-
|
24
|
+
assert_equal true, component.has_inner_component_a?
|
25
|
+
assert_equal false, component.has_inner_component_b?
|
12
26
|
end
|
13
27
|
|
14
28
|
let(:component_class) do
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kookaburra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 43
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
8
|
+
- 13
|
9
9
|
- 0
|
10
|
-
version: 0.
|
10
|
+
version: 0.13.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Renewable Funding, LLC
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-01-
|
18
|
+
date: 2012-01-29 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|
@@ -187,7 +187,6 @@ files:
|
|
187
187
|
- lib/kookaburra/ui_driver.rb
|
188
188
|
- lib/kookaburra/ui_driver/mixins/has_browser.rb
|
189
189
|
- lib/kookaburra/ui_driver/mixins/has_strategies.rb
|
190
|
-
- lib/kookaburra/ui_driver/mixins/has_subcomponents.rb
|
191
190
|
- lib/kookaburra/ui_driver/mixins/has_ui_component.rb
|
192
191
|
- lib/kookaburra/ui_driver/ui_component.rb
|
193
192
|
- test/helper.rb
|