Skip to content

Commit

Permalink
Merge pull request #153 from ctripcorp/main_fix_report
Browse files Browse the repository at this point in the history
fix report step and add record clear
  • Loading branch information
clgwlg authored Feb 2, 2023
2 parents baf1dff + 8af3d6a commit 190e9f5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions flybirds/core/plugin/plugins/default/screen_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions flybirds/report/json_format_deal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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":
Expand Down

0 comments on commit 190e9f5

Please sign in to comment.