iOS Automated Testing with Calabash: Tips and Tricks
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

iOS Automated Testing with Calabash: Tips and Tricks

on

  • 9,583 views

 

Statistics

Views

Total Views
9,583
Views on SlideShare
9,528
Embed Views
55

Actions

Likes
4
Downloads
89
Comments
0

2 Embeds 55

https://twitter.com 54
http://www.linkedin.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution-NonCommercial LicenseCC Attribution-NonCommercial License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

iOS Automated Testing with Calabash: Tips and Tricks Presentation Transcript

  • 1. iOS Automated Testing with Calabash: Tips and Tricks Moncef Belyamani @monfresh Mobile Testing Summit / November 1, 2012 / San Francisco
  • 2. iPhone AppsiPad Apps
  • 3. AUTOMATION TOOL CHECKLIST• Easy to set up and maintain• Updated regularly• Well-documented• Supports iOS and Android• Runs on devices untethered• Readable tests
  • 4. TOOLS EVALUATED• Anteater• Calabash• FoneMonkey (before it became MonkeyTalk)• Frank• KIF• TouchTest• UI Automation• Zucchini
  • 5. AND THE WINNER IS...
  • 6. RECOMMENDED SETUP• Ruby 1.9.3• RVM• Gemset• How to install Xcode, Homebrew, Git, RVM, & Ruby 1.9.3 on Snow Leopard, Lion, and Mountain Lion• Enhance your Ruby development with RVM gemsets and .rvmrc
  • 7. CALABASH TESTFEATURE FILE + STEP DEFINITION
  • 8. FEATURE EXAMPLEFeature: Comments In order to contribute to the discussion As a Hacker News reader I want to be able to add a commentScenario: User not logged in Given I am not logged in When I go to comment on a submission Then I should be prompted to log in
  • 9. DON’T DO THISScenario: User logged in, but cancels comment form Given the app is running When I touch "Profile" Then I wait to see "Login" Then I fill in “Username” with "my_username" Then I touch “Password” Then I fill in “Password” with "my_password" Then I touch done Then I wait to see "Logout" Then I touch "Home" Then I touch list item number 1 Then I touch "reply" Then I touch "Cancel" Then I should see "Submission"
  • 10. DO THISScenario: User logged in, but cancels comment form Given I am logged in as “username” When I go to comment on a submission But I cancel the comment form Then I should see the submission And a comment from "username" should not appear
  • 11. STEP DEFINITIONGiven /^I am logged in as "([^"]*)"$/ do |username| macro I touch "Profile" if element_exists("button marked:Logout") sleep(1) else macro %Q[I fill in “Username” with "#{username}"] macro I touch “Password” macro I fill in “Password” with "my_password" macro I touch done macro I wait to see "Logout" endend
  • 12. UPDATING IS EASY, BUT...• gem update calabash-cucumber• calabash-ios download (not with SVN)• curl http://localhost:37265/version (to verify framework is up to date)• May need to “Reset Content and Settings” in Simulator• When new files are added, update Target Membership
  • 13. KEEP IN MINDSwiping depends on device orientationCan only touch visible items
  • 14. TIPS & TRICKSUse .bash_profile aliasesself.myButton.accessibilityElementsHidden = YES;Use console to experiment and “query” to find elementsParticipate in the Google GroupGet commit notifications with GitHub for Mac
  • 15. RECOMMENDATIONS• Full-time Automation Engineer• Work with Dev to make apps accessible• Continuous Integration• Contribute fixes and custom steps
  • 16. REFERENCES• iOS Automated Testing with Calabash, Cucumber, and Ruby• Create aliases in .bash_profile to assign shortcuts for common Terminal commands• A Calabash custom step to Swipe to delete all cells in a Table View• Code for America• AOL Mobile
  • 17. Moncef Belyamani @monfreshmoncef@monfresh.commoncefbelyamani.com about.me/moncef
  • 18. QUESTIONS?
  • 19. THANK YOU!