diff --git a/flybirds/core/plugin/plugins/default/screen_record.py b/flybirds/core/plugin/plugins/default/screen_record.py index 4cb9fa70..bd2a367c 100644 --- a/flybirds/core/plugin/plugins/default/screen_record.py +++ b/flybirds/core/plugin/plugins/default/screen_record.py @@ -100,6 +100,7 @@ def start_record(self, timeout, bit_rate_level=1, bit_rate=None): if bit_rate_level > 5: bit_rate_level = 5 if self.use_airtest_record: + self.reset() if not bit_rate: screen_size = gr.get_device_size() bit_rate = screen_size[0] * screen_size[1] * bit_rate_level diff --git a/flybirds/report/json_format_deal.py b/flybirds/report/json_format_deal.py index 048623cd..b14f1699 100644 --- a/flybirds/report/json_format_deal.py +++ b/flybirds/report/json_format_deal.py @@ -49,8 +49,8 @@ def parse_json_data(report_dir, rerun_report_dir=None, is_parallel=False): for feature in report_json: parse_feature(feature, rerun_report_dir) if ( - isinstance(feature["elements"], list) - and len(feature["elements"]) > 0 + isinstance(feature.get("elements"), list) + and len(feature.get("elements")) > 0 ): if is_parallel and feature.get('metadata') is None: browser_name = file_item.split('.')[1] @@ -78,9 +78,9 @@ def parse_feature(feature, rerun_report_dir): """ parse feature: exclude the data with status=rerun """ - if isinstance(feature["elements"], list): + if isinstance(feature.get("elements"), list): cur_scenarios = [] - for scenario in feature["elements"]: + for scenario in feature.get("elements"): if scenario["type"] == "background": continue if scenario["status"] == "rerun":