def __get_cases_content_html(self, data): table = Tool().get_yaml('project.config.repore.table') new_titles = [] for k, v in table.items(): obj = {'name': k, 'text': v} new_titles.append(obj) return Template(Tool().open_file( os.path.dirname(__file__) + '/reportTpl/content.html')).render( datas=data, titles=new_titles)
def __get_cases_nav_html(self, data): cases = Tool().get_yaml('project.config.repore.cases') new_data = [] for k, v in cases.items(): obj = {'text': v} if k == 'all': obj['num'] = data['all_case_sum'] obj['bg'] = '#428bca' elif k == 'success': obj['num'] = data['success_case_sum'] obj['bg'] = '#3c763d' elif k == 'error': obj['num'] = data['errors_case_sum'] obj['bg'] = '#FF4000' else: obj['num'] = data['skipped_case_sum'] obj['bg'] = '#0099CC' new_data.append(obj) return Template(Tool().open_file( os.path.dirname(__file__) + '/reportTpl/nav.html')).render(datas=new_data)