Upload
droidcontlv
View
65
Download
1
Embed Size (px)
Citation preview
Heyo!I’M RAN BEN AHARON
Android & Automation lead @EverythingMe
We love open source
at EverythingMe we utilize, create and contribute
Open source Android automation
CostCommunityOur own fork
AppiumCalabashEspressoMonkeyTalkRobotiumSelendroid...
How the big boys do it
ebayCalabash (ruby)
MozillaRobocop (java)
SoundcloudRobotium (java)
FacebookSelendroid (java)
YelpEspresso (java)
GrouponRoboRemote (java)
Distrust and disengagement
Unreliable resultsNot part of the release flowNo visibilityCumbersome tools
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)
# wait for button button = self.magneto.wait_for_element(text=’click’) # make sure it’s there Assert.true(button.exists)
wait for button to appear
# 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
# tap chrome icon self.magneto(text=’Chrome’).click() # wait for chrome to open Assert.current_package(‘com.android.chrome’)
wait for chrome to open
# 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
# click button with ADBLogWatch() as w: w.watch(‘Stat1 sent’)
self.magneto(text=’click’).click() w.assert_done()
assert stat
# 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
# 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
- 3-test_name-time.hierarchy.uix- 3-test_name-time.screenshot.png- 3-test_name-time.logcat.log- 3-test_name-time.video.mp4
- 12-test_name-time.hierarchy.uix- 12-test_name-time.screenshot.png- 12-test_name-time.logcat.log- 12-test_name-time.video.mp4
Failed tests artifacts
ADB.install(apk_path)ADB.uninstall(app_package)ADB.start_activity(app_package, app_activity)ADB.kill_process(app_package)
ADB.exec_cmd(command)ADB.set_date(date)ADB.getprop(prop)ADB.get_log()ADB.clear_log()
ADB power
$ imagneto
In magneto(text=”click”).click()In magneto.orientation = “r”
In f = magneto(resourceId=”el”)In f.info
imagneto