This document discusses Android automation and introduces Magneto, an open source Android UI testing framework. It summarizes Magneto's benefits over other frameworks including being easy to set up, supporting asynchronous waits to avoid flaky tests, providing logs, screenshots and videos of failed tests for debugging, and giving full control over devices via ADB commands. The document encourages forking and contributing to Magneto on GitHub and notes the company EverythingMe is hiring experienced Android developers and automation engineers.
10. We love open source
at EverythingMe we utilize,
create and contribute
11. Open source Android automation
Cost
Community
Our own fork
Appium
Calabash
Espresso
MonkeyTalk
Robotium
Selendroid
...
12. How the big boys do it
ebay
Calabash (ruby)
Mozilla
Robocop (java)
Soundcloud
Robotium (java)
Facebook
Selendroid (java)
Yelp
Espresso (java)
Groupon
RoboRemote (java)
22. 1.
Setup was a big hassle
Magneto is easy to install and run
23. $ pip install magneto
Install
$ magneto run [tests_path]
Run
Boilerplate
$ magneto init [package]
24. Example test
def test_button(self):
# and click button
button = self.magneto(text='Click me')
button.click()
# scroll list
list = self.magneto(className='android.widget.ListView')
list.fling.toEnd()
# make sure last item exists
last_item = self.magneto(text="last item")
Assert.true(last_item.exists)
30. # click button
self.magneto(text=’Click me’).click()
# wait for text to change
self.magneto.wait_for_true(lambda:
button.info[‘text’] != ‘Click me’
)
wait for button text to change
32. # tap chrome icon
self.magneto(text=’Chrome’).click()
# wait for chrome to open
Assert.current_package(‘com.android.chrome’)
wait for chrome to open
34. # install app
with ADBLogWatch() as w:
w.watch(‘android.intent.action.PACKAGE_ADDED’)
ADB.install(‘apps/facebook.apk’)
w.assert_done()
# make sure it’s on homescreen
app = self.magneto(text=’Facebook’)
Assert.true(app.exists)
wait for app to be installed
37. # click button
with ADBLogWatch() as w:
w.watch(‘Stat1 sent’)
self.magneto(text=’click’).click()
w.assert_done()
assert stat
38. # click button
with ADBLogWatch() as w:
w.watch(‘Stat1 sent’)
w.watch(‘Stat2 sent’)
self.magneto(text=’click’).click()
w.assert_done()
assert multiple stats
39. # click button
with ADBLogWatch() as w:
w.watch(‘Stat sent’,screen=’home’,action=’click')
self.magneto(text=’click’).click()
w.assert_done()
assert stat params