def tear_down(self, casename): downTime = datetime.datetime.now().strftime('%Y-%m-%d') # 现在 time = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') self.d.screenshot(self.path + "image\\music\\"+casename+downTime+".jpg") adb.get_meminfo(self.d ) adb.get_battery(self.d ) adb.get_cpuinfo(self.d ) self.music.stop() print(casename) return time
def set_up(self, casename): print(casename) self.d.screen_on() if self.d(resourceId="com.android.systemui:id/emergency_call_button"): self.d.unlock() self.music.stop() self.d.app_stop_all() self.music.start() self.d.screen_on() adb.get_meminfo(self.d) adb.get_battery(self.d) adb.get_cpuinfo(self.d) startTime = datetime.datetime.now().strftime('%Y-%m-%d') # 现在 time = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') self.d.screenshot(self.path + "image\\music\\"+casename+startTime+".jpg") return time
def set_up(self, casename): print(casename) self.d.screen_on() # 判断是否锁屏状态 if self.d(resourceId="com.android.systemui:id/emergency_call_button"): self.d.unlock() # 停止并启动设置 self.setting.stop() self.setting.start() self.setting.list_wlan() # 获取设置的内存、cpu等信息 adb.get_meminfo(self.d) adb.get_battery(self.d) adb.get_cpuinfo(self.d) # 获取当前时间,并保存测试开始前的截图 nowTime = datetime.datetime.now().strftime('%Y-%m-%d') # 现在 time = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') self.d.screenshot(self.path + "image\\setting\\"+casename + nowTime+".jpg") return time