Example projects for the Android version of calabash
Ubuntu
- sudo apt-get install ruby ruby-dev
- sudo gem install calabash-android
OsX (Mac)
- brew install ruby
- sudo gem install calabash-android
Ubuntu/OsX
- set ANDROID_HOME environment var to the Android SDK path (e.g. export ANDROID_HOME=/Users/your_user/Library/Android/sdk)
To run your test:
cd path_to_project/app1_KiedyPrzyjedzie
calabash-android run <apk>
Resign the application if needed:
calabash-android resign <apk>
Feature: Search for a specific stop
Scenario: I search for "CENTRUM" stop and wait for a result
* I wait for "ULUBIONE" to appear
When I see "ULUBIONE"
Then I enter text "centrum" into field with id "search_src_text"
* I should see text containing "CHMIELOWICE"
* I touch the "(040) CHMIELOWICE - CENTRUM" text
When I see "40"
Then I wait for 5 seconds
* I go back
Sample cert file can be downloaded from the repo: debug.keystore
copy the file to /home/your_user/.android/debug.keystore
Run calabash tests on multiple devices - specify device with ADB_DEVICE_ARG env variable:
export ADB_DEVICE_ARG=<adb_device_serial> calabash-android resign <apk> #OsX
ADB_DEVICE_ARG=<adb_device_serial> calabash-android resign <apk> #Ubuntu
calabash-android-steps ruby files
To create a Cucumber skeleton of the project in the current folder run the command:
calabash-android gen
It will create the directory structure needed to run tests, basic step defintions and a sample .feature file containing your first test.
To edit Calabash/Gherkin test files use the following:
- IntelliJ Ultimate Edition (Paid)
- Atom.io - excellent free editor from github - download it here
- Chrome extensions (free) like: tidy Gherkin and Pretty Gherkin
- Sublime editor (paid) : link with the cucumber bundle
Gherkin plugin: description
Terminal plugin: description
Shortcuts: ⌘ ⇧ + P - available options
⌘ + T - go to file
Control + ~ - open/close terminal