def save_environment(self): infos = [] env_path = self.config.env_yaml_path apk_path = self.config.apk_path html_report_path = self.config.html_report_path app_activity = self.config.app_activity app_package = self.config.app_package for deviceName in self.devices: info = DeviceInfo(deviceName, "Android", ADB(deviceName).get_android_version()) infos.append(info) L.i('已连接的设备版本:' + ADB(deviceName).get_android_version()) env_info = EnvironmentInfo(self.appium_v, infos, apk_path, html_report_path, app_activity, app_package) with open(env_path, 'w') as f: yaml.dump(env_info, f, default_flow_style=False) L.i('保存环境配置 Path:' + env_path)
def save_environment(self): apk_path = self.config.apk_path pages_yaml_path = self.config.pages_yaml_path xml_report_path = self.config.xml_report_path html_report_path = self.config.html_report_path app_activity = self.config.app_activity app_package = self.config.app_package # devices infos = [] for deviceName in self.devices: info = DeviceInfo(deviceName, "Android", ADB(deviceName).get_android_version()) infos.append(info) env_info = EnvironmentInfo(self.appium_v, infos, apk_path, pages_yaml_path, xml_report_path, html_report_path, app_activity, app_package) self.env_info = env_info
def save_environment(self): infos = [] env_path = self.config.env_yaml_path apk_path = self.config.apk_path pages_yaml_path = self.config.pages_yaml_path strTime = datetime.datetime.now().strftime('%Y-%m-%d-%H-%M-%S') xml_report_path = self.config.xml_report_path + "_" + strTime html_report_path = self.config.html_report_path + "_" + strTime app_activity = self.config.app_activity app_package = self.config.app_package for deviceName in self.devices: info = DeviceInfo(deviceName, "Android", ADB(deviceName).get_android_version()) infos.append(info) env_info = EnvironmentInfo(self.appium_v, infos, apk_path, pages_yaml_path, xml_report_path, html_report_path, app_activity, app_package) with open(env_path, 'w') as f: yaml.dump(env_info, f, default_flow_style=False) L.i('保存环境配置 Path:' + env_path)