Skip to content

Commit

Permalink
Added use_lxml=True to the XML library. This should resolve problem w…
Browse files Browse the repository at this point in the history
…ith failing test case.

Make super-Linter happy
  • Loading branch information
ArekKuczynski committed Nov 14, 2024
1 parent 15cc8fc commit cef0062
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 12 deletions.
1 change: 0 additions & 1 deletion Tests/Regression/Reporter/GUI_Bugs.robot
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
*** Settings ***
Resource GUI_Common.robot
Library XML use_lxml=True

Suite Setup Set Platform
Test Teardown Close GUI
Expand Down
2 changes: 1 addition & 1 deletion Tests/Regression/Reporter/GUI_Common.robot
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions Tests/Regression/Reporter/GUI_Features.robot
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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}
Expand All @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
5 changes: 1 addition & 4 deletions Tests/Regression/Reporter/read_docx.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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.
Expand All @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion Tests/Regression/Reporter/save_html_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit cef0062

Please sign in to comment.