# -*- coding: utf-8 -*- import json, io, sys sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8') d = json.load(open(r'e:\code\crm-backend-matt\.scratch\customer-e2e\demo-smoke-r2-result.json', encoding='utf-8')) print('ts:', d['ts'], '| all_pass:', d['all_pass']) print('console_errors:', len(d['console_errors']), 'page_errors:', len(d['page_errors'])) rs = d['results'] print('steps:', len(rs)) for i, r in enumerate(rs, 1): ok = 'PASS' if r['ok'] else 'FAIL' note = r.get('note') or '' print(str(i).rjust(2) + '. ' + ok + ' | ' + r['step'] + ((' | ' + note[:70]) if note else ''))