def generate_html_report(test_status, test_cases=[], countdown=True): common.mkdirs(os.path.join(env.RESULT_PATH, "result")) with open(os.path.join(env.RESULT_PATH, "result", "index.html"), "w") as f: f.write(html_source_header()) f.write(html_source_body(countdown=countdown)) f.write(html_source_table1(test_status)) f.write(html_source_table2()) f.write(html_source_test_cases(test_cases)) f.write(html_source_end_table()) f.write(html_source_version_info()) f.write(html_source_foot())
def save_screen_shot(image_name): image_path = os.path.join(env.RESULT_PATH, "result", "screenshots") common.mkdirs(image_path) env.threadlocal.BROWSER.save_screenshot( os.path.join(image_path, image_name))
def write_log(relative_path, log_message): log_path = os.path.join(env.RESULT_PATH, "result", relative_path) common.mkdirs(os.path.dirname(log_path)) with open(log_path, 'a') as f: f.write(log_message)
def save_screen_shot(image_name): image_path = os.path.join(env.RESULT_PATH, "result", "screenshots") common.mkdirs(image_path) env.threadlocal.BROWSER.save_screenshot(os.path.join(image_path, image_name))