BIMTester will now report unspecified tests with fancy colours

This commit is contained in:
Dion Moult
2020-07-27 18:37:05 +10:00
parent ab1f7337a5
commit 2837f75d50
2 changed files with 13 additions and 4 deletions
+9 -2
View File
@@ -92,15 +92,22 @@ def generate_report():
steps = []
total_duration = 0
for step in scenario['steps']:
total_duration += step['result']['duration']
if 'result' in step:
total_duration += step['result']['duration']
name = step['name']
if 'arguments' in step['match']:
if 'match' in step and 'arguments' in step['match']:
for a in step['match']['arguments']:
name = name.replace(a['value'], '<b>' + a['value'] + '</b>')
if 'result' not in step or step['result']['status'] == 'undefined':
step['result'] = {}
step['result']['status'] = 'undefined'
step['result']['duration'] = 0
step['result']['error_message'] = 'This requirement has not yet been specified.'
steps.append({
'name': name,
'time': round(step['result']['duration'], 2),
'is_success': step['result']['status'] == 'passed',
'is_unspecified': 'result' not in step or step['result']['status'] == 'undefined',
'error_message': None if step['result']['status'] == 'passed' else step['result']['error_message']
})
total_passes = len([s for s in steps if s['is_success'] == True])
+4 -2
View File
@@ -13,10 +13,12 @@
span.success { background-color: #97cc64; padding: 5px; border-radius: 5px; color: #FFF; font-weight: bold; }
span.failure { background-color: #fb5a3e; padding: 5px; border-radius: 5px; color: #FFF; font-weight: bold; }
p.failure { background-color: #fb5a3e; padding: 5px; border-radius: 5px; color: #fff; }
p.unspecified { background-color: #994f00; padding: 5px; border-radius: 5px; color: #fff; }
p.description { background-color: #eee; border-radius: 5px; padding: 20px; margin-left: auto; margin-right: auto; display: inline-block; font-weight: bold;}
li { padding: 10px; font-family: monospace; }
li.success { background-color: #b6cca1; color: #333; }
li.failure { background-color: #fbb4a8; color: #900; }
li.unspecified { background-color: #ffd37f; color: #a30; }
li p { margin-bottom: 0px; }
footer { color: #999; font-size: 0.8em; }
header { text-align: center; }
@@ -50,11 +52,11 @@
</p>
<ol>
{{#steps}}
<li class="{{#is_success}}success{{/is_success}}{{^is_success}}failure{{/is_success}}">
<li class="{{#is_success}}success{{/is_success}}{{^is_success}}failure{{/is_success}}{{#is_unspecified}} unspecified{{/is_unspecified}}">
{{{name}}}
<span class="step-time">{{time}}s</span>
{{^is_success}}
<p class="failure">
<p class="failure{{#is_unspecified}} unspecified{{/is_unspecified}}">
{{error_message}}
</p>
{{/is_success}}