From 4fafb6aa44157e0682add67a67b1abd71819cfef Mon Sep 17 00:00:00 2001 From: Jason Holt Smith Date: Thu, 16 May 2024 11:37:57 +0100 Subject: [PATCH] fixes html line wrapping on long log lines and test descriptions --- .../src/templates/html-template.ts | 12 +++++++++--- .../aft-reporting-html/src/templates/tmp.html | 16 +++++++++++----- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/packages/aft-reporting-html/src/templates/html-template.ts b/packages/aft-reporting-html/src/templates/html-template.ts index ef36ae23..435722d5 100644 --- a/packages/aft-reporting-html/src/templates/html-template.ts +++ b/packages/aft-reporting-html/src/templates/html-template.ts @@ -198,8 +198,8 @@ function addResult(result) {
-
Description: \${result.description}
-
\${passing + failing + notRun} \${passing} \${failing} \${notRun}
+
Description: \${result.description}
+
\${passing + failing + notRun} \${passing} \${failing} \${notRun}
@@ -262,7 +262,7 @@ function addTests(container, tests) { \${result.status} - + \${result.logs.join('
')} @@ -308,6 +308,8 @@ div.vertical-align { height:50px; } .breakWrap { + max-width: 100dvw; + overflow-wrap: break-word; -ms-word-break: break-all; /* Be VERY careful with this, breaks normal words wh_erever */ word-break: break-all; @@ -318,6 +320,10 @@ div.vertical-align { -moz-hyphens: auto; hyphens: auto; } +.noWrap { + max-width: 100dvw; + white-space: nowrap; +} diff --git a/packages/aft-reporting-html/src/templates/tmp.html b/packages/aft-reporting-html/src/templates/tmp.html index 5d47d60d..e98c4d11 100644 --- a/packages/aft-reporting-html/src/templates/tmp.html +++ b/packages/aft-reporting-html/src/templates/tmp.html @@ -194,8 +194,8 @@
-
Description: ${result.description}
-
${passing + failing + notRun} ${passing} ${failing} ${notRun}
+
Description: ${result.description}
+
${passing + failing + notRun} ${passing} ${failing} ${notRun}
@@ -258,7 +258,7 @@ ${result.status} - + ${result.logs.join('
')} @@ -304,6 +304,8 @@ height:50px; } .breakWrap { + max-width: 100dvw; + overflow-wrap: break-word; -ms-word-break: break-all; /* Be VERY careful with this, breaks normal words wh_erever */ word-break: break-all; @@ -314,6 +316,10 @@ -moz-hyphens: auto; hyphens: auto; } +.noWrap { + max-width: 100dvw; + white-space: nowrap; +} @@ -354,8 +360,8 @@ google.setOnLoadCallback(drawChart); initialise([ {description: 'foo_is_my_name', tests: [{created: Date.now(), testId: 'C1234', status: 'passed', logs: ['this is log line 1', 'this is log line 2']}]}, - {description: 'bar_is_my_name', tests: [{created: Date.now(), testId: 'C2345', status: 'failed', logs: ['this is log line 1']}]}, - {description: 'baz_is_my_name', tests: [{created: Date.now(), status: 'untested', logs: []}, {created: Date.now(), testId: 'C3456', status: 'passed', logs: ['this is log line 1']}]} + {description: 'bar_is_my_name', tests: [{created: Date.now(), testId: 'C2345', status: 'failed', logs: ['_this_is_log_line_1_this_is_log_line_1_this_is_log_line_1_this_is_log_line_1_this_is_log_line_1_this_is_log_line_1_this_is_log_line_1_this_is_log_line_1_this_is_log_line_1_this_is_log_line_1_this_is_log_line_1_this_is_log_line_1_this_is_log_line_1_this_is_log_line_1_this_is_log_line_1_this_is_log_line_1_this_is_log_line_1_this_is_log_line_1_this_is_log_line_1']}]}, + {description: '_baz_is_my_name_baz_is_my_name_baz_is_my_name_baz_is_my_name_baz_is_my_name_baz_is_my_name_baz_is_my_name_baz_is_my_name_baz_is_my_name_baz_is_my_name_baz_is_my_name_baz_is_my_name_baz_is_my_name_baz_is_my_name_baz_is_my_name_baz_is_my_name_baz_is_my_name_baz_is_my_name_baz_is_my_name_baz_is_my_name_baz_is_my_name_baz_is_my_name_baz_is_my_name_baz_is_my_name_baz_is_my_name_baz_is_my_name_baz_is_my_name_baz_is_my_name_baz_is_my_name_baz_is_my_name', tests: [{created: Date.now(), status: 'untested', logs: []}, {created: Date.now(), testId: 'C3456', status: 'passed', logs: ['this is log line 1']}]} ]); \ No newline at end of file