Convert HTML report to PDF in order to support GitHub
Resolves openbmc/openbmc-test-automation#371
Change-Id: I7df9d932a16f5196b03b87da6b1f6af53b850064
Signed-off-by: Sivas SRR <sivas.srr@in.ibm.com>
diff --git a/extended/full_suite_regression.robot b/extended/full_suite_regression.robot
index acbc2d8..b3105ad 100755
--- a/extended/full_suite_regression.robot
+++ b/extended/full_suite_regression.robot
@@ -45,6 +45,38 @@
Create Combined Report
[Documentation] Using output[?].xml and create combined log.html
+ [Tags] Create_Combined_Report
Run rebot --name ${OPENBMC_SYSTEMMODEL}CombinedReport ${RESULT_DIR_PATH}/output*.xml
- Move File log.html ${RESULT_DIR_PATH}/log${OPENBMC_SYSTEMMODEL}CombinedIterations${ITERATION}Report.html
+
+ ${combined_report_file}= Catenate SEPARATOR= ${RESULT_DIR_PATH}
+ ... /log${OPENBMC_SYSTEMMODEL}CombinedIterations ${ITERATION}Report.html
+ Copy File log.html ${combined_report_file}
+
+ Convert HTML To PDF ${combined_report_file}
+
+*** Keywords ***
+
+Convert HTML To PDF
+ [Documentation] Convert HTML to PDF in order to support GitHub
+ ... attachment.
+ [Arguments] ${combined_report_html_file_path}
+ # Description of arguments:
+ # combined_report_html_file_path Combined report file in HTML format.
+
+ Log To Console \n ${combined_report_html_file_path}
+ ${combined_report_pdf_file_path}=
+ ... Fetch From Left ${combined_report_html_file_path} .
+ # Compose combined_report_pdf_file_path.
+ ${combined_report_pdf_file_path}= Catenate SEPARATOR=
+ ... ${combined_report_pdf_file_path} .pdf
+ # wkhtmltopdf tool is to convert HTML to PDF
+ ${output}= Run which wkhtmltopdf
+ Should Not Be Empty ${output}
+ ... msg=wkhtmltopdf not installed, Install from http://wkhtmltopdf.org
+ ${output}=
+ ... Run wkhtmltopdf ./${combined_report_html_file_path} ./${combined_report_pdf_file_path}
+ Should Not Be Empty ${output}
+ OperatingSystem.File Should Exist ${combined_report_pdf_file_path}
+
+