def testRebootWhileUpgrade(self): """乐米游戏,升级乐米apk过程中重启电视|升级乐米过程中重启电视""" #uninstall the current version self.installOlderApk() self.jar = "LeMiAutoTest.jar" #self.jar = "UiAutomator.jar" self.case1 = "com.letv.lemi.RebootWhileUpgrade#testRebootWhileUpgrade" self.case2 = "com.letv.lemi.LeMiGame#testOpenApk" try: ua1 = Stability.UiAutomator(self.id, self.jar, self.case1) result1, info1 = ua1.runtest() if result1 != 'PASS': self.error = str(info1) raise Exception self.rebootDevice() time.sleep(180) if not self.connect(): self.error = 'failed to reboot device' raise Exception ua2 = Stability.UiAutomator(self.id, self.jar, self.case2) result2, info2 = ua2.runtest() if result2 != 'PASS': self.error = str(info2) raise Exception except Exception, e: self.a.log.debug("", "\n testUpgrade") self.fail("Error happened: %s %s" % (self.error, e))