Calabash is an open source, cross-platform tool for automating acceptance testing of mobile apps. It allows writing tests in a behavior-driven development style using Gherkin syntax. The tests can query UI elements, interact with apps by tapping and typing, and assert outcomes across Android and iOS apps. Calabash supports resetting app data between tests, waiting for elements to load, and integrating with continuous integration for automated testing.
4. What is Calabash?
• Automated acceptance testing of mobile apps
• Cross-platform (Android & iOS)
5. What is Calabash?
• Automated acceptance testing of mobile apps
• Cross-platform (Android & iOS)
• Open source - Company called Xamarin
backing it
6. What is Calabash?
• Automated acceptance testing of mobile apps
• Cross-platform (Android & iOS)
• Open source - Company called Xamarin
backing it
• https://github.com/calabash/calabash-ios
7. What is Calabash?
• Automated acceptance testing of mobile apps
• Cross-platform (Android & iOS)
• Open source - Company called Xamarin
backing it
• https://github.com/calabash/calabash-ios
• https://github.com/calabash/calabash-android
13. Unit Tests
• Tests smallest unit of functionality
public void TestPhoneValidator()
{
string goodPhone = "(123) 555-1212";
string badPhone = "555 12"
PhoneValidator validator = new PhoneValidator();
Assert.IsTrue(validator.IsValid(goodPhone));
Assert.IsFalse(validator.IsValid(badPhone));
}
• Mocks and Stubs to simulate behaviour of other
objects
41. Custom Steps - Ruby API
• https://github.com/calabash/calabash-ios/wiki/03.5-Calabash-iOS-
Ruby-API
42. Custom Steps - Ruby API
• https://github.com/calabash/calabash-ios/wiki/03.5-Calabash-iOS-
Ruby-API
• query, check for existence of elements, wait for elements to exist
43. Custom Steps - Ruby API
• https://github.com/calabash/calabash-ios/wiki/03.5-Calabash-iOS-
Ruby-API
• query, check for existence of elements, wait for elements to exist
• keyboard
44. Custom Steps - Ruby API
• https://github.com/calabash/calabash-ios/wiki/03.5-Calabash-iOS-
Ruby-API
• query, check for existence of elements, wait for elements to exist
• keyboard
• scroll
45. Custom Steps - Ruby API
• https://github.com/calabash/calabash-ios/wiki/03.5-Calabash-iOS-
Ruby-API
• query, check for existence of elements, wait for elements to exist
• keyboard
• scroll
• rotate
46. Custom Steps - Ruby API
• https://github.com/calabash/calabash-ios/wiki/03.5-Calabash-iOS-
Ruby-API
• query, check for existence of elements, wait for elements to exist
• keyboard
• scroll
• rotate
• backdoor -> call method in iOS app (implement in app delegate)
47. Custom Steps - Ruby API
• https://github.com/calabash/calabash-ios/wiki/03.5-Calabash-iOS-
Ruby-API
• query, check for existence of elements, wait for elements to exist
• keyboard
• scroll
• rotate
• backdoor -> call method in iOS app (implement in app delegate)
• macro -> call other step definitions
51. Tips and Tricks
• Resetting app data between scenarios
• Avoid sleep - use wait instead:
52. Tips and Tricks
• Resetting app data between scenarios
• Avoid sleep - use wait instead:
And I wait to see "send button"
53. Tips and Tricks
• Resetting app data between scenarios
• Avoid sleep - use wait instead:
And I wait to see "send button"
• Wait before you interact with any element
54. Tips and Tricks
• Resetting app data between scenarios
• Avoid sleep - use wait instead:
And I wait to see "send button"
• Wait before you interact with any element
• Wait after every action to finish
55. Tips and Tricks
• Resetting app data between scenarios
• Avoid sleep - use wait instead:
And I wait to see "send button"
• Wait before you interact with any element
• Wait after every action to finish
• Escape quotes…
56. Tips and Tricks
• Resetting app data between scenarios
• Avoid sleep - use wait instead:
And I wait to see "send button"
• Wait before you interact with any element
• Wait after every action to finish
• Escape quotes…
• https://groups.google.com/forum/#!forum/calabash-ios
57. Optional: Compare Images
• gem install imagemagick-binaries
• check you have compare: $ which compare
58. Optional: Compare Images
• gem install imagemagick-binaries
• check you have compare: $ which compare
61. Other Info
• UIKonf talk ‘Unit Testing on iOS’ by Tim
Brückmann https://speakerdeck.com/tibr/unit-testing-
on-ios
• http://calaba.sh
• https://github.com/calabash/calabash-ios
• http://developer.xamarin.com/guides/testcloud/
calabash/introduction-to-calabash/
62. Summary
• Automated Testing - investment that pays off
• Together with unit testing etc: make changes
with confidence (still, manual QA required)
• Cross-platform mature toolset
• Continuous integration / code coverage