def test_step(self): Setting(DUT).launchSubSetings(["更多设置", "动作手势"]) Common(DUT).switchWidget("开启", "amigo:id/amigo_switchWidget") Common(DUT).switchWighetByIndex( "关闭", 0, "com.android.settings:id/gesture_checkbox") Common(DUT).switchWighetByIndex( "关闭", 1, "com.android.settings:id/gesture_checkbox") Common(DUT).switchWighetByIndex( "关闭", 2, "com.android.settings:id/gesture_checkbox") Common(DUT).switchWighetByIndex( "开启", 3, "com.android.settings:id/gesture_checkbox") Common(DUT).switchWighetByIndex( "关闭", 4, "com.android.settings:id/gesture_checkbox") Common(DUT).switchWighetByIndex( "关闭", 5, "com.android.settings:id/gesture_checkbox") Common(DUT).clickByText("黑屏手势") Common(DUT).clickByText("双指下滑", screeScroll=True) Common(DUT).clickByText("屏幕解锁") Common(DUT).clickWhenExist(text="确定") Common(DUT).clickByText("完成") Common(DUT).goBackHome() Common(DUT).lockScreen() USB.disconnectUsb() # Power.sampleResult(sPath="d:\powerResult", mTime=300, delay=CONST.POWER.delay[180], caseName=TAG) PM.powerMeasure(sample=CONST.POWER.sample, mTime=180, Vout=CONST.POWER.Vout, delay=CONST.POWER.delay[180], caseName=TAG, tPath=CONST.POWER.tPath) USB.connectUsb() Common(DUT).unlockScreen()
def test_step(self): Setting(DUT).launchSubSetings(["更多设置", "动作手势"]) Common(DUT).switchWidget("开启", "amigo:id/amigo_switchWidget") Common(DUT).switchWighetByIndex( "关闭", 0, "com.android.settings:id/gesture_checkbox") Common(DUT).switchWighetByIndex( "关闭", 1, "com.android.settings:id/gesture_checkbox") Common(DUT).switchWighetByIndex( "关闭", 2, "com.android.settings:id/gesture_checkbox") Common(DUT).switchWighetByIndex( "开启", 3, "com.android.settings:id/gesture_checkbox") Common(DUT).switchWighetByIndex( "关闭", 4, "com.android.settings:id/gesture_checkbox") Common(DUT).switchWighetByIndex( "关闭", 5, "com.android.settings:id/gesture_checkbox") Common(DUT).goBackHome() Common(DUT).lockScreen() USB.disconnectUsb() PM.powerMeasure(sample=CONST.POWER.sample, mTime=180, Vout=CONST.POWER.Vout, delay=CONST.POWER.delay[180], caseName=TAG, tPath=CONST.POWER.tPath) USB.connectUsb() Common(DUT).unlockScreen()
def test_step(self): Common(DUT).lockScreen() USB.disconnectUsb() # Power.sampleResult(sPath="d:\powerResult", mTime=300, delay=CONST.POWER.delay[180], caseName=TAG) PM.powerMeasure(sample=CONST.POWER.sample, mTime=180, Vout=CONST.POWER.Vout, delay=CONST.POWER.delay[180], caseName=TAG, tPath=CONST.POWER.tPath) USB.connectUsb() Common(DUT).unlockScreen()
def test_step(self): Common(DUT).goHome() Common(DUT).startActivity("com.gionee.video/.VideoMainActivity") Common(DUT).clickWhenExist(text="继续") Common(DUT).clickByText("设置") Common(DUT).switchWighetByIndex( "开启", 0, "com.gionee.video:id/amigo_switchWidget") Common(DUT).goBack() Common(DUT).clickByText("扫描") Common(DUT).clickByText("内部存储器") Common(DUT).clickById("com.gionee.video:id/name") Common(DUT).clickWhenExist(text="我知道了") Common(DUT).wait(7) Common(DUT).clickScreenCenter() Common(DUT).clickById("com.gionee.video:id/screen_mode_switcher") for i in range(20): Common(DUT).volumeUp() Common(DUT).clickWhenExist(text="确定") USB.disconnectUsb() # Power.sampleResult(sPath="d:\powerResult", mTime=300, delay=CONST.POWER.delay[180], caseName=TAG) PM.powerMeasure(sample=CONST.POWER.sample, mTime=600, Vout=CONST.POWER.Vout, delay=CONST.POWER.delay[180], caseName=TAG, tPath=CONST.POWER.tPath) USB.connectUsb() Common(DUT).unlockScreen()
def test_step(self): Common(DUT).startActivity("com.gionee.note/.HomeActivity") Common(DUT).clickByText("新建") Common(DUT).wait(2) Common(DUT).clickWhenExist(text="允许") #添加文本 Device(DUT)(text="输入正文").set_text("I am testing!") #添加照片 Common(DUT).clickById("com.gionee.note:id/action_camera") Common(DUT).clickWhenExist(text="继续") Common(DUT).clickById("com.android.camera:id/shutter_button_icon") Common(DUT).clickById("com.android.camera:id/review_btn_done") #添加录音 Common(DUT).clickById("com.gionee.note:id/action_recorde") Common(DUT).wait(5) Common(DUT).clickById("com.gionee.note:id/sound_recorder_stop") #添加提醒 Common(DUT).clickById("com.gionee.note:id/action_reminder") Common(DUT).clickById("com.gionee.note:id/reminder_time_text") Common(DUT).swipe(723, 1428, 723, 1300, 50) #适配G1602A坐标 Common(DUT).clickByText("确定") Common(DUT).goBackHome() Common(DUT).wait(60) Common(DUT).lockScreen() Common(DUT).wait(5) USB.disconnectUsb() # Power.sampleResult(sPath="d:\powerResult", mTime=300, delay=CONST.POWER.delay[180], caseName=TAG) PM.powerMeasure(sample=100, mTime=180, Vout=CONST.POWER.Vout, delay=CONST.POWER.delay[180], caseName=TAG, tPath=CONST.POWER.tPath) USB.connectUsb() Common(DUT).unlockScreen()
def test_step(self): Common(DUT).startActivity( "com.amigo.keyguard/com.amigo.navi.keyguard.category.CategoryBaseActivity" ) Common(DUT).clickById("com.amigo.keyguard:id/category_setting") Common(DUT).switchWidget( "false", "com.amigo.keyguard:id/settings_switch_double_desktop_lock") Common(DUT).goBackHome() Common(DUT).lockScreen() Common(DUT).wakeUp() Common(DUT).doubleClick(500, 500) Common(DUT).wait(5) USB.disconnectUsb() # Power.sampleResult(sPath="d:\powerResult", mTime=300, delay=CONST.POWER.delay[180], caseName=TAG) PM.powerMeasure(sample=100, mTime=180, Vout=CONST.POWER.Vout, delay=CONST.POWER.delay[180], caseName=TAG, tPath=CONST.POWER.tPath) USB.connectUsb() Common(DUT).unlockScreen() Common(DUT).startActivity( "com.amigo.keyguard/com.amigo.navi.keyguard.category.CategoryBaseActivity" ) Common(DUT).clickById("com.amigo.keyguard:id/category_setting") Common(DUT).switchWidget( "true", "com.amigo.keyguard:id/settings_switch_double_desktop_lock")
def test_step(self): Common(DUT).startActivity("com.android.camera/.CameraLauncher") Common(DUT).nohupTest("PowerTestCases.jar", "testCamera") USB.disconnectUsb() # Power.sampleResult(sPath="d:\powerResult", mTime=300, delay=180, caseName=TAG) PM.powerMeasure(sample=100, mTime=600, Vout=CONST.POWER.Vout, delay=CONST.POWER.delay[60], caseName=TAG, tPath=CONST.POWER.tPath) USB.connectUsb()
def test_step(self): Common(DUT).clickByText("名片扫描") Common(DUT).clickByText("摄像") Common(DUT).clickById("com.android.camera:id/shutter_button_icon") USB.disconnectUsb() PM.powerMeasure(sample=100, mTime=180, Vout=CONST.POWER.Vout, delay=CONST.POWER.delay[60], caseName=TAG, tPath=CONST.POWER.tPath) USB.connectUsb() Common(DUT).clickById("com.android.camera:id/shutter_button_icon")
def test_step(self): Common(DUT).startActivity("com.gionee.video/.VideoMainActivity") Common(DUT).clickWhenExist(text="继续") # Common(DUT).goBack() Common(DUT).clickByText("扫描") Common(DUT).nohupTest("PowerTestCases.jar", "testVideo") USB.disconnectUsb() # Power.sampleResult(sPath="d:\powerResult", mTime=300, delay=180, caseName=TAG) PM.powerMeasure(sample=100, mTime=600, Vout=CONST.POWER.Vout, delay=CONST.POWER.delay[60], caseName=TAG, tPath=CONST.POWER.tPath) USB.connectUsb()
def test_step(self): Common(DUT).lockScreen() USB.disconnectUsb() PM.powerMeasure(sample=CONST.POWER.sample, mTime=600, Vout=CONST.POWER.Vout, delay=CONST.POWER.delay[180], caseName=TAG, tPath=CONST.POWER.tPath) USB.connectUsb()
def test_step(self): Common(DUT).startActivity("com.tencent.mm/.ui.LauncherUI") Common(DUT).clickByText("名字头像不要动") if Common(DUT).exists(resourceId="com.tencent.mm:id/yw"): Common(DUT).clickById("com.tencent.mm:id/yt") Common(DUT).nohupTest("PowerTestCases.jar", "testWechat") USB.disconnectUsb() # Power.sampleResult(sPath="d:\powerResult", mTime=300, delay=180, caseName=TAG) PM.powerMeasure(sample=100, mTime=900, Vout=CONST.POWER.Vout, delay=CONST.POWER.delay[60], caseName=TAG, tPath=CONST.POWER.tPath) USB.connectUsb()
def test_step(self): Common(DUT).clickByText("微博", screeScroll=True, direction="left_right") # Common(DUT).startActivity("com.sina.weibo/com.sina.weibo.VisitorMainTabActivity") Common(DUT).clickWhenExist(text="确定") Common(DUT).nohupTest("PowerTestCases.jar", "testWeibo") USB.disconnectUsb() # Power.sampleResult(sPath="d:\powerResult", mTime=300, delay=180, caseName=TAG) PM.powerMeasure(sample=100, mTime=900, Vout=CONST.POWER.Vout, delay=CONST.POWER.delay[60], caseName=TAG, tPath=CONST.POWER.tPath) USB.connectUsb()
def test_step(self): Common(DUT).startActivity( "jlzn.com.android.compass/.JLZN_CompassActivity") USB.disconnectUsb() # Power.sampleResult(sPath="d:\powerResult", mTime=300, delay=CONST.POWER.delay[180], caseName=TAG) PM.powerMeasure(sample=100, mTime=180, Vout=CONST.POWER.Vout, delay=CONST.POWER.delay[180], caseName=TAG, tPath=CONST.POWER.tPath) USB.connectUsb()
def test_step(self): Common(DUT).setAirplaneMode("开启") Common(DUT).lockScreen() USB.disconnectUsb() PM.powerMeasure(sample=100, mTime=180, Vout=CONST.POWER.Vout, delay=CONST.POWER.delay[180], caseName=TAG, tPath=CONST.POWER.tPath) USB.connectUsb() Common(DUT).unlockScreen()
def test_step(self): Common(DUT).clickByText("名片扫描") Common(DUT).clickByText("拍照") Common(DUT).nohupTest("PowerTestCases.jar", "testCamera") USB.disconnectUsb() PM.powerMeasure(sample=100, mTime=600, Vout=CONST.POWER.Vout, delay=CONST.POWER.delay[60], caseName=TAG, tPath=CONST.POWER.tPath) USB.connectUsb()
def test_step(self): Common(DUT).setAirplaneMode("开启") Setting(DUT).setScreenTimeout("30min") Common(DUT).goBackHome() USB.disconnectUsb() # Power.sampleResult(sPath="d:\powerResult", mTime=300, delay=CONST.POWER.delay[180], caseName=TAG) PM.powerMeasure(sample=100, mTime=180, Vout=CONST.POWER.Vout, delay=CONST.POWER.delay[180], caseName=TAG, tPath=CONST.POWER.tPath) USB.connectUsb()
def test_step(self): Common(DUT).startActivity("com.android.soundrecorder/.SoundRecorder") Common(DUT).click_relative(0.5, 0.9) Common(DUT).goHome() Common(DUT).lockScreen() Common(DUT).wait(5) USB.disconnectUsb() # Power.sampleResult(sPath="d:\powerResult", mTime=300, delay=CONST.POWER.delay[180], caseName=TAG) PM.powerMeasure(sample=100, mTime=180, Vout=CONST.POWER.Vout, delay=CONST.POWER.delay[180], caseName=TAG, tPath=CONST.POWER.tPath) USB.connectUsb() Common(DUT).unlockScreen() Common(DUT).startActivity("com.android.soundrecorder/.SoundRecorder") Common(DUT).click_relative(0.5, 0.9)
def test_step(self): Common(DUT).goBackHome() Common(DUT).lockScreen() Common(DUT).wait(7) Common(DUT).doubleClick(500, 500) Common(DUT).wait(2) USB.disconnectUsb() PM.powerMeasure(sample=CONST.POWER.sample, mTime=180, Vout=CONST.POWER.Vout, delay=CONST.POWER.delay[180], caseName=TAG, tPath=CONST.POWER.tPath) USB.connectUsb() Common(DUT).unlockScreen()
def test_step(self): Common(DUT).startActivity("com.baidu.searchbox/.MainActivity") Common(DUT).clickByText("新闻") Common(DUT).wait(2) Common(DUT).nohupTest("PowerTestCases.jar", "testBaidu") USB.disconnectUsb() # Power.sampleResult(sPath="d:\powerResult", mTime=300, delay=180, caseName=TAG) PM.powerMeasure(sample=100, mTime=660, Vout=CONST.POWER.Vout, delay=CONST.POWER.delay[60], caseName=TAG, tPath=CONST.POWER.tPath) USB.connectUsb()
def test_step(self): Common(DUT).startActivity("com.gionee.softmanager/.MainActivity") Common(DUT).clickByText("垃圾清理") Common(DUT).clickByText("一键清理") Common(DUT).wait(5) Common(DUT).clickWhenExist(text="完成") Common(DUT).goHome(2) # result = Checkpoint(DUT).checkIfExist("检测点1",text="日历") # self.assertEqual(result, True) Common(DUT).lockScreen() USB.disconnectUsb() # Power.sampleResult(sPath="d:\powerResult", mTime=300, delay=CONST.POWER.delay[180], caseName=TAG) PM.powerMeasure(sample=100, mTime=180, Vout=CONST.POWER.Vout, delay=CONST.POWER.delay[180], caseName=TAG, tPath=CONST.POWER.tPath) USB.connectUsb() Common(DUT).unlockScreen()
def test_step(self): Common(DUT).startActivity( "com.tencent.mobileqq/.activity.SplashActivity") Common(DUT).clickById("com.tencent.mobileqq:id/icon", 0) if not Common(DUT).exists(text="按住说话"): Common(DUT).click(82, 1852) Common(DUT).nohupTest("PowerTestCases.jar", "testQQ") USB.disconnectUsb() PM.powerMeasure(sample=100, mTime=900, Vout=CONST.POWER.Vout, delay=CONST.POWER.delay[60], caseName=TAG, tPath=CONST.POWER.tPath) USB.connectUsb()
def test_step(self): Common(DUT).clickByText("阅读", screeScroll=True, direction="left_right") # Common(DUT).startActivity("com.chaozh.iReaderGionee/com.zhangyue.iReader.bookshelf.ui.ActivityBookShelf") Common(DUT).wait(5) Common(DUT).click(189, 704) Common(DUT).nohupTest("PowerTestCases.jar", "testReader") USB.disconnectUsb() # Power.sampleResult(sPath="d:\powerResult", mTime=300, delay=180, caseName=TAG) PM.powerMeasure(sample=100, mTime=600, Vout=CONST.POWER.Vout, delay=CONST.POWER.delay[60], caseName=TAG, tPath=CONST.POWER.tPath) USB.connectUsb()
def test_step(self): Common(DUT).startActivity( "com.android.music/.activity.MusicCenterActivity") Common(DUT).clickWhenExist(text="去听歌") Common(DUT).clickById("com.android.music:id/playbar_play") Common(DUT).clickWhenExist(text="知道了") Common(DUT).lockScreen() USB.disconnectUsb() # Power.sampleResult(sPath="d:\powerResult", mTime=300, delay=180, caseName=TAG) PM.powerMeasure(sample=100, mTime=1200, Vout=CONST.POWER.Vout, delay=CONST.POWER.delay[60], caseName=TAG, tPath=CONST.POWER.tPath) USB.connectUsb()
def test_step(self): Common(DUT).startActivity( "com.android.contacts/.activities.PeopleActivity") Common(DUT).clickByText("拨号") Common(DUT).nohupTest("PowerTestCases.jar", "testCall") USB.disconnectUsb() PM.powerMeasure(sample=100, mTime=520, Vout=CONST.POWER.Vout, delay=CONST.POWER.delay[60], caseName=TAG, tPath=CONST.POWER.tPath) USB.connectUsb() Common(DUT).unlockScreen() Common(DUT).clickWhenExist( resourceId="com.android.incallui:id/endButton")
def test_step(self): Common(DUT).startActivity( "com.android.music/.activity.MusicCenterActivity") Common(DUT).clickWhenExist(text="去听歌") Common(DUT).clickById("com.android.music:id/playbar_play") Common(DUT).clickWhenExist(text="知道了") for i in range(20): Common(DUT).volumeDown() Common(DUT).lockScreen() USB.disconnectUsb() PM.powerMeasure(sample=100, mTime=600, Vout=CONST.POWER.Vout, delay=CONST.POWER.delay[60], caseName=TAG, tPath=CONST.POWER.tPath) USB.connectUsb()
def test_step(self): Common(DUT).openQuicksetting() Common(DUT).clickByText("手电筒") Common(DUT).goHome() Common(DUT).lockScreen() USB.disconnectUsb() PM.powerMeasure(sample=100, mTime=180, Vout=CONST.POWER.Vout, delay=CONST.POWER.delay[180], caseName=TAG, tPath=CONST.POWER.tPath) USB.connectUsb() Common(DUT).unlockScreen() Common(DUT).goBack() Common(DUT).openQuicksetting() Common(DUT).clickByText("手电筒")
def test_step(self): Common(DUT).startActivity("com.gionee.softmanager/.MainActivity") Common(DUT).clickById("com.gionee.softmanager:id/img_actionbar_custom") Common(DUT).switchWighetByIndex("关闭", 6) Common(DUT).goBack() Common(DUT).clickByText("省电管理") Common(DUT).clickByText("普通模式") Common(DUT).lockScreen() Common(DUT).wait(5) USB.disconnectUsb() # Power.sampleResult(sPath="d:\powerResult", mTime=300, delay=CONST.POWER.delay[180], caseName=TAG) PM.powerMeasure(sample=100, mTime=180, Vout=CONST.POWER.Vout, delay=CONST.POWER.delay[180], caseName=TAG, tPath=CONST.POWER.tPath) USB.connectUsb() Common(DUT).unlockScreen()
def test_step(self): Common(DUT).startActivity("com.android.browser/.BrowserActivity") Common(DUT).clickWhenExist(text="继续") Common(DUT).clickByText("百度") Common(DUT).click(111,555) for i in range(5): Common(DUT).swipe(540, 1484, 540, 580, 40) Common(DUT).clickWhenExist(text="共享位置") time.sleep(1) Common(DUT).goBack(2) Common(DUT).clickByText("退出") # result = Checkpoint(DUT).checkIfExist("检测点1",text="日历") # self.assertEqual(result, True) Common(DUT).lockScreen() USB.disconnectUsb() # Power.sampleResult(sPath="d:\powerResult", mTime=300, delay=CONST.POWER.delay[180], caseName=TAG) PM.powerMeasure(sample=100, mTime=180, Vout=CONST.POWER.Vout, delay=CONST.POWER.delay[180], caseName=TAG, tPath=CONST.POWER.tPath) USB.connectUsb() Common(DUT).unlockScreen()
def test_step(self): Common(DUT).startActivity( "com.autonavi.minimap/com.autonavi.map.activity.NewMapActivity") Common(DUT).clickWhenExist(text="进入地图") Common(DUT).clickWhenExist(text="忽略") Common(DUT).clickById("com.autonavi.minimap:id/GpsButton") Common(DUT).wait(3) Common(DUT).goBackHome() Common(DUT).lockScreen() USB.disconnectUsb() # Power.sampleResult(sPath="d:\powerResult", mTime=300, delay=CONST.POWER.delay[180], caseName=TAG) PM.powerMeasure(sample=CONST.POWER.sample, mTime=180, Vout=CONST.POWER.Vout, delay=CONST.POWER.delay[180], caseName=TAG, tPath=CONST.POWER.tPath) USB.connectUsb() Common(DUT).unlockScreen()
def test_step(self): Common(DUT).clickByText("捕鱼达人3", screeScroll=True, direction="left_right") Common(DUT).wait(12) Common(DUT).click(960, 850) Common(DUT).wait(2) Common(DUT).click(1581, 852) Common(DUT).wait(5) Common(DUT).click(760, 754) Common(DUT).click(1638, 294) Common(DUT).nohupTest("PowerTestCases.jar", "testGame") USB.disconnectUsb() # Power.sampleResult(sPath="d:\powerResult", mTime=300, delay=180, caseName=TAG) PM.powerMeasure(sample=100, mTime=750, Vout=CONST.POWER.Vout, delay=CONST.POWER.delay[60], caseName=TAG, tPath=CONST.POWER.tPath) USB.connectUsb()