Skip to content

Commit

Permalink
Improved almost every aspect of the test case for Issue damies13#38.
Browse files Browse the repository at this point in the history
Better checking tables in the docx report file
Added new template sections to test every major options for generating reporter reports
  • Loading branch information
ArekKuczynski committed Oct 3, 2024
1 parent c87d6c4 commit 41997e3
Show file tree
Hide file tree
Showing 68 changed files with 607 additions and 117 deletions.
395 changes: 324 additions & 71 deletions Tests/Regression/Reporter/GUI_Features.robot

Large diffs are not rendered by default.

17 changes: 13 additions & 4 deletions Tests/Regression/Reporter/read_docx.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from docx.oxml.shared import OxmlElement, qn


def read_docx_file(docx_path: str) -> dict:
"""Read docx file and return dictionary."""
def read_paragraphs_docx_file(docx_path: str) -> dict:
"""Read paragraphs docx file and return dictionary."""
doc = Document(docx_path)

doc_sections: dict = {}
Expand Down Expand Up @@ -56,7 +56,7 @@ def update_table_of_contents(docx_path: str):
def extract_images_from_docx(docx_path: str, output_folder: str) -> list:
"""
Extract all images from DOCX one by one.
Returns list of saved images.
Returns list of the saved images.
"""
doc = Document(docx_path)
saved_images = []
Expand Down Expand Up @@ -85,12 +85,21 @@ def extract_tables_from_docx(docx_path: str) -> list:
"""
doc = Document(docx_path)
tables = []
def iter_unique_row_cells(row):
"""Generate cells in given row skipping empty grid cells."""
last_cell_tc = None
for cell in row.cells:
this_cell_tc = cell._tc
if this_cell_tc is last_cell_tc:
continue
last_cell_tc = this_cell_tc
yield cell

for table in doc.tables:
table_data = []
for row in table.rows:
row_data = []
for i, cell in enumerate(row.cells):
for cell in iter_unique_row_cells(row):
row_data.append(cell.text)
table_data.append(row_data)
tables.append(table_data)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[Report]
order = FB633D007AE,FB633DDEB43,FB634BA09A3,FB634BC6F62,FB633E47CD4,FB63521E022,FB633EB6327,FB6A0B4C09D,FB6A07238B2,FB6A0ABC435,FB6352D21FA,FB634E5493F,FB63406A7EF,FB63574547B,FB6A11F3115,FB6A1256B53,FB63584F263,FB63411065A
order = FB633D007AE,FB633DDEB43,FB634BA09A3,FB634BC6F62,FB633E47CD4,FB63521E022,FB633EB6327,FB6A0B4C09D,FB6A07238B2,FB6A0ABC435,FB6352D21FA,FB634E5493F,FB7350079CD,FB63406A7EF,FB63574547B,FB6A11F3115,FB6A1256B53,FB63584F263,FB7350A2468,FB63411065A,FB7355B8E87,FB735654ABA,FB735667ABF,FB7356761CB
title = quickdemo
showtlogo = -1
dateformat = yyyy-mm-dd
Expand All @@ -17,15 +17,15 @@ percentile = 90
name = This is Heading
parent = TOP
type = head
changed = 1727797876.1072936
changed = 1727969922.8724022
note = Define your template by adding sections and configuring the section settingsx12Each section can be:x12 - Note (like this) section, free textx12 - Heading, usefull for grouping sectionsx12 - Contents like a table of contents or figuresx12 - Data Table, with data from test resultsx12 - Data Graph, for graphical representation of test resultsx12x12Each section can also have sub sectionsx12x12The cover page and overall report settings can be found on the settings pane of the Report item abovex12x12
order =

[FB633DDEB43]
name = Contents contents
parent = TOP
type = contents
changed = 1727797876.119307
changed = 1727969922.8839302
mode = Table Of Contents
level = 3
order =
Expand All @@ -34,15 +34,15 @@ order =
name = Note
parent = TOP
type = note
changed = 1727797876.1701474
changed = 1727969922.920805
note = Hello i am a simple and obvious note :-)x12This is just second line.x12 - first linex12 - second linex12 - third linex12
order = FB635F8AEAF

[FB633EB6327]
name = Data Graph Left Result
parent = TOP
type = graph
changed = 1727797876.2172208
changed = 1727969922.9747546

[FB633EB6327L]
resulttype = Response Time
Expand Down Expand Up @@ -71,7 +71,7 @@ filterresult = None
name = Data Table Metric
parent = TOP
type = table
changed = 1727797876.2851486
changed = 1727969923.070802
colours = 0
datatype = Metric
resulttype = Response Time
Expand All @@ -86,7 +86,7 @@ showcount = 1
name = Error Details
parent = TOP
type = errors
changed = 1727797876.3449943
changed = 1727969923.146473
images = 1
grouprn = 1
groupet = 1
Expand All @@ -96,23 +96,23 @@ sql = SELECT r.script_index || '_' || r.robot || '_' || r.iteration || '_' || r.
name = Contents graphs
parent = TOP
type = contents
changed = 1727797876.1381192
changed = 1727969922.8966575
mode = Table of Graphs
level = 1

[FB634BC6F62]
name = Contents tables
parent = TOP
type = contents
changed = 1727797876.1576178
changed = 1727969922.909193
mode = Table Of Tables
level = 1

[FB634E5493F]
name = Data Graph Right Result
parent = TOP
type = graph
changed = 1727797876.274216
changed = 1727969923.0447252

[FB634E5493FL]
datatype = None
Expand All @@ -134,7 +134,7 @@ filterresult = None
name = Data Graph Left Metric
parent = TOP
type = graph
changed = 1727797876.2059934
changed = 1727969922.9618447

[FB63521E022L]
metrictype = Summary
Expand All @@ -156,7 +156,7 @@ changed = 1727525021.8122218
name = Data Graph Right Metric
parent = TOP
type = graph
changed = 1727797876.261946
changed = 1727969923.030893

[FB6352D21FAL]
datatype = None
Expand All @@ -176,7 +176,7 @@ sql = SELECT MetricTime as 'Time' , MetricValue as 'Value' , PrimaryMetric || '
name = Data Table Result
parent = TOP
type = table
changed = 1727797876.297156
changed = 1727969923.0833027
colours = 0
datatype = Result
resulttype = Response Time
Expand All @@ -189,7 +189,7 @@ sql = SELECT result_name as x91Result Namex93 , round(min(elapsed_time),3) 'Mini
name = Data Table ResultSummary
parent = TOP
type = table
changed = 1727797876.3333435
changed = 1727969923.1213732
colours = 1
datatype = ResultSummary
sql = SELECT r.result_name as x91Result Namex93 , round(min(rp.elapsed_time),3) 'Minimum', round(avg(rp.elapsed_time),3) 'Average', round(percentile(rp.elapsed_time, 90),3) '90x37ile', round(max(rp.elapsed_time),3) 'Maximum', round(stdev(rp.elapsed_time),3) 'Std. Dev.', count(rp.result) as 'Pass', count(rf.result) as 'Fail', count(ro.result) as 'Other' FROM Results as r LEFT JOIN Results as rp ON r.rowid == rp.rowid AND rp.result == 'PASS' LEFT JOIN Results as rf ON r.rowid == rf.rowid AND rf.result == 'FAIL' LEFT JOIN Results as ro ON r.rowid == ro.rowid AND ro.result <> 'PASS' AND ro.result <> 'FAIL' WHERE r.end_time >= 1690522973 AND r.end_time <= 1690523400 GROUP BY r.result_name ORDER BY x91Result Namex93
Expand All @@ -200,22 +200,22 @@ filtertype = None
name = Second Note
parent = FB633E47CD4
type = note
changed = 1727797876.1701474
changed = 1727969922.920805
note = This is my second note.x12
order = FB636059500

[FB636059500]
name = Third Note
parent = FB635F8AEAF
type = note
changed = 1727797876.1701474
changed = 1727969922.920805
note = This is my third note.x12

[FB6A07238B2]
name = Data Graph Left Result TPS
parent = TOP
type = graph
changed = 1727797876.2394354
changed = 1727969923.0043302

[FB6A07238B2L]
datatype = Result
Expand All @@ -238,7 +238,7 @@ changed = 1727705045.599285
name = Data Graph Left Result Total TPS
parent = TOP
type = graph
changed = 1727797876.2508001
changed = 1727969923.0178726

[FB6A0ABC435L]
resulttype = Total TPS
Expand All @@ -256,7 +256,7 @@ changed = 1727705416.418125
name = Data Graph Left Result FAIL
parent = TOP
type = graph
changed = 1727797876.2282724
changed = 1727969922.9882789

[FB6A0B4C09DL]
resulttype = Response Time
Expand All @@ -275,7 +275,7 @@ changed = 1727705478.0610175
name = Data Table Result TPS
parent = TOP
type = table
changed = 1727797876.309026
changed = 1727969923.0968006
colours = 0
datatype = Result
resulttype = TPS
Expand All @@ -287,11 +287,125 @@ sql = SELECT result_name as x91Result Namex93 , result 'Result' , count(result)
name = Data Table Result TotalTPS
parent = TOP
type = table
changed = 1727797876.3204198
changed = 1727969923.1083224
colours = 0
datatype = Result
resulttype = Total TPS
filterresult = None
filteragent = None
sql = SELECT result as x91Result x93 , count(result) as 'Count' FROM Results WHERE end_time >= 1690522973 AND end_time <= 1690523400 GROUP by x91Result x93 ORDER BY count(x91Result x93) DESC

[FB7350079CD]
name = Data Graph LR Combined
parent = TOP
type = graph
changed = 1727969923.0572643

[FB7350079CDL]
isnumeric = 1
changed = 1727954726.6594355
filteragent = None
filtertype = None
datatype = Metric
sql = SELECT MetricTime as 'Time' , MetricValue as 'Value' , PrimaryMetric as x91Namex93 FROM MetricData WHERE MetricType == 'Scenario' AND SecondaryMetric == 'total_robots' AND MetricTime >= 1690522973 AND MetricTime <= 1690523400 ORDER BY MetricTime
metrictype = Scenario
secondarymetric = total_robots

[FB7350079CDR]
datatype = Result
changed = 1727954297.4012053
axisen = 1
resulttype = Total TPS
filterresult = None
filteragent = None
sql = SELECT floor(end_time) as 'Time', count(result) as 'Value' , result as x91Namex93 FROM Results WHERE end_time >= 1690522973 AND end_time <= 1690523400 GROUP by floor(end_time) , result ORDER by floor(end_time), count(result) DESC

[FB7350A2468]
name = Data Table Polish Lang
parent = TOP
type = table
changed = 1727969923.1339386
colours = 0
datatype = ResultSummary
sql = SELECT r.result_name as x91Result Namex93 , round(min(rp.elapsed_time),3) 'Minimum', round(avg(rp.elapsed_time),3) 'Average', round(percentile(rp.elapsed_time, 90),3) '90x37ile', round(max(rp.elapsed_time),3) 'Maximum', round(stdev(rp.elapsed_time),3) 'Std. Dev.', count(rp.result) as 'Pass', count(rf.result) as 'Fail', count(ro.result) as 'Other' FROM Results as r LEFT JOIN Results as rp ON r.rowid == rp.rowid AND rp.result == 'PASS' LEFT JOIN Results as rf ON r.rowid == rf.rowid AND rf.result == 'FAIL' LEFT JOIN Results as ro ON r.rowid == ro.rowid AND ro.result <> 'PASS' AND ro.result <> 'FAIL' WHERE r.end_time >= 1690522973 AND r.end_time <= 1690523400 GROUP BY r.result_name ORDER BY x91Result Namex93
filteragent =
filtertype = None
resulttype = None
filterresult = None
col_result_name = Nazwa Wyniku
col_average = Średnia
col_90x37ile = 90x37yl
col_maximum = Maksimum
col_std_dev = Odchylenie Standardowe
col_pass = Pomyślnie
col_fail = Niepowodzenie
col_other = Inne

[FB7355B8E87]
name = Error Details No Screenshots
parent = TOP
type = errors
changed = 1727969923.1597035
images = 0
grouprn = 1
groupet = 1
sql = SELECT r.script_index || '_' || r.robot || '_' || r.iteration || '_' || r.sequence 'id' , r.result_name , r.script_index , r.robot , r.iteration , r.sequence , mt.SecondaryMetric 'script' , mt.MetricValue 'test_name' FROM Results r LEFT JOIN MetricData mt on mt.PrimaryMetric = r.script_index AND mt.MetricType = 'Scenario_Test' WHERE r.result = 'FAIL' AND r.end_time >= 1690522973 AND r.end_time <= 1690523400 ORDER BY x91idx93 ASC
lbl_result = Result
lbl_test = Test
lbl_script = Script
lbl_error = Error
lbl_count = Count
lbl_screenshot = Screenshot
lbl_noscreenshot = No Screenshot

[FB735654ABA]
name = Error Details No GBRN
parent = TOP
type = errors
changed = 1727969923.1716719
images = 1
grouprn = 0
groupet = 1
sql = SELECT r.script_index || '_' || r.robot || '_' || r.iteration || '_' || r.sequence 'id' , r.result_name , r.script_index , r.robot , r.iteration , r.sequence , mt.SecondaryMetric 'script' , mt.MetricValue 'test_name' FROM Results r LEFT JOIN MetricData mt on mt.PrimaryMetric = r.script_index AND mt.MetricType = 'Scenario_Test' WHERE r.result = 'FAIL' AND r.end_time >= 1690522973 AND r.end_time <= 1690523400 ORDER BY x91idx93 ASC
lbl_result = Result
lbl_test = Test
lbl_script = Script
lbl_error = Error
lbl_count = Count
lbl_screenshot = Screenshot
lbl_noscreenshot = No Screenshot

[FB735667ABF]
name = Error Details No GBET
parent = TOP
type = errors
changed = 1727969923.1838124
images = 1
grouprn = 1
groupet = 0
sql = SELECT r.script_index || '_' || r.robot || '_' || r.iteration || '_' || r.sequence 'id' , r.result_name , r.script_index , r.robot , r.iteration , r.sequence , mt.SecondaryMetric 'script' , mt.MetricValue 'test_name' FROM Results r LEFT JOIN MetricData mt on mt.PrimaryMetric = r.script_index AND mt.MetricType = 'Scenario_Test' WHERE r.result = 'FAIL' AND r.end_time >= 1690522973 AND r.end_time <= 1690523400 ORDER BY x91idx93 ASC
lbl_result = Result
lbl_test = Test
lbl_script = Script
lbl_error = Error
lbl_count = Count
lbl_screenshot = Screenshot
lbl_noscreenshot = No Screenshot

[FB7356761CB]
name = Error Details Polish Lang
parent = TOP
type = errors
changed = 1727969923.1983469
images = 0
grouprn = 0
groupet = 0
sql = SELECT r.script_index || '_' || r.robot || '_' || r.iteration || '_' || r.sequence 'id' , r.result_name , r.script_index , r.robot , r.iteration , r.sequence , mt.SecondaryMetric 'script' , mt.MetricValue 'test_name' FROM Results r LEFT JOIN MetricData mt on mt.PrimaryMetric = r.script_index AND mt.MetricType = 'Scenario_Test' WHERE r.result = 'FAIL' AND r.end_time >= 1690522973 AND r.end_time <= 1690523400 ORDER BY x91idx93 ASC
lbl_result = Nazwa Wyniku
lbl_test = Test
lbl_script = Skrypt
lbl_error = Błąd
lbl_count = Liczba
lbl_screenshot = Zrzut Ekranu
lbl_noscreenshot = Brak Zrzutu Ekranu

Loading

0 comments on commit 41997e3

Please sign in to comment.