diff --git a/common/acs_test_framework_runner/report_ui_browser_smoke.py b/common/acs_test_framework_runner/report_ui_browser_smoke.py index ca2b5ca1..6eaf88a9 100644 --- a/common/acs_test_framework_runner/report_ui_browser_smoke.py +++ b/common/acs_test_framework_runner/report_ui_browser_smoke.py @@ -160,12 +160,21 @@ def _run_page( function buttonStartingWith(label) { return buttons.find(function (button) { return button.textContent.indexOf(label) === 0; }); } - var all = buttonStartingWith("All outcomes "); + var all = buttonStartingWith("All tests "); var passed = buttonStartingWith("Passed "); + var failed = buttonStartingWith("Failed "); var custom = buttonStartingWith("CUSTOM REVIEW "); - expect(all && all.textContent === "All outcomes 2", "All filter must count two outcomes"); - expect(passed && passed.textContent === "Passed 1", "Passed filter must be generated"); + expect(all && all.textContent === "All tests 10", + "All filter must use the suite total, not the two detailed rows"); + expect(passed && passed.textContent === "Passed 7", + "Passed filter must use the suite count, not the single detailed row"); + expect(failed && failed.textContent === "Failed 2", + "A positive summary status must remain available without detailed rows"); expect(custom && custom.textContent === "CUSTOM REVIEW 1", "Future status filter must be generated"); + expect(!buttons.some(function (button) { return button.classList.contains("fail-waiver"); }), + "Zero summary statuses without matching details must not add filter buttons"); + expect(document.querySelector(".acs-filter-count").textContent === "Showing all detailed results", + "Summary-backed reports must not display a competing row-count total"); var compact = document.querySelector(".acs-compact-summary"); var summaryRows = Array.prototype.slice.call(compact.querySelectorAll(".acs-progress-row")); var passedSummary = document.querySelector('[data-acs-summary-status="pass"]'); @@ -197,10 +206,14 @@ def _run_page( "Original summary table must remain as the hidden fallback source"); expect(compact.querySelector(".acs-reference-note a").textContent.indexOf("Rule result status guide") === 0, "Rule-status guide must remain in the compact BSA/SBSA-style summary"); - var expectedFilterScope = document.body.getAttribute("data-acs-suite") === "sct" ? - "Subtest outcomes and test cases without subtests" : "Case and subtest outcomes"; - expect(document.querySelector(".acs-filter-scope").textContent.indexOf(expectedFilterScope) === 0, - "Filter outcomes must have an explicit scope label"); + expect(document.querySelector(".acs-filter-scope").textContent === "Test results in this report", + "Filter scope must describe the same test results as the summary"); + var help = document.querySelector(".acs-filter-help"); + expect(help.textContent === + "Counts match the Test-result summary. Filters include matching case and subtest details. " + + "'Details only' means the summary count is zero or not provided." && + help.getBoundingClientRect().height > 1, + "Visible filter help must explain suite counts and detailed filtering"); expect(!document.querySelector(".acs-count-scope-note"), "Detailed summary must not show the confusing count-scope note"); expect(document.querySelector(".acs-print-scope-note").textContent.indexOf("every result group") >= 0, @@ -214,14 +227,16 @@ def _run_page( "Detailed report must remove the legacy summary count cards"); var longReason = document.querySelector("#custom-row .acs-long-reason"); var shortReason = document.querySelector("#passed-row .acs-long-reason"); - expect(longReason && !longReason.open, "Verbose SCT/FWTS reason must start collapsed"); - expect(shortReason && !shortReason.open, "Short SCT/FWTS reason must also start collapsed"); - expect(document.querySelectorAll(".acs-long-reason").length === 2, - "Every SCT/FWTS reason must use a disclosure"); - expect(longReason && longReason.textContent.indexOf("retains every original character") >= 0, - "Collapsed reason must retain its full diagnostic text"); - expect(longReason && longReason.querySelectorAll(".acs-long-reason-text br").length === 1, - "Collapsed reason must retain original line-break elements"); + if (["sct", "fwts"].indexOf(document.body.getAttribute("data-acs-suite")) >= 0) { + expect(longReason && !longReason.open, "Verbose SCT/FWTS reason must start collapsed"); + expect(shortReason && !shortReason.open, "Short SCT/FWTS reason must also start collapsed"); + expect(document.querySelectorAll(".acs-long-reason").length === 2, + "Every SCT/FWTS reason must use a disclosure"); + expect(longReason && longReason.textContent.indexOf("retains every original character") >= 0, + "Collapsed reason must retain its full diagnostic text"); + expect(longReason && longReason.querySelectorAll(".acs-long-reason-text br").length === 1, + "Collapsed reason must retain original line-break elements"); + } if (longReason) { longReason.querySelector("summary").click(); expect(longReason.open, "Long reason must expand when requested"); @@ -233,8 +248,40 @@ def _run_page( "Nonmatching result must be hidden"); expect(!document.getElementById("custom-row").classList.contains("acs-filter-hidden"), "Matching result must remain visible"); - all.click(); - expect(all.getAttribute("aria-pressed") === "true", "All button must restore every outcome"); + expect(document.querySelector(".acs-filter-count").textContent === "Showing matching detailed results", + "An active status must describe matching details without another numeric total"); + if (failed) { + failed.click(); + expect(document.querySelector(".acs-filter-count").textContent === "No matching detailed results" && + document.querySelector(".acs-empty-state").classList.contains("visible"), + "Summary status without detailed rows must expose an honest empty state"); + } + if (all) { + all.click(); + expect(all.getAttribute("aria-pressed") === "true", "All button must restore every outcome"); + } + var search = document.querySelector("input[aria-label='Search report rows']"); + search.value = "Future outcome"; + search.dispatchEvent(new Event("input")); + expect(document.getElementById("passed-row").classList.contains("acs-filter-hidden") && + !document.getElementById("custom-row").classList.contains("acs-filter-hidden") && + document.querySelector(".acs-filter-count").textContent === "Showing matching detailed results", + "Search must continue to filter the detailed rows"); + search.value = "no such diagnostic"; + search.dispatchEvent(new Event("input")); + expect(document.querySelector(".acs-filter-count").textContent === "No matching detailed results", + "An unmatched search must report no matching details"); + var reset = Array.prototype.find.call(document.querySelectorAll(".acs-button"), function (button) { + return button.textContent === "Reset"; + }); + reset.click(); + expect(search.value === "" && + !document.getElementById("passed-row").classList.contains("acs-filter-hidden") && + !document.getElementById("custom-row").classList.contains("acs-filter-hidden") && + document.querySelector(".acs-filter-count").textContent === "Showing all detailed results", + "Reset must restore every detail and the unfiltered state"); + expect(passed.textContent === "Passed 7" && custom.textContent === "CUSTOM REVIEW 1", + "Filtering and searching must leave suite-reported counts unchanged"); var group = document.querySelector(".acs-result-group.acs-collapsible"); expect(!group.classList.contains("acs-collapsed") && @@ -281,6 +328,169 @@ def _run_page( """ +NESTED_COUNTS_PAGE = r""" +Nested status count smoke +

Nested status count smoke

+

Result Summary

+ + + + +
Total Tests1,200
Passed1,200
Warnings0
+
+
+
Test Suite: Nested evidence
+ + + +
DescriptionResult
Passing casePASSED
+ + + +
DescriptionResult
Warning evidenceWARNING
Skipped evidenceSKIPPED
+
+
+ +""" + + +EMPTY_DETAILS_PAGE = r""" +Summary without detailed outcomes +

Summary without detailed outcomes

+

Result Summary

+ + + + +
Total Tests2
Passed0
Failed2
+
+
+
DescriptionResult
+
+ +""" + + BSA_PAGE = r""" BSA compact summary smoke