(
report_log_path,
page_results_list,
successes,
failures,
browser_type,
show_report,
)
| 202 | |
| 203 | |
| 204 | def build_report( |
| 205 | report_log_path, |
| 206 | page_results_list, |
| 207 | successes, |
| 208 | failures, |
| 209 | browser_type, |
| 210 | show_report, |
| 211 | ): |
| 212 | |
| 213 | web_log_path = "file://%s" % report_log_path |
| 214 | successes_count = len(successes) |
| 215 | failures_count = len(failures) |
| 216 | total_test_count = successes_count + failures_count |
| 217 | |
| 218 | tf_color = "#11BB11" |
| 219 | if failures_count > 0: |
| 220 | tf_color = "#EE3A3A" |
| 221 | |
| 222 | summary_table = """<div><table><thead><tr> |
| 223 | <th>TESTING SUMMARY</th> |
| 224 | <th> </th> |
| 225 | </tr></thead><tbody> |
| 226 | <tr style="color:#00BB00"><td>TESTS PASSING: <td>%s</tr> |
| 227 | <tr style="color:%s" ><td>TESTS FAILING: <td>%s</tr> |
| 228 | <tr style="color:#4D4DDD"><td>TOTAL TESTS: <td>%s</tr> |
| 229 | </tbody></table>""" % ( |
| 230 | successes_count, |
| 231 | tf_color, |
| 232 | failures_count, |
| 233 | total_test_count, |
| 234 | ) |
| 235 | |
| 236 | summary_table = ( |
| 237 | """<h1 id="ContextHeader" class="sectionHeader" title=""> |
| 238 | %s</h1>""" |
| 239 | % summary_table |
| 240 | ) |
| 241 | |
| 242 | log_link_shown = os.path.join( |
| 243 | "..", "%s%s" % (ARCHIVE_DIR, web_log_path.split(ARCHIVE_DIR)[1]) |
| 244 | ) |
| 245 | csv_link = os.path.join(web_log_path, RESULTS_TABLE) |
| 246 | csv_link_shown = "%s" % RESULTS_TABLE |
| 247 | log_table = """<p><p><p><p><h2><table><tbody> |
| 248 | <tr><td>LOG FILES LINK: <td><a href="%s">%s</a></tr> |
| 249 | <tr><td>RESULTS TABLE: <td><a href="%s">%s</a></tr> |
| 250 | </tbody></table></h2><p><p><p><p>""" % ( |
| 251 | web_log_path, |
| 252 | log_link_shown, |
| 253 | csv_link, |
| 254 | csv_link_shown, |
| 255 | ) |
| 256 | |
| 257 | failure_table = "<h2><table><tbody></div>" |
| 258 | any_screenshots = False |
| 259 | for line in page_results_list: |
| 260 | line = line.split(",") |
| 261 | if line[1] == '"FAILED!"': |
nothing calls this directly
no test coverage detected
searching dependent graphs…