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 
Exemple #2
0
def checkSystemWatchers():
	if d.watcher("IGNORE_ANR").triggered:
		raise Exception('AUTO_FC_WHEN_ANR')
	if d.watcher("IGNORE_CRASH").triggered:
		raise Exception('IGNORE_CRASH')
	d.watchers.reset()
	d.watchers.remove()
Exemple #3
0
 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
Exemple #4
0
 def tearDown(self):
     """
     called after each test method end or exception occur.
     """
     #super(VideoPlay, self).tearDown()
     #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="Wait") .click(text="确定")
     for i in xrange(8):
         d.press('back')
     d.press('home')# 'home, back,menu'd.press.home()
     d.press('home') 
 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')
Exemple #6
0
 def tearDown(self):
     """
     called after each test method end or exception occur.
     """
     #super(VideoPlay, self).tearDown()
     #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="Wait").click(
         text="确定")
     for i in xrange(8):
         d.press('back')
     d.press('home')  # 'home, back,menu'd.press.home()
     d.press('home')
Exemple #7
0
 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')
Exemple #8
0
 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')
Exemple #9
0
 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')
#!/usr/bin/env python
from uiautomatorplug.android import device as d
from uiautomator import device as dd
import unittest
import time
import sys
import commands
import string
import random
import math
import os

d.watcher("FC_WC").when(textContains = 'Unfortunately')\
                  .click(text = 'OK')

PACKAGE_NAME = 'com.intel.android.gallery3d'
ACTIVITY_NAME = PACKAGE_NAME + '/.app.Gallery'
PATH = os.getcwd()

#Resource-id for gallery main body, it does not change when switch between view
GALLEYBODY_RESID = 'com.intel.android.gallery3d:id/cardpop'

#Resource-id for action bar of gallery
ACTBAR_RESID = 'android:id/action_bar'

#Commands for refreshing media
REFRESH_MEDIA = 'adb shell am broadcast -a android.intent.action.MEDIA_MOUNTED -d file:///sdcard'

#All view could be entry
ViewModeList = ['albumview', 'gridview', 'fullview']
Exemple #11
0
	def setUp(self):
		d.watcher("IGNORE_ANR").when(textContains='停止运行').click(text='确定')
		u.setUp()
Exemple #12
0
def registerSysWatchers():
	d.watchers.reset()
	d.watchers.remove()
	d.watcher("IGNORE_ANR").when(textContains='无响应').click(text='确定')
	d.watcher("IGNORE_CRASH").when(textContains='停止运行').click(text='确定')
	d.watcher("IGNORE_POPWINDOW_WEIBO").when(textContains = '给我们评分').click(text = '不了,谢谢')
	d.watcher("IGNORE_DRAFT").when(textContains='是否保存草稿').click(text='不保存草稿')
	d.watcher("IGNORE_LOCATION").when(textContains = '位置信息').click(text = '拒绝')
	d.watcher("IGNORE_WLAN").when(textContains = 'WLAN').click(text = '确定')
	d.watcher("IGNORE_NAVIGATION").when(textContains = '离线地图').click(text = '暂不需要')
Exemple #13
0
 def checkSystemWatchers(self):
     self.assertFalse(d.watcher("fc").triggered, "APP force close")
Exemple #14
0
 def regesiterWatcher(self):
     d.watchers.reset()
     d.watchers.remove()
     d.watcher(u"fc").when(textContains=u"很抱歉").click(text=u"确定")
Exemple #15
0
#!/usr/bin/env python
from uiautomatorplug.android import device as d
from uiautomator import device as dd
import unittest
import time
import sys
import commands
import string
import random
import math
import os

d.watcher("FC_WC").when(textContains = 'Unfortunately')\
                  .click(text = 'OK')

PACKAGE_NAME = 'com.intel.android.gallery3d'
ACTIVITY_NAME = PACKAGE_NAME + '/.app.Gallery'
PATH = os.getcwd()

#Resource-id for gallery main body, it does not change when switch between view
GALLEYBODY_RESID = 'com.intel.android.gallery3d:id/cardpop'

#Resource-id for action bar of gallery
ACTBAR_RESID = 'android:id/action_bar'

#Commands for refreshing media
REFRESH_MEDIA = 'adb shell am broadcast -a android.intent.action.MEDIA_MOUNTED -d file:///sdcard'

#All view could be entry
ViewModeList = ['albumview', 'gridview', 'fullview']
Exemple #16
0
def registerSysWatchers():
	d.watchers.reset()
	d.watchers.remove()
	d.watcher("IGNORE_ANR").when(textContains='无响应').click(text='确定')
	d.watcher("IGNORE_CRASH").when(textContains='停止运行').click(text='确定')
Exemple #17
0
	def setUp(self):
		d.watcher("IGNORE_DRAFT").when(textContains='是否保存草稿').click(text='不保存草稿')
		u.setUp()