From 488f39255231be85a5deb8fbd38c406565903b96 Mon Sep 17 00:00:00 2001 From: Howard Edwards Date: Thu, 16 Nov 2023 17:56:54 -0500 Subject: [PATCH 1/4] Prepend tests with 'Test {number}' on reports page --- client/components/Reports/SummarizeTestPlanReport.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/components/Reports/SummarizeTestPlanReport.jsx b/client/components/Reports/SummarizeTestPlanReport.jsx index 0b21f494c..7ac7021fc 100644 --- a/client/components/Reports/SummarizeTestPlanReport.jsx +++ b/client/components/Reports/SummarizeTestPlanReport.jsx @@ -180,7 +180,7 @@ const SummarizeTestPlanReport = ({ testPlanVersion, testPlanReports }) => { ) : null} - {testPlanReport.finalizedTestResults.map(testResult => { + {testPlanReport.finalizedTestResults.map((testResult, index) => { const test = testResult.test; const reportLink = `https://aria-at.w3.org${location.pathname}#result-${testResult.id}`; @@ -211,7 +211,8 @@ const SummarizeTestPlanReport = ({ testPlanVersion, testPlanReports }) => {

- {test.title} ({passedAssertionsCount} + Test {index + 1}: {test.title} ( + {passedAssertionsCount}  passed, {failedAssertionsCount} failed)

From 3f6d6c52c3c4f675e0c6932dbc32e2a3892ef1cd Mon Sep 17 00:00:00 2001 From: Howard Edwards Date: Mon, 20 Nov 2023 09:18:53 -0500 Subject: [PATCH 2/4] Address CG comments --- .../Reports/SummarizeTestPlanReport.jsx | 3 +- .../common/TestPlanResultsTable/index.jsx | 30 ++++++++++++++----- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/client/components/Reports/SummarizeTestPlanReport.jsx b/client/components/Reports/SummarizeTestPlanReport.jsx index 7ac7021fc..f8e5cc76e 100644 --- a/client/components/Reports/SummarizeTestPlanReport.jsx +++ b/client/components/Reports/SummarizeTestPlanReport.jsx @@ -24,7 +24,7 @@ const ResultsContainer = styled.div` border-left: 1px solid #dee2e6; border-right: 1px solid #dee2e6; border-bottom: 1px solid #dee2e6; - margin-bottom: 2em; + margin-bottom: 0.5em; `; const getTestersRunHistory = ( @@ -249,6 +249,7 @@ const SummarizeTestPlanReport = ({ testPlanVersion, testPlanReports }) => { key={`TestPlanResultsTable__${testResult.id}`} test={{ ...test, at }} testResult={testResult} + isReportsPage={true} /> diff --git a/client/components/common/TestPlanResultsTable/index.jsx b/client/components/common/TestPlanResultsTable/index.jsx index d20488df1..431b8ec10 100644 --- a/client/components/common/TestPlanResultsTable/index.jsx +++ b/client/components/common/TestPlanResultsTable/index.jsx @@ -14,9 +14,16 @@ const renderAssertionRow = (assertionResult, priorityString) => { ); }; -const TestPlanResultsTable = ({ test, testResult, tableClassName = '' }) => { +const TestPlanResultsTable = ({ + test, + testResult, + tableClassName = '', + isReportsPage = false +}) => { return ( <> + {isReportsPage ?

Results for each command

: null} + {testResult.scenarioResults.map((scenarioResult, index) => { const passedAssertions = scenarioResult.assertionResults.filter( assertionResult => assertionResult.passed @@ -56,11 +63,19 @@ const TestPlanResultsTable = ({ test, testResult, tableClassName = '' }) => { return ( -

- {commandsString} Results:  - {passedAssertions.length} passed,  - {failedAssertions.length} failed -

+ {isReportsPage ? ( +

+ {commandsString} Results:  + {passedAssertions.length} passed,  + {failedAssertions.length} failed +

+ ) : ( +

+ {commandsString} Results:  + {passedAssertions.length} passed,  + {failedAssertions.length} failed +

+ )}

{test.at?.name} Response:

@@ -135,7 +150,8 @@ TestPlanResultsTable.propTypes = { testResult: PropTypes.shape({ scenarioResults: PropTypes.array.isRequired }), - tableClassName: PropTypes.string + tableClassName: PropTypes.string, + isReportsPage: PropTypes.bool }; export default TestPlanResultsTable; From 755760840f76886fc6371ee6482cff7a3e2fbbd2 Mon Sep 17 00:00:00 2001 From: Howard Edwards Date: Tue, 21 Nov 2023 17:06:14 -0500 Subject: [PATCH 3/4] Address PR feedback --- .../Reports/SummarizeTestPlanReport.jsx | 5 +++- .../common/TestPlanResultsTable/index.jsx | 29 ++++++++----------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/client/components/Reports/SummarizeTestPlanReport.jsx b/client/components/Reports/SummarizeTestPlanReport.jsx index f8e5cc76e..c20f80395 100644 --- a/client/components/Reports/SummarizeTestPlanReport.jsx +++ b/client/components/Reports/SummarizeTestPlanReport.jsx @@ -249,7 +249,10 @@ const SummarizeTestPlanReport = ({ testPlanVersion, testPlanReports }) => { key={`TestPlanResultsTable__${testResult.id}`} test={{ ...test, at }} testResult={testResult} - isReportsPage={true} + optionalHeader={ +

Results for each command

+ } + commandHeadingLevel={4} /> diff --git a/client/components/common/TestPlanResultsTable/index.jsx b/client/components/common/TestPlanResultsTable/index.jsx index 431b8ec10..85405271f 100644 --- a/client/components/common/TestPlanResultsTable/index.jsx +++ b/client/components/common/TestPlanResultsTable/index.jsx @@ -18,12 +18,14 @@ const TestPlanResultsTable = ({ test, testResult, tableClassName = '', - isReportsPage = false + optionalHeader = null, + commandHeadingLevel = 3 }) => { + const Heading = `h${commandHeadingLevel}`; + return ( <> - {isReportsPage ?

Results for each command

: null} - + {optionalHeader} {testResult.scenarioResults.map((scenarioResult, index) => { const passedAssertions = scenarioResult.assertionResults.filter( assertionResult => assertionResult.passed @@ -63,19 +65,11 @@ const TestPlanResultsTable = ({ return ( - {isReportsPage ? ( -

- {commandsString} Results:  - {passedAssertions.length} passed,  - {failedAssertions.length} failed -

- ) : ( -

- {commandsString} Results:  - {passedAssertions.length} passed,  - {failedAssertions.length} failed -

- )} + + {commandsString} Results:  + {passedAssertions.length} passed,  + {failedAssertions.length} failed +

{test.at?.name} Response:

@@ -151,7 +145,8 @@ TestPlanResultsTable.propTypes = { scenarioResults: PropTypes.array.isRequired }), tableClassName: PropTypes.string, - isReportsPage: PropTypes.bool + optionalHeader: PropTypes.node, + commandHeadingLevel: PropTypes.number }; export default TestPlanResultsTable; From 38bec5fbd114d69751fa494164d081c05fd9977b Mon Sep 17 00:00:00 2001 From: Howard Edwards Date: Tue, 21 Nov 2023 17:06:55 -0500 Subject: [PATCH 4/4] Consistency --- client/components/common/TestPlanResultsTable/index.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/components/common/TestPlanResultsTable/index.jsx b/client/components/common/TestPlanResultsTable/index.jsx index 85405271f..49c5a99d1 100644 --- a/client/components/common/TestPlanResultsTable/index.jsx +++ b/client/components/common/TestPlanResultsTable/index.jsx @@ -21,7 +21,7 @@ const TestPlanResultsTable = ({ optionalHeader = null, commandHeadingLevel = 3 }) => { - const Heading = `h${commandHeadingLevel}`; + const CommandHeading = `h${commandHeadingLevel}`; return ( <> @@ -65,11 +65,11 @@ const TestPlanResultsTable = ({ return ( - + {commandsString} Results:  {passedAssertions.length} passed,  {failedAssertions.length} failed - +

{test.at?.name} Response: