Automated AcceptanceTestingmdevcon 2013
View Slide
Pete Hodgson@ph1
we are hiring
examples are iOSsame principles acrossplatforms
Straw Poll
Straw PollAppCode~ or ~XCode
Straw PollIntelliJ~ or ~Eclipse
we alltest
why do wetest?
does it work?
does it still work?
does it workon ?
testingprovidesfeedback
why don’t wetest?
manual testingcan beexpensive
manual testingcan betedious
“Computers are designed to do simplerepetitive tasks. The second you have humansdoing repetitive tasks, all the computers gettogether late at night and laugh at you…”- Neal Ford
so automate your tests(where it makes sense)
testingprovidesfeedbackautomatedbetter
testingprovidesfeedbackautomatedfaster
testingprovidesfeedbackautomatedbroader
testingprovidesfeedbackautomateduniform
types ofautomated testing
MobileAppEnd UserBackendServices
UnitTestMobileAppEnd UserBackendServices
MobileAppEnd UserBackendServicesIntegrationTest
AcceptanceTestMobileAppEnd UserBackendServices
AcceptanceTestMobileAppEnd UserBackendServicesThe App
AcceptanceUnitIntegration
demo!
I love it!How do I do it?
iOSFrankCalabashKIFAppiumUIAutomation
AndroidCalabashRobotiumInstrumentation
Mobile WebiPhoneDriver/AndroidDriverchromedriverheadless WebDriverwebdriver-user-agent
the UI testing triad
selecta bit o UI
selecta bit o UIsimulateinteractionwith it
selecta bit o UIsimulateinteractionwith itinspect stateo it
UIselectinteract inspect
UIselectinteractinspect
user simulationtouch(...)type_into_keyboard(...)set_orientation(...)double_tap(...)tap_and_hold(...)drag_with_initial_delay(...)
simulatinggestures
touch(...)
touch(...)what?
view selectors
view selectorsa little language to specify which viewsyou are interested ine.g. CSS or XPath
good view selectors==sustainable tests
accessibility is yourbest friend
record-and-playback testsuites are not sustainable
interact inspectselectUI
putting it all together
thanks.questions?
more questions?@ph1http://blog.thepete.net[email protected]me, at the barfeedback:rate.thepete.netthis deck:slides.thepete.net