automated interactive testing for i os
DESCRIPTION
Mobile March 2012TRANSCRIPT
Automated Interactive Testing for iOSRob Bajorek - Code 42 Software
Topics
• Interactive testing
• The tools
• Demo and walkthrough
Interactive Testing
Unit tests- (void)testClearNonPersistentCredentialsDoesNotClearPrivatePasswordPersistent {
[self helper_setTestCredentialsPersistent:YES]; [self helper_setUpAccountTypePrivatePasswordPersistent:YES]; CPConfigService *cs = [[CPConfigService alloc] init]; [cs clearNonPersistentCredentials]; GHAssertEqualStrings(cs.dataPassword, testDataPassword, @"private password incorrectly cleared (%@)", cs.dataPassword);}
- (void)testClearNonPersistentCredentialsClearsPrivatePasswordNonPersistent { [self helper_setTestCredentialsPersistent:YES]; [self helper_setUpAccountTypePrivatePasswordPersistent:NO]; CPConfigService *cs = [[CPConfigService alloc] init]; [cs clearNonPersistentCredentials]; GHAssertNil(cs.dataPassword, @"private password not cleared (%@)", cs.dataPassword);}
Unit tests can pay for themselves over time
Unit tests are easy to automate
Continuous Integration
What’s missing?
Interactive testing is...
• time-consuming
• boring
• error-prone
Automate your interactive testing
You still need people
The Tools
• UI Automation
• CoffeeScript
• Accessibility
• Zucchini
UI Automation
• UI Automation Reference Collection
Accessibility
• Accessibility Programming Guide for iOS
Zucchini
• http://www.zucchiniframework.org
Natural languagescript
Then on the "Browse" screen:
Download file "Minneapolis.jpg"
Tap cell "Minneapolis.jpg" in the table
Then on the "Viewer" screen:
Verify navigation bar title is "Minneapolis.jpg"
Tap "Back"
Then on the "Browse" screen:
Tap "Home"
Then on the "Home" screen:
Tap "Sign Out"
Demo
• Brief install advice
• Project setup
• Example “smoke test”
• Walkthrough
Prerequisites
• See instructions at www.zucchiniframework.org
• Homebrew / MacPorts
• ImageMagick
• CoffeeScript
Installing Zucchini
• https://github.com/playup/zucchini
• https://github.com/rajbeniwal/zucchini-demo
Demo and Walkthrough
Conclusion
• Start at www.zucchiniframework.org
• Use the UI Automation Reference for help
• Get to know UIAElement
• ‘Show all elements’: -> view.logElementTree()
Thank you!