1. mobile automation made awesome
Isaac A. Murchie • Software Developer, Ecosystem & Integrations • Sauce Labs
@AppiumDevs • @imurchie • @saucelabs
MOBILE+WEB DEVCON 2014 • San Francisco, CA
February 3, 2015
link???
2. Appium Workshop
Jonathan Lipps • Director of Ecosystem & Integrations • Sauce Labs
@AppiumDevs • @jlipps • @saucelabs
Ecosystem &
Integrations
Core Developer
6. Over 5,500 commits
1,869 stars
1,385 forks
Over 160 contributors
1,700 pull requests merged
2,000 issues closed
OSS Rookie of the Year, Bossie award
Over 70 releases
8. Real App Under Test
You should not have to modify or recompile your
application in order to test it.
No discrepancy between test version and
marketplace version.
Ship a binary that passes tests!
9. Language Agnostic
Like Ruby? Write tests in Ruby.
Like JavaScript? Write tests in JavaScript.
…
You get the picture.
10. Don’t Reinvent the Wheel
A mobile automation framework ought to make use
of the tools that are out there, rather than building
everything from scratch.
This goes for API as well.
13. Automation Orchestra
Apple Instruments & UIAutomation for iOS
Google UiAutomator for Android (4.2.1 up)
Google Instrumentation for older Android & hybrid
(via Selendroid)
WebDriver interface
14. appium is a Node.js HTTP server
that creates and handles
WebDriver sessions
19. Local Requirements
!
- Mac 10.9+ with Xcode and iOS SDK
- Android SDK with emulators
- Node.js + NPM
- Java
- Appium client in your language
- Test runner in your language
28. Set up credentials:
Mac
!
export SAUCE_USERNAME=“meeee”
export SAUCE_ACCESS_KEY=“xxxxxxx”
Windows
!
SetX SAUCE_USERNAME meeee
SetX SAUCE_ACCESS_KEY xxxxxxx
32. Appium client for JavaScript
!
- We will use wd
- https://github.com/admc/wd
- The official, selenium-webdriver module does
not have the Appium extensions
- webdriver.io is also an option, but we won’t
cover it
45. Run the tests!
grunt test:all
# go to https://saucelabs.com/tests to see them running!
46. Problems? Run just one test
SAUCE=1 DEVICE=ios:7.1 mocha -t 90000 -R spec test/functional/ios/
web-specs.js
Or run just one group test
grunt test:ios or grunt test:ios:7.1
grunt test:android or grunt test:android:4.4
!
// try grunt --help for a list of available tasks
47. Further problems?
Grunt will fail fast when there are errors or warnings. Try running it
with the --force options
48. Run tests in parallel
grunt test:all:parallel
grunt test:android:parallel
grunt test:ios:parallel
52. Explore the code
-Gruntfile.js
-package.json
-apps
- // test apps, in case you run locally
-node_modules
- // installed by `npm install`
-tests
-functional
-helpers
-apps.js // a list of application names
-caps.js // set up test environments
-setup.js // initialize tests
-common
-f
-android
-hybrid-specs.js
-native-specs.js
-web-specs.js
-ios
-hybrid-specs.js
-native-specs.js
-web-specs.js
62. Ready for more? You could:
!
- Clean up test code into a View Object
Model pattern
- Use driver.source() to write simple tests
for ApiDemos and UICatalog
- Use driver.get(url) to load your web app and explore
with WebDriver
- Write a test for your own app!