Beispiel #1
0
def save_session_summary():
    if GlobalConfig.OUTPUT_SUMMARY_LOG_DIR is not None and os.path.exists(GlobalConfig.OUTPUT_SUMMARY_LOG_DIR):
        session_log_json_dict = copy.deepcopy(session_log)
        session_log_json_dict.time_summary = vars(session_log.time_summary)
        session_log_json_dict.apk_summary = vars(session_log.apk_summary)
        session_log_json_dict.test_summary = vars(session_log.test_summary)
        session_log_json_dict.device_summaries = list()
        for device_name, device_summary in session_log.device_summaries.items():
            session_log_json_dict.device_summaries.append(vars(device_summary))
        session_log_json_dict = vars(session_log_json_dict)

        FileUtils.save_json_dict_to_json(GlobalConfig.OUTPUT_SUMMARY_LOG_DIR, session_log_json_dict, "session_summary")
Beispiel #2
0
    def run(self):
        self.created_files = list()

        for test_summary in self.test_summary_list:
            test_summary_json_dict = vars(test_summary)
            created_file_path = FileUtils.save_json_dict_to_json(
                GlobalConfig.OUTPUT_TEST_LOG_DIR, test_summary_json_dict,
                test_summary_json_dict["test_name"] + "_" +
                self.device.adb_name + "_" + self.TEST_SUMMARY_APPENDIX)
            self.created_files.append(created_file_path)
Beispiel #3
0
    def run(self):
        self.created_files = list()

        for logcat in self.test_logcat_list:
            logcat_lines_json_dict = list()
            for logcat_line in logcat.lines:
                logcat_lines_json_dict.append(vars(logcat_line))
            logcat.lines = logcat_lines_json_dict

            logcat_json_dict = vars(logcat)
            created_file_path = FileUtils.save_json_dict_to_json(
                GlobalConfig.OUTPUT_TEST_LOGCAT_DIR, logcat_json_dict,
                logcat_json_dict["test_name"] + "_" + self.device.adb_name +
                "_" + self.TEST_LOGCAT_APPENDIX)
            self.created_files.append(created_file_path)
Beispiel #4
0
    def run(self):
        self.created_files = list()

        for test_summary in self.test_summary_list:
            test_summary_json_dict = vars(test_summary)

            filename = test_summary_json_dict["test_name"] + "_" + self.device.adb_name + "_" \
                       + self.TEST_SUMMARY_APPENDIX

            if test_summary.rerun_count > 0:
                filename = filename.replace(".json", "_rerun_no_{}.json".format(test_summary.rerun_count))

            created_file_path = FileUtils.save_json_dict_to_json(
                GlobalConfig.OUTPUT_TEST_LOG_DIR, test_summary_json_dict, filename)

            self.created_files.append(created_file_path)
Beispiel #5
0
    def run(self):
        self.created_files = list()

        for logcat in self.test_logcat_list:
            logcat_lines_json_dict = list()
            for logcat_line in logcat.lines:
                logcat_lines_json_dict.append(vars(logcat_line))
            logcat.lines = logcat_lines_json_dict

            logcat_json_dict = vars(logcat)

            filename = logcat_json_dict["test_name"] + "_" + self.device.adb_name + "_" + self.TEST_LOGCAT_APPENDIX

            if logcat.rerun_count > 0:
                filename = filename.replace(".json", "_rerun_no_{}.json".format(logcat.rerun_count))

            created_file_path = FileUtils.save_json_dict_to_json(
                GlobalConfig.OUTPUT_TEST_LOGCAT_DIR, logcat_json_dict, filename)

            self.created_files.append(created_file_path)