lf_report.py: link to pdf results added

lf_qa.py : link to pdf results

Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
This commit is contained in:
Chuck SmileyRekiere
2021-08-09 08:57:00 -06:00
parent ab5300f521
commit ed396c1807
2 changed files with 11 additions and 0 deletions

View File

@@ -84,6 +84,7 @@ class lf_report():
self.csv_file_name="" self.csv_file_name=""
self.html = "" self.html = ""
self.custom_html = "" self.custom_html = ""
self.pdf_link_html = ""
self.objective = _obj self.objective = _obj
self.obj_title = _obj_title self.obj_title = _obj_title
#self.systeminfopath = "" #self.systeminfopath = ""
@@ -286,6 +287,15 @@ class lf_report():
self.write_output_pdf = "{}/{}-{}".format(self.path_date_time,self.date,self.output_pdf) self.write_output_pdf = "{}/{}-{}".format(self.path_date_time,self.date,self.output_pdf)
pdfkit.from_file(self.write_output_html, self.write_output_pdf, options=options) pdfkit.from_file(self.write_output_html, self.write_output_pdf, options=options)
def build_pdf_link(self):
pdf_link_path = "{}/{}-{}".format(self.path_date_time,self.date,self.output_pdf)
self.pdf_link_html = """
<!-- pdf link -->
<a href={pdf_link_path}>PDF_Report<a>
""".format(pdf_link_path=pdf_link_path)
self.html += self.pdf_link_html
def generate_report(self): def generate_report(self):
self.write_html() self.write_html()
self.write_pdf() self.write_pdf()

View File

@@ -336,6 +336,7 @@ Example: kpi_csv_sq.py --store --png --show --path <path to read kpi.csv> (read
report.start_content_div2() report.start_content_div2()
report.set_obj_html("Objective", "QA Verification") report.set_obj_html("Objective", "QA Verification")
report.build_objective() report.build_objective()
report.build_pdf_link()
report.set_table_title("QA Test Results") report.set_table_title("QA Test Results")
report.build_table_title() report.build_table_title()
# report.set_text("lanforge-scripts git sha: {}".format(git_sha)) # report.set_text("lanforge-scripts git sha: {}".format(git_sha))