6. Calabash’s Client-Server Model
Calabash has a Client-Server model in which the server
portion is a lightweight web server that runs on the device
and listens for a client to connect and initiate the tests.
It then communicates via JSON over HTTP
11. Calabash-iOS setup
Drag calabash.framework from Finder into your project's Frameworks folder in Xcode.
Make sure that
a. Copy items into destination group's folder (if needed) is checked and
b. only your "-cal " target is checked in Add to targets.
You must also link you -cal target with CFNetwork.framework (unless your production target is already linking
with CFNetwork). To do this click on your -cal target in XCode. Click on Build Phases, expand Link Binary
with Libraries, click + to add CFNetwork.framework.
o Click on your project and select your new "-cal" target.
o Select "Build Settings".
o Ensure that "All" and not "Basic" settings are selected in "build settings".
o Find "Other Linker Flags" (you can type "other link" in the search field).
o Ensure that "Other linker flags" contains: -force_load
"$(SRCROOT)/calabash.framework/calabash" -lstdc++
20. First feature example
credit_card_validation.feature
Feature: Credit card validation.
Credit card numbers must be exactly 16 digits.
Scenario: Credit card number is to short
Given I use the native keyboard to enter "123456" into text field number 1
And I touch the "Validate" button
Then I see the text "Credit card number is to short."
21. First feature execution
Console Log
$ cucumberFeature: Credit card validation.
Credit card numbers must be exactly 16 digits.
Sceanario: Credit Card is too short
# features/credit_card_validation.feature:4
Given I use the native keyboard to enter "123456" into text field number 1
# calabash-cucumber-0.9.162/features/step_definitions/calabash_steps.rb:140
And I touch the "Validate" button
# calabash-cucumber-0.9.162/features/step_definitions/calabash_steps.rb:31
Then I see the text "Credit card number is to short."
# calabash-cucumber-0.9.162/features/step_definitions/calabash_steps.rb:3731
scenario (1 passed)3 steps (3 passed)0m18.035s
22. Second feature
Implementing the Second Scenario
Scenario: Credit card number is to long
Given I try to validate a credit card number that is 17 characters long
Then I should see the error message "Credit card number is to long."
25. Calabash Ruby API
Calabash has a client-server architecture. The Calabash Ruby API
is the client side which communicates over HTTP with the server
that is embedded in your app via the Calabash component.