def gen_table_tag(statis): str_style = gen_table_style() tat_style = html.style(str_style, type='text/css') # print(tat_style) list_tag_row = list() list_head = ['Module', 'Total Tests', 'Passed', 'Failed', 'Pass Rate'] list_tag_row.append(html.tr([html.th(item) for item in list_head])) for key, value in statis.items(): list_stat = list() list_stat.append(key) list_stat.extend([v for v in value.values()]) list_tag_col = list() for idx, item in enumerate(list_stat): if idx in [1, 2, 3]: list_tag_col.append(html.td(html.a(item, href="#results-table"))) else: list_tag_col.append(html.td(item)) list_tag_row.append(list_tag_col) # list_tag_row.append(html.tr([html.td(item) for item in list_stat])) tag_table = html.table([html.tr(item) for item in list_tag_row], class_='gridtable') return [tat_style, tag_table]
def pytest_html_results_table_row(report, cells): '''添加列信息的值''' cells.insert(2, html.td(report.module)) cells.insert(3, html.td(report.description)) report_time = time.strftime("%Y-%m-%d-%H_%M_%S", time.localtime(time.time())) cells.insert(4, html.td(report_time, class_='col-time')) cells.pop()
def pytest_html_results_table_row(report, cells): # 添加用例描述 cells.insert(2, html.td(report.description)) # 添加时间 # cells.insert(1, html.td(datetime.utcnow(), class_='col-time')) # 删除最后links列的内容 cells.pop()
def pytest_html_results_table_row(report, cells): """ :param report: html report :param cells: report table cells :return: adds datetime utc time to the third column """ cells.insert(3, html.td(datetime.now(), class_='col-time')) cells.pop()
def pytest_html_results_table_row(report, cells): cells.pop(1) cells.insert(1, html.td(report.test_area)) cells.insert(2, html.td(report.test_name)) cells.insert(3, html.td(' '.join(report.test_markers))) cells.insert(4, html.td(report.user_properties[0], class_='col-timestamp')) cells.insert(5, html.td(report.start, class_='col-timestamp')) cells.insert(6, html.td(report.stop, class_='col-timestamp')) cells.pop()
def pytest_html_results_table_row(report, cells): '''修改report.html中的results-table行部分''' cells.insert(2, html.td(report.description)) cells.insert(3, html.td(datetime.utcnow(), class_='col-time')) cells.pop()
def pytest_html_results_table_row(report, cells): cells.insert(1, html.td(report.template_description)) cells.insert(2, html.td(report.test_type)) cells.insert(3, html.td(report.disease_category)) cells.insert(4, html.td(report.question_type)) cells.pop()
def pytest_html_results_table_row(report, cells): try: cells.insert(1, html.td(report.description)) except: pass
def pytest_html_results_table_row(report, cells): cells.insert(1, html.td(report.description)) cells.pop(-1) # 删除link列
def pytest_html_results_table_row(report, cells): cells.insert(2, html.td(report.description)) cells.insert( 1, html.td(time.strftime("%Y-%m-%d %H-%M-%S", time.localtime()), class_='col-time'))
def pytest_html_results_table_row(report, cells): '''Description列添加详情和Test_nodeid列添加详情,删除原有的Test列''' cells.insert(1, html.td(report.description)) cells.insert(2, html.td(report.nodeid)) cells.pop(2)
def pytest_html_results_table_row(report, cells): cells.insert(3, html.td(datetime.now(), class_='col-time')) cells.pop()
def pytest_html_results_table_row(report, cells): cells.insert(2, html.td(report.fulltime)) cells.insert(3, html.td(report.inctime)) cells.insert(4, html.td(report.description)) cells.pop() cells.pop()
def pytest_html_results_table_row(report, cells): cells.insert(1, html.td(report.description)) cells.insert(2, html.td(report.nodeid)) cells.pop(2) cells.pop() # modify by linuxchao at 2018.0803 delete link for report
def pytest_html_results_table_row(report, cells): cells.insert(2, html.td(report.description)) cells.insert(1, html.td(datetime.now().replace(microsecond=0), class_='col-time')) cells.pop() cells.pop(2)
def pytest_html_results_table_row(report, cells): cells.insert(1, html.td(report.description)) cells.insert(2, html.td(report.nodeid)) cells.pop(2)
def pytest_html_results_table_row(report, cells): cells.insert(2, html.td(report)) cells.insert(1, html.td(datetime.utcnow(), class_="col-time")) cells.pop()
def pytest_html_results_table_row(report, cells): #cells.insert(2, html.td(report.description)) cells.insert(3, html.td(datetime.utcnow(), class_='col-time')) # cells.insert(1,html.td(report.nodeid)) cells.pop()
def pytest_html_results_table_row(report, cells): cells.insert(2, html.td(report.description)) # 描述value的填写 cells.insert(4, html.td(datetime.now(), class_='col-time')) # 时间value的填写 cells.pop() # 删除link值一列 print(type(report), report)