def setUp(self): """ called before each test method start. """ #if UI object not found. the watcher method will be invoked d.watcher('AUTO_FC_WHEN_ANR').when(text='ANR').when(text='强行关闭') .press('enter') d.wakeup() #wakeup device
def setUp(self): """ called before each test method start. """ #if UI object not found. the watcher method will be invoked d.watcher('AUTO_FC_WHEN_ANR').when(text='ANR').when( text='强行关闭').press('enter') d.wakeup() #wakeup device
def setUp(self): """ called before each test method start. """ d.wakeup() for i in xrange(3): d.press('back') d.press('home') d.press('home') for i in xrange(8): d.press('left')
def setUp(self): """ called before each test method start. """ d.wakeup() for i in xrange(3): d.press('back') d.press('home') d.press('home') for i in xrange(8): d.press('left') self.before_install = d.server.adb.cmd('shell pm list package -3').communicate()[0].split()
def setUp(self): """ called before each test method start. """ #a watcher to aviod dialog block test d.watcher("AUTO_FC_WHEN_ANR").when(text="稍后升级").click(text="稍后升级") d.wakeup() for i in xrange(3): d.press('back') d.press('home') d.press('home') for i in xrange(8): d.press('left')
def setUp(self): """ called before each test method start. """ #super(VideoPlay, self).setUp() #d.watcher("AUTO_FC_WHEN_ANR").when(text="ANR").when(text="Wait") .press.back.home() d.watcher("AUTO_FC_WHEN_ANR").when(text="ANR").when(text="强行关闭") .click(text="确定") d.wakeup() d.press('home') d.press('home') for i in xrange(8): d.press('left')
def setUp(self): """ called before each test method start. """ #super(VideoPlay, self).setUp() #d.watcher("AUTO_FC_WHEN_ANR").when(text="ANR").when(text="Wait") .press.back.home() d.watcher("AUTO_FC_WHEN_ANR").when(text="ANR").when(text="强行关闭").click( text="确定") d.wakeup() d.press('home') d.press('home') for i in xrange(8): d.press('left')
def setUp(self): """ called before each test method start. """ d.wakeup() for i in xrange(3): d.press('back') d.press('home') d.press('home') for i in xrange(8): d.press('left') self.before_install = d.server.adb.cmd( 'shell pm list package -3').communicate()[0].split()
def setUp(self): """ called before each test method start. """ #super(MediaExplorerTest, self).setUp() #d.watcher("AUTO_FC_WHEN_ANR")#.when(text="ANR").when(text="Wait") .press.back.home() #d.watcher("AUTO_FC_WHEN_ANR").when(text="ANR").when(text="强行关闭") .click(text="确定") #d.watcher("AUTO_FC_WHEN_ANR").press.left.left.left.home() #d.handlers.on(fc_close) d.wakeup() for i in xrange(3): d.press('back') d.press('home') d.press('home') for i in xrange(8): d.press('left')
def unlock(): ''' unlock() 解锁屏幕,黑屏或其他状态解锁屏幕。 return boolean ''' d.wakeup() lockscreen = d(className = 'android.widget.ImageView',resourceId = 'com.smartisanos.keyguard:id/desk_kg') if lockscreen.exists: x = d.info['displayWidth'] y = d.info['displayHeight'] d.swipe(x/2,int(y/1.5),x/2,0,20) if not lockscreen.exists: return True else: return False
def checkScreen(self): d.screen.off() time.sleep(2) if d.screen == "off": # of d.screen != "on" d.wakeup() time.sleep(2)
def checkScreen(): d.server.jsonrpc.sleep() if d.screen == "off": # of d.screen != "on" d.wakeup() time.sleep(2) d.press("menu")