Truncate long display urls

This commit is contained in:
Michael Mintz 2016-05-15 14:48:43 -04:00
parent 8f223d88ac
commit 260e6af44d
1 changed files with 5 additions and 2 deletions

View File

@ -167,17 +167,20 @@ def build_report(report_log_path, page_results_list,
if not any_screenshots:
any_screenshots = True
failure_table += '''<thead><tr>
<th>FAILURE DATA&nbsp;&nbsp;</th>
<th>STACKTRACE&nbsp;&nbsp;</th>
<th>SCREENSHOT&nbsp;&nbsp;</th>
<th>LOCATION OF FAILURE</th>
</tr></thead>'''
display_url = line[4]
if len(display_url) > 60:
display_url = display_url[0:58] + '...'
line = '<a href="%s">%s</a>' % (
"file://" + report_log_path + '/' + line[2], line[2]) + '''
&nbsp;&nbsp;
''' + '<td><a href="%s">%s</a>' % (
"file://" + report_log_path + '/' + line[3], line[3]) + '''
&nbsp;&nbsp;
''' + '<td><a href="%s">%s</a>' % (line[4], line[4])
''' + '<td><a href="%s">%s</a>' % (line[4], display_url)
line = line.replace('"', '')
failure_table += '<tr><td>%s</tr>\n' % line
failure_table += '</tbody></table></h2>'