Skip to content

Commit

Permalink
HTML AI report: improve output
Browse files Browse the repository at this point in the history
  • Loading branch information
bartekpacia committed Aug 22, 2024
1 parent cbad634 commit c50192f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,19 @@ class HtmlAITestSuiteReporter {

// File chooser for different reports
div(classes = "group relative inline-block self-start") {
button(classes = "btn") { +"Select different report" }
button(classes = "btn") { +"Open other report" }
div(classes = "absolute z-10 hidden min-w-32 group-hover:block") {
outputs.forEachIndexed { outputIndex, outputFlow ->
val selected = outputIndex == index

a(classes = "toggle-link") {
a(classes = buildString {
append("toggle-link")

if (selected) append(" toggle-link-selected")
} ) {
href = "./" + outputs[outputIndex].htmlReportFilename
val name = outputFlow.flowFile.nameWithoutExtension
val maybeSelected = if (selected) "(X)" else ""
+"Report ${outputIndex + 1} $name $maybeSelected"
+"(${outputIndex + 1}) $name"
}
}
}
Expand All @@ -115,7 +118,7 @@ class HtmlAITestSuiteReporter {
// Container for list of screenshots
main(classes = "container mx-auto flex flex-col gap-4") {
// Overall defect count for the flow
p {
p(classes = "text-lg") {
val word = if (summary.defectCount == 1) "defect" else "defects"
+"${summary.defectCount} possible $word found"
}
Expand Down
4 changes: 4 additions & 0 deletions maestro-cli/src/main/resources/ai_report.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
@apply block border-2 border-gray-medium bg-[#ececec] px-3 py-4 text-gray-medium hover:bg-gray-medium hover:text-[#ececec];
}

.toggle-link-selected {
@apply border-orange-2;
}

.divider {
@apply h-0.5 rounded-sm bg-gray-medium dark:bg-gray-1 my-2;
}
Expand Down
1 change: 1 addition & 0 deletions maestro-cli/src/main/resources/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ tailwind.config = {
"gray-medium": "#4f4b5c", // text-gray-medium
"gray-1": "#f8f8f8", // surface-gray-1
"gray-0": "#110C22", // surface-gray-0
"orange-2": "#ff9254", // surface-orange-2
},
},
},
Expand Down

0 comments on commit c50192f

Please sign in to comment.