-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Test case for Issue #37 - Verify xlsx report content
- Loading branch information
Showing
84 changed files
with
793 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file modified
BIN
+152 Bytes
(100%)
Tests/Regression/Reporter/Images/file_method/macos_finder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+126 Bytes
(100%)
Tests/Regression/Reporter/Images/file_method/macos_launchpad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+13 Bytes
(100%)
Tests/Regression/Reporter/Images/file_method/reporter_ubuntu_label_starttime.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import os | ||
|
||
from openpyxl import load_workbook | ||
from openpyxl_image_loader import SheetImageLoader | ||
from pandas import read_excel | ||
|
||
|
||
def read_all_xlsx_sheets(xlsx_path: str) -> list: | ||
return load_workbook(xlsx_path, keep_links=False).sheetnames | ||
|
||
|
||
def read_all_xlsx_text_data(xlsx_path: str) -> list: | ||
""" | ||
Read all xlsx text data from all sheets. | ||
""" | ||
wb = load_workbook(xlsx_path, keep_links=False) | ||
|
||
xlsx_tables = [] | ||
for sheet in wb.sheetnames: | ||
sheet_content = read_xlsx_text_data_from_sheet(xlsx_path, sheet) | ||
xlsx_tables.append(sheet_content) | ||
|
||
print(xlsx_tables) | ||
return xlsx_tables | ||
|
||
|
||
def read_xlsx_text_data_from_sheet(xlsx_path: str, sheet_name: str) -> list: | ||
""" | ||
Read xlsx text data from given xlsx sheet. | ||
""" | ||
all_excel_data_frame = read_excel(xlsx_path, sheet_name, keep_default_na=False, na_values=['NaN']) | ||
excel_data_list = all_excel_data_frame.values.tolist() | ||
|
||
for row_n in range(len(excel_data_list) - 1, -1, -1): | ||
for cell_n in range(len(excel_data_list[row_n]) - 1, -1, -1): | ||
if excel_data_list[row_n][cell_n] == "": | ||
excel_data_list[row_n].pop(cell_n) | ||
|
||
if len(excel_data_list[row_n]) == 0: | ||
excel_data_list.pop(row_n) | ||
|
||
return excel_data_list | ||
|
||
|
||
def extract_image_from_xlsx_sheet(xlsx_path: str, xlsx_sheet: str, cell_id: str, output_folder: str, show_image: bool = False): | ||
""" | ||
Extract an image from XLSX file from a given cell in specified sheet. | ||
Returns name of the saved image. | ||
""" | ||
wb = load_workbook(xlsx_path, keep_links=False) | ||
sheet = wb[xlsx_sheet] | ||
try: | ||
image_loader = SheetImageLoader(sheet) | ||
except Exception as e: | ||
raise AssertionError("Error in SheetImageLoader:", e) | ||
try: | ||
image = image_loader.get(cell_id) | ||
except Exception as e: | ||
print(f"Cell {cell_id} doesn't contain an image. Exception: {e}") | ||
return 0 | ||
if show_image: | ||
image.show() | ||
img_name = (xlsx_sheet + "_" + cell_id + "_image.png").replace(" ", "_") | ||
|
||
if not os.path.exists(output_folder): | ||
os.makedirs(output_folder) | ||
|
||
image.save(os.path.join(output_folder, img_name)) | ||
print(f"XLSX RFSwarm raport image saved as: {img_name}") | ||
|
||
return img_name |
Binary file added
BIN
+2.54 KB
...testdata/Issue-#37/xlsx_images/10_Data_Graph_Left_Result_Total_TPS_B3_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.4 KB
...Reporter/testdata/Issue-#37/xlsx_images/11_Data_Graph_Right_Metric_B3_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.63 KB
...Reporter/testdata/Issue-#37/xlsx_images/12_Data_Graph_Right_Result_B3_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.7 KB
.../Reporter/testdata/Issue-#37/xlsx_images/13_Data_Graph_LR_Combined_B3_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.21 KB
...ession/Reporter/testdata/Issue-#37/xlsx_images/14_Data_Graph_ST_ET_B3_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+31 KB
...gression/Reporter/testdata/Issue-#37/xlsx_images/22_Error_Details_B11_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+89 KB
...gression/Reporter/testdata/Issue-#37/xlsx_images/22_Error_Details_B14_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+71 KB
...gression/Reporter/testdata/Issue-#37/xlsx_images/22_Error_Details_B17_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+179 KB
...gression/Reporter/testdata/Issue-#37/xlsx_images/22_Error_Details_B20_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+179 KB
...gression/Reporter/testdata/Issue-#37/xlsx_images/22_Error_Details_B23_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+89.7 KB
...gression/Reporter/testdata/Issue-#37/xlsx_images/22_Error_Details_B26_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+89.7 KB
...gression/Reporter/testdata/Issue-#37/xlsx_images/22_Error_Details_B29_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+95 KB
...gression/Reporter/testdata/Issue-#37/xlsx_images/22_Error_Details_B32_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+95 KB
...gression/Reporter/testdata/Issue-#37/xlsx_images/22_Error_Details_B35_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+68.7 KB
...egression/Reporter/testdata/Issue-#37/xlsx_images/22_Error_Details_B5_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+35.2 KB
...egression/Reporter/testdata/Issue-#37/xlsx_images/22_Error_Details_B8_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+31 KB
...er/testdata/Issue-#37/xlsx_images/23_Error_Details_No_Screenshots_B11_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+89 KB
...er/testdata/Issue-#37/xlsx_images/23_Error_Details_No_Screenshots_B14_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+71 KB
...er/testdata/Issue-#37/xlsx_images/23_Error_Details_No_Screenshots_B17_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+179 KB
...er/testdata/Issue-#37/xlsx_images/23_Error_Details_No_Screenshots_B20_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+179 KB
...er/testdata/Issue-#37/xlsx_images/23_Error_Details_No_Screenshots_B23_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+68.7 KB
...ter/testdata/Issue-#37/xlsx_images/23_Error_Details_No_Screenshots_B5_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+35.2 KB
...ter/testdata/Issue-#37/xlsx_images/23_Error_Details_No_Screenshots_B8_image.png
Oops, something went wrong.
Binary file added
BIN
+89.7 KB
.../Reporter/testdata/Issue-#37/xlsx_images/24_Error_Details_No_GBRN_B10_image.png
Oops, something went wrong.
Binary file added
BIN
+68.7 KB
...n/Reporter/testdata/Issue-#37/xlsx_images/24_Error_Details_No_GBRN_B4_image.png
Oops, something went wrong.
Binary file added
BIN
+71 KB
...n/Reporter/testdata/Issue-#37/xlsx_images/24_Error_Details_No_GBRN_B6_image.png
Oops, something went wrong.
Binary file added
BIN
+179 KB
...n/Reporter/testdata/Issue-#37/xlsx_images/24_Error_Details_No_GBRN_B8_image.png
Oops, something went wrong.
Binary file added
BIN
+89.7 KB
.../Reporter/testdata/Issue-#37/xlsx_images/25_Error_Details_No_GBET_B10_image.png
Oops, something went wrong.
Binary file added
BIN
+67 KB
.../Reporter/testdata/Issue-#37/xlsx_images/25_Error_Details_No_GBET_B11_image.png
Oops, something went wrong.
Binary file added
BIN
+35.2 KB
.../Reporter/testdata/Issue-#37/xlsx_images/25_Error_Details_No_GBET_B14_image.png
Oops, something went wrong.
Binary file added
BIN
+35.2 KB
.../Reporter/testdata/Issue-#37/xlsx_images/25_Error_Details_No_GBET_B16_image.png
Oops, something went wrong.
Binary file added
BIN
+10.6 KB
.../Reporter/testdata/Issue-#37/xlsx_images/25_Error_Details_No_GBET_B18_image.png
Oops, something went wrong.
Binary file added
BIN
+31 KB
.../Reporter/testdata/Issue-#37/xlsx_images/25_Error_Details_No_GBET_B21_image.png
Oops, something went wrong.
Binary file added
BIN
+31.2 KB
.../Reporter/testdata/Issue-#37/xlsx_images/25_Error_Details_No_GBET_B23_image.png
Oops, something went wrong.
Binary file added
BIN
+31.1 KB
.../Reporter/testdata/Issue-#37/xlsx_images/25_Error_Details_No_GBET_B25_image.png
Oops, something went wrong.
Binary file added
BIN
+89.7 KB
.../Reporter/testdata/Issue-#37/xlsx_images/25_Error_Details_No_GBET_B26_image.png
Oops, something went wrong.
Binary file added
BIN
+89 KB
.../Reporter/testdata/Issue-#37/xlsx_images/25_Error_Details_No_GBET_B28_image.png
Oops, something went wrong.
Binary file added
BIN
+89.7 KB
.../Reporter/testdata/Issue-#37/xlsx_images/25_Error_Details_No_GBET_B29_image.png
Oops, something went wrong.
Binary file added
BIN
+73.8 KB
.../Reporter/testdata/Issue-#37/xlsx_images/25_Error_Details_No_GBET_B30_image.png
Oops, something went wrong.
Binary file added
BIN
+95 KB
.../Reporter/testdata/Issue-#37/xlsx_images/25_Error_Details_No_GBET_B32_image.png
Oops, something went wrong.
Binary file added
BIN
+71 KB
.../Reporter/testdata/Issue-#37/xlsx_images/25_Error_Details_No_GBET_B33_image.png
Oops, something went wrong.
Binary file added
BIN
+95 KB
.../Reporter/testdata/Issue-#37/xlsx_images/25_Error_Details_No_GBET_B35_image.png
Oops, something went wrong.
Binary file added
BIN
+179 KB
.../Reporter/testdata/Issue-#37/xlsx_images/25_Error_Details_No_GBET_B36_image.png
Oops, something went wrong.
Binary file added
BIN
+179 KB
.../Reporter/testdata/Issue-#37/xlsx_images/25_Error_Details_No_GBET_B39_image.png
Oops, something went wrong.
Binary file added
BIN
+89.7 KB
.../Reporter/testdata/Issue-#37/xlsx_images/25_Error_Details_No_GBET_B42_image.png
Oops, something went wrong.
Binary file added
BIN
+89.7 KB
.../Reporter/testdata/Issue-#37/xlsx_images/25_Error_Details_No_GBET_B45_image.png
Oops, something went wrong.
Binary file added
BIN
+95 KB
.../Reporter/testdata/Issue-#37/xlsx_images/25_Error_Details_No_GBET_B48_image.png
Oops, something went wrong.
Binary file added
BIN
+68.7 KB
...n/Reporter/testdata/Issue-#37/xlsx_images/25_Error_Details_No_GBET_B4_image.png
Oops, something went wrong.
Binary file added
BIN
+95 KB
.../Reporter/testdata/Issue-#37/xlsx_images/25_Error_Details_No_GBET_B51_image.png
Oops, something went wrong.
Binary file added
BIN
+68.7 KB
...n/Reporter/testdata/Issue-#37/xlsx_images/25_Error_Details_No_GBET_B5_image.png
Oops, something went wrong.
Binary file added
BIN
+71 KB
...n/Reporter/testdata/Issue-#37/xlsx_images/25_Error_Details_No_GBET_B6_image.png
Oops, something went wrong.
Binary file added
BIN
+146 KB
...n/Reporter/testdata/Issue-#37/xlsx_images/25_Error_Details_No_GBET_B7_image.png
Oops, something went wrong.
Binary file added
BIN
+179 KB
...n/Reporter/testdata/Issue-#37/xlsx_images/25_Error_Details_No_GBET_B8_image.png
Oops, something went wrong.
Binary file added
BIN
+68.8 KB
...n/Reporter/testdata/Issue-#37/xlsx_images/25_Error_Details_No_GBET_B9_image.png
Oops, something went wrong.
Binary file added
BIN
+67 KB
...orter/testdata/Issue-#37/xlsx_images/26_Error_Details_Polish_Lang_B11_image.png
Oops, something went wrong.
Binary file added
BIN
+35.2 KB
...orter/testdata/Issue-#37/xlsx_images/26_Error_Details_Polish_Lang_B14_image.png
Oops, something went wrong.
Binary file added
BIN
+35.2 KB
...orter/testdata/Issue-#37/xlsx_images/26_Error_Details_Polish_Lang_B16_image.png
Oops, something went wrong.
Binary file added
BIN
+10.6 KB
...orter/testdata/Issue-#37/xlsx_images/26_Error_Details_Polish_Lang_B18_image.png
Oops, something went wrong.
Binary file added
BIN
+31 KB
...orter/testdata/Issue-#37/xlsx_images/26_Error_Details_Polish_Lang_B21_image.png
Oops, something went wrong.
Binary file added
BIN
+31.2 KB
...orter/testdata/Issue-#37/xlsx_images/26_Error_Details_Polish_Lang_B23_image.png
Oops, something went wrong.
Binary file added
BIN
+31.1 KB
...orter/testdata/Issue-#37/xlsx_images/26_Error_Details_Polish_Lang_B25_image.png
Oops, something went wrong.
Binary file added
BIN
+89 KB
...orter/testdata/Issue-#37/xlsx_images/26_Error_Details_Polish_Lang_B28_image.png
Oops, something went wrong.
Binary file added
BIN
+73.8 KB
...orter/testdata/Issue-#37/xlsx_images/26_Error_Details_Polish_Lang_B30_image.png
Oops, something went wrong.
Binary file added
BIN
+71 KB
...orter/testdata/Issue-#37/xlsx_images/26_Error_Details_Polish_Lang_B33_image.png
Oops, something went wrong.
Binary file added
BIN
+179 KB
...orter/testdata/Issue-#37/xlsx_images/26_Error_Details_Polish_Lang_B36_image.png
Oops, something went wrong.
Binary file added
BIN
+179 KB
...orter/testdata/Issue-#37/xlsx_images/26_Error_Details_Polish_Lang_B39_image.png
Oops, something went wrong.
Binary file added
BIN
+68.7 KB
...porter/testdata/Issue-#37/xlsx_images/26_Error_Details_Polish_Lang_B5_image.png
Oops, something went wrong.
Binary file added
BIN
+146 KB
...porter/testdata/Issue-#37/xlsx_images/26_Error_Details_Polish_Lang_B7_image.png
Oops, something went wrong.
Binary file added
BIN
+68.8 KB
...porter/testdata/Issue-#37/xlsx_images/26_Error_Details_Polish_Lang_B9_image.png
Oops, something went wrong.
Binary file added
BIN
+71 KB
...on/Reporter/testdata/Issue-#37/xlsx_images/27_Error_Details_ST_ET_B11_image.png
Oops, something went wrong.
Binary file added
BIN
+146 KB
...ion/Reporter/testdata/Issue-#37/xlsx_images/27_Error_Details_ST_ET_B5_image.png
Oops, something went wrong.
Binary file added
BIN
+89 KB
...ion/Reporter/testdata/Issue-#37/xlsx_images/27_Error_Details_ST_ET_B8_image.png
Oops, something went wrong.
Binary file added
BIN
+1.19 KB
...n/Reporter/testdata/Issue-#37/xlsx_images/6_Data_Graph_Left_Metric_B3_image.png
Oops, something went wrong.
Binary file added
BIN
+3.69 KB
...n/Reporter/testdata/Issue-#37/xlsx_images/7_Data_Graph_Left_Result_B3_image.png
Oops, something went wrong.
Binary file added
BIN
+1.55 KB
...orter/testdata/Issue-#37/xlsx_images/8_Data_Graph_Left_Result_FAIL_B3_image.png
Oops, something went wrong.
Binary file added
BIN
+2.4 KB
...porter/testdata/Issue-#37/xlsx_images/9_Data_Graph_Left_Result_TPS_B3_image.png
Oops, something went wrong.