From cef0062fc7058110deaf6c28cc9e23c270665733 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Kuczy=C5=84ski?= Date: Thu, 14 Nov 2024 22:25:44 +0100 Subject: [PATCH] Added use_lxml=True to the XML library. This should resolve problem with failing test case. Make super-Linter happy --- Tests/Regression/Reporter/GUI_Bugs.robot | 1 - Tests/Regression/Reporter/GUI_Common.robot | 2 +- Tests/Regression/Reporter/GUI_Features.robot | 10 +++++----- Tests/Regression/Reporter/read_docx.py | 5 +---- Tests/Regression/Reporter/save_html_image.py | 2 +- 5 files changed, 8 insertions(+), 12 deletions(-) diff --git a/Tests/Regression/Reporter/GUI_Bugs.robot b/Tests/Regression/Reporter/GUI_Bugs.robot index 3dd147897..1f1d8e623 100644 --- a/Tests/Regression/Reporter/GUI_Bugs.robot +++ b/Tests/Regression/Reporter/GUI_Bugs.robot @@ -1,6 +1,5 @@ *** Settings *** Resource GUI_Common.robot -Library XML use_lxml=True Suite Setup Set Platform Test Teardown Close GUI diff --git a/Tests/Regression/Reporter/GUI_Common.robot b/Tests/Regression/Reporter/GUI_Common.robot index fd41708b8..efa984e0b 100644 --- a/Tests/Regression/Reporter/GUI_Common.robot +++ b/Tests/Regression/Reporter/GUI_Common.robot @@ -4,7 +4,7 @@ Library Process Library String Library Collections Library DocTest.VisualTest -Library XML +Library XML use_lxml=True Library ImageHorizonLibrary reference_folder=${IMAGE_DIR} Library OCRLibrary diff --git a/Tests/Regression/Reporter/GUI_Features.robot b/Tests/Regression/Reporter/GUI_Features.robot index f8933eada..811ef0372 100644 --- a/Tests/Regression/Reporter/GUI_Features.robot +++ b/Tests/Regression/Reporter/GUI_Features.robot @@ -214,7 +214,7 @@ Verify the Content Of the HTML Report # Contents: - Log Verifying Contents: console=${True} + Log \nVerifying Contents: console=${True} VAR ${section} Contents contents ${section_obj} Get HTML Report Heading Section Object ${html} ${section} Should Not Be Equal ${section_obj} ${0} msg=Didn't find "${section}" section. @@ -232,7 +232,7 @@ Verify the Content Of the HTML Report # Notes: - Log Verifying Notes: console=${True} + Log \nVerifying Notes: console=${True} VAR ${section} Note VAR ${break_at} h2 ${section_obj} Get HTML Report Heading Section Object ${html} ${section} @@ -252,7 +252,7 @@ Verify the Content Of the HTML Report # Graphs - when new graphs are required, save them using the function in save_html_image.py! - Log Verifying Graphs: console=${True} + Log \nVerifying Graphs: console=${True} VAR ${section} Data Graph Left Metric ${section_obj} Get HTML Report Heading Section Object ${html} ${section} Should Not Be Equal ${section_obj} ${0} msg=Didn't find "${section}" section. @@ -300,7 +300,7 @@ Verify the Content Of the HTML Report # Tables: - Log Verifying Tables: console=${True} + Log \nVerifying Tables: console=${True} VAR ${section} Data Table Metric ${section_obj} Get HTML Report Heading Section Object ${html} ${section} Should Not Be Equal ${section_obj} ${0} msg=Didn't find "${section}" section. @@ -338,7 +338,7 @@ Verify the Content Of the HTML Report # Error Details: - Log Verifying Error Details: console=${True} + Log \nVerifying Error Details: console=${True} VAR ${section} Error Details ${section_obj} Get HTML Report Heading Section Object ${html} ${section} Should Not Be Equal ${section_obj} ${0} msg=Didn't find "${section}" section. diff --git a/Tests/Regression/Reporter/read_docx.py b/Tests/Regression/Reporter/read_docx.py index 6cea2991c..cd62f998a 100644 --- a/Tests/Regression/Reporter/read_docx.py +++ b/Tests/Regression/Reporter/read_docx.py @@ -4,7 +4,6 @@ from docx import Document from docx.oxml.shared import OxmlElement, qn -from PIL import Image def read_paragraphs_docx_file(docx_path: str) -> dict: @@ -54,7 +53,7 @@ def update_table_of_contents(docx_path: str): doc.save(docx_path) -def extract_images_from_docx(docx_path: str, output_folder: str, black_and_wite=False) -> list: +def extract_images_from_docx(docx_path: str, output_folder: str) -> list: """ Extract all images from DOCX one by one. Returns list of the saved images. @@ -72,8 +71,6 @@ def extract_images_from_docx(docx_path: str, output_folder: str, black_and_wite= with open(os.path.join(output_folder, img_name), "wb") as img_file: img_file.write(img_data) - if black_and_wite: - convert_image_to_black_and_white(os.path.join(output_folder, img_name)) print(f"DOCX RFSwarm raport image saved as: {img_name}") saved_images.append(img_name) diff --git a/Tests/Regression/Reporter/save_html_image.py b/Tests/Regression/Reporter/save_html_image.py index 115885cfa..d26f328fc 100644 --- a/Tests/Regression/Reporter/save_html_image.py +++ b/Tests/Regression/Reporter/save_html_image.py @@ -8,7 +8,7 @@ def save_html_embeded_image(base64_string: str, img_name: str, output_folder: st if not os.path.exists(output_folder): os.makedirs(output_folder) - img_name = (img_name+"_image.png").replace(" ", "_") + img_name = (img_name + "_image.png").replace(" ", "_") file_name = os.path.join(output_folder, img_name) with open(file_name, 'wb') as file: