-
Ruby 2.0 or higher must be installed on OS X or Windows.
UPDATE: MacOS built-in ruby cannot support latest calabash-ios now. Latest ruby version is recommended which could be managed by rbenv(https://sanwen8.cn/p/1f1O4TQ.html) which could be acquired via brew(https://brew.sh/). -
Development Environment
iOS: XCode 6.3 or higher. You must also have your iOS signing certificates and distribution profiles for creating an IPA setup on your computer.
Android: you already have your computer configured for Android application development, and that you are using Android Studio 1.2.1.1 or higher. You must have the ANDROID_HOME environment variable set. -
To install the Calabash Sandbox
OS X (NEVER sudo to install the calabash Sandbox):
curl -sSL https://raw.githubusercontent.com/calabash/install/master/install-osx.sh | bash
Windows(requires Windows 10 and Powershell):
1.To install, open an administrator Powershell and change the execution policy to unrestricted:
set-executionpolicy unrestricted
2.Download and install the Calabash Sandbox installer script:
(New-Object System.Net.WebClient).DownloadString("https://raw.githubusercontent.com/calabash/install/master/install-windows.ps1") | iex
3.reset the execution policy to restricted: set-executionpolicy restricted
You could get more information from:
https://developer.xamarin.com/guides/testcloud/calabash/
- Checkout "automation" environment git clone http://[email protected]/scm/ttol/automation.git
- Execute calabash-sandbox in a Terminal session to initiate a sandbox environment and go to "automation" folder
- Copy your test artifacts unto "binaries" folder and update config/devices.rb
(Note: Please make sure ipa file is archived after calabash framework linked meanwhile the Calabash framework must NOT be included in Release builds of the IPA.) - Plug devices to your computer and make sure "Enable UI Automation" and "USB Debugging" is enabled with your ios/android device
- Edit config/devices.rb to update your device info:
"device" within "android_device" could be acquired by "adb devices" in terminal
"device" within "ios_device" is your ios device's UDID
"endpoint" within "ios_device" is your ios device's IP plus constant port "37265" - (Optional)Edit support/credentials.rb to fill out your authentication:
Please ensure the "valid_user" and "valid_pass" is a valid combination which can make you login
"invalid_user" and "invalid_pass" are just for error check purpose, you could leave them alone - Create tests:
features/.feature: all test scenarios start from here which shared by iOS and android
features/steps: step definitions that only use the page objects and no Calabash methods like touch, query…which shared by iOS and android
features/android/pages: implementation of each page on android
features/ios/pages: implementation of each page on iOS
- Run test cases:
ios: run.rb ios
android: run.rb android
ios simulator: run.rb sim - (Optional)Enter console mode
ios: console.rb ios
android: console.rb android
ios simulator: console.rb sim
http://xamarin.com/evolve/2013#session-xcjpj20d6s
http://developer.xamarin.com/testcloud/
http://calabashapi.xamarin.com/ios/
http://calabashapi.xamarin.com/android/
https://evolve.xamarin.com/ - Evolve - Xamarin Developer Conference
http://developer.xamarin.com/guides/testcloud/calabash/xplat-best-practices/
https://github.com/calabash/calabash-ios/blob/develop/calabash-cucumber/doc/x-platform-testing.md
http://www.github.com/xamarin/test-cloud-samples
https://github.com/calabash/calabash-ios
https://github.com/calabash/calabash-android
http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/