10. We Wrote a cuke...
Feature: Getting directions to Ohio City Burrito
As a hungry burrito lover
I want to drive to OCB
So I can get a Brother’s Burrito
Scenario: Directions button should take us to Google
Maps
Given I'm hungry for some OCB
When I touch the map icon
Then Google maps should provide me with directions
10
11. What’s A CUKE?...
Feature:
As a hungry burrito lover
I want to drive to OCB
So I can get a Brother’s
Scenario: Directions butt
take us to Google Maps
Given I'm hungry for some
When I touch the map icon
Then Google maps should p
with directions
CUKES ARE TESTS
11
13. Why test first? (CONVINCING YOUR BOSS)
CapersJones, SoftwareAssessments, Benchmarks, andBestPractices- Addison- Wesley, 2000
13
14. ATDD
Acceptance Test Developer Test
Define
Def Fail
Def Fail
Def
TDD
Pass
Def
Pass
Def Refactor
Def
14
15. Three amigos
Knows what to build
Knows how to build it
Knows how to verify it
15
16. Our First cuke
Feature: Getting directions to Ohio City Burrito
As a hungry burrito lover
I want to drive to OCB
So I can get a Brother’s Burrito
Scenario: Directions button should take us to Google
Maps
Given I'm hungry for some OCB
When I touch the map icon
Then Google maps should provide me with directions
16
21. Scenario: Checking pricesGiven I want to see what Ohio City Burrito
serves
When I touch the menu signThen I should see the prices:
| Brother’s Burrito | $6.15 || Baby Burrito | $1.85 |
|
21
22. Then /^I should see the prices:$/ do |expected_items|
actual_items = []
expected_items.raw.each do |item, expected_price|
price = on(MenuScreen).price item
actual_items << [item, price]
end
expected_items.diff! actual_items
end
22
23. class MenuScreen
class MenuScreen
include Gametel
include Gametel
ITEM = 0
button(:directions, :id => "directions_button")
DESCRIPTION = 1
button(:call, :id => "call_button")
PRICE = 2
end
button(:directions, :id => "directions_button")
button(:call, :id => "call_button")
def price(item)
Gametel::Views::ListItem.new(platform, :text => item).text[PRICE]
end
end
23
30. Happy hacking!
https://github.com/leandog/OCBMobile
Steve Jackson Dave Shah
@stevejxsn @daveshah
steve.jackson@leandogsoftware.com dave.shah@leandogsoftware.com
30