MCPcopy Create free account
hub / github.com/seleniumbase/SeleniumBase / build_report

Function build_report

seleniumbase/core/report_helper.py:204–340  ·  view source on GitHub ↗
(
    report_log_path,
    page_results_list,
    successes,
    failures,
    browser_type,
    show_report,
)

Source from the content-addressed store, hash-verified

202
203
204def 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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</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:&nbsp;&nbsp;<td><a href="%s">%s</a></tr>
249 <tr><td>RESULTS TABLE:&nbsp;&nbsp;<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!"':

Callers

nothing calls this directly

Calls 6

get_report_styleFunction · 0.90
get_driverFunction · 0.90
add_results_pageFunction · 0.85
getMethod · 0.45
sleepMethod · 0.45
quitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…