Behavior-driven development (BDD) Why?
- why not?
- it's fun
- why not!?
Required
- http://brew.sh/
- $ brew install ruby
- $ gem install calabash-cucumber --no-ri --no-rdoc
- $ sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
- $ sudo gem install bundler
Install
- $ git clone https://github.com/codingricky/todoSwift
- In Xcode : open SingleTodo.xcodeproj and set Build Active Architecture Only = No
- fix error as Xcode suggest, build and run once to make sure it work properly
- $ cd todoSwift
- $ calabash-ios setup
- if you get
._SingleTodo.xcodeproj
do try delete it by...
We don't yet support this. Please setup calabash manually.
$ rm ._SingleTodo.xcodeproj
- In Xcode : switch to SingleTodo-cal scheme
- $ calabash-ios gen
- $ cucumber
Trouble?
- cry
- make sure all update https://github.com/calabash/calabash-ios/wiki/B1-Updating-your-Calabash-iOS-version#updating-calabash-ios and close then reopen terminal
- try https://github.com/calabash/calabash-ios/wiki/Hot-Topics#1-when-targeting-a-simulator-the-app-launches-then-quits-several-times-in-rapid-succession
- Time out waiting for UIAutomation run-loop? try this
$ DEVICE_TARGET="iPhone 6 (8.1 Simulator)" cucumber
- Unable to unzip calabash.framework.zip? try here for temporary workaround https://github.com/calabash/calabash-ios/issues/682
----------Info---------- error: cannot delete old ./calabash.framework/Headers error: cannot delete old ./calabash.framework/Resources error: cannot delete old ./calabash.framework/Versions/0.12.0 error: cannot delete old ./calabash.framework/Versions/Current caution: excluded filename not matched: __MACOSX/* caution: excluded filename not matched: calabash.framework/.DS_Store ----------Error---------- Unable to unzip file: /usr/local/lib/ruby/gems/2.2.0/gems/calabash-cucumber-0.12.1/bin/../staticlib/calabash.framework.zip You must install manually. ---------------------------
- yelling for permission? gimme sudo!
$ sudo chown -R replace_this_with_your_name /usr/local/lib/ruby/gems/2.2.0
Cached?
$ calabash-ios sim reset
Next?
- Refer to https://github.com/calabash/calabash-ios/issues/659 I've to change original step a little bit, let's edit features/my_first.feature like this
Feature: Todo list application can add tasks As a user I want to add tasks So I can remember to do things Scenario: Add Task Given I am on the Welcome Screen When I touch "Add" Then I enter "listening to Taylor Swift" into input field number 1 And I touch "Add task" Then I wait for "listening to Taylor Swift" to appear
Reference
- http://www.codingricky.com/calabash-ing-ios-applications/
- https://github.com/calabash/calabash-ios/wiki/02-Predefined-steps
- https://github.com/calabash/calabash-ios
Note to self
- tag working copy : https://github.com/katopz/todoSwift
Happy Testing! :D