Skip to content

Commit 9c54e2d

Browse files
authored
fix: Exclude unsupported assertion results from failure count in report headings; use separate "unsupported" metric (#1265)
* Update Test Results table headings to count 'MAY' assertion results separately
1 parent 475230a commit 9c54e2d

File tree

7 files changed

+176
-65
lines changed

7 files changed

+176
-65
lines changed

client/components/CandidateReview/CandidateTestPlanRun/index.jsx

+11-4
Original file line numberDiff line numberDiff line change
@@ -507,16 +507,23 @@ const CandidateTestPlanRun = () => {
507507
const testResult =
508508
testPlanReport.finalizedTestResults[currentTestIndex];
509509

510-
const { assertionsPassedCount, assertionsFailedCount } = getMetrics(
511-
{ testResult }
512-
);
510+
const {
511+
assertionsPassedCount,
512+
mustAssertionsFailedCount,
513+
shouldAssertionsFailedCount,
514+
mayAssertionsFailedCount
515+
} = getMetrics({ testResult });
516+
517+
const mustShouldAssertionsFailedCount =
518+
mustAssertionsFailedCount + shouldAssertionsFailedCount;
513519

514520
return (
515521
<>
516522
<h2 className="test-results-header">
517523
Test Results&nbsp;(
518524
{assertionsPassedCount} passed,&nbsp;
519-
{assertionsFailedCount} failed)
525+
{mustShouldAssertionsFailedCount} failed,&nbsp;
526+
{mayAssertionsFailedCount} unsupported)
520527
</h2>
521528
<TestPlanResultsTable
522529
key={`${testPlanReport.id} + ${testResult.id}`}

client/components/Reports/SummarizeTestPlanReport.jsx

+12-3
Original file line numberDiff line numberDiff line change
@@ -272,17 +272,26 @@ const SummarizeTestPlanReport = ({ testPlanVersion, testPlanReports }) => {
272272
'https://aria-at.netlify.app'
273273
);
274274

275-
const { assertionsPassedCount, assertionsFailedCount } = getMetrics({
275+
const {
276+
assertionsPassedCount,
277+
mustAssertionsFailedCount,
278+
shouldAssertionsFailedCount,
279+
mayAssertionsFailedCount
280+
} = getMetrics({
276281
testResult
277282
});
278283

284+
const mustShouldAssertionsFailedCount =
285+
mustAssertionsFailedCount + shouldAssertionsFailedCount;
286+
279287
return (
280288
<Fragment key={testResult.id}>
281289
<div className="test-result-heading">
282290
<h2 id={`result-${testResult.id}`} tabIndex="-1">
283291
Test {index + 1}: {test.title}&nbsp;(
284-
{assertionsPassedCount}
285-
&nbsp;passed, {assertionsFailedCount} failed)
292+
{assertionsPassedCount} passed,&nbsp;
293+
{mustShouldAssertionsFailedCount} failed,&nbsp;
294+
{mayAssertionsFailedCount} unsupported)
286295
<DisclaimerInfo phase={testPlanVersion.phase} />
287296
</h2>
288297
<div className="test-result-buttons">

client/components/TestRenderer/index.jsx

+11-2
Original file line numberDiff line numberDiff line change
@@ -476,17 +476,26 @@ const TestRenderer = ({
476476
const { results } = submitResult;
477477
const { header } = results;
478478

479-
const { assertionsPassedCount, assertionsFailedCount } = getMetrics({
479+
const {
480+
assertionsPassedCount,
481+
mustAssertionsFailedCount,
482+
shouldAssertionsFailedCount,
483+
mayAssertionsFailedCount
484+
} = getMetrics({
480485
testResult
481486
});
482487

488+
const mustShouldAssertionsFailedCount =
489+
mustAssertionsFailedCount + shouldAssertionsFailedCount;
490+
483491
return (
484492
<>
485493
<HeadingText>{header}</HeadingText>
486494
<SubHeadingText id="overallstatus">
487495
Test Results&nbsp;(
488496
{assertionsPassedCount} passed,&nbsp;
489-
{assertionsFailedCount} failed)
497+
{mustShouldAssertionsFailedCount} failed,&nbsp;
498+
{mayAssertionsFailedCount} unsupported)
490499
</SubHeadingText>
491500
<TestPlanResultsTable
492501
test={{ title: header, at }}

client/components/common/TestPlanResultsTable/index.jsx

+8-2
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,16 @@ const TestPlanResultsTable = ({
4444
{testResult.scenarioResults.map((scenarioResult, index) => {
4545
const {
4646
assertionsPassedCount,
47-
assertionsFailedCount,
47+
mustAssertionsFailedCount,
48+
shouldAssertionsFailedCount,
49+
mayAssertionsFailedCount,
4850
severeImpactPassedAssertionCount,
4951
moderateImpactPassedAssertionCount
5052
} = getMetrics({ scenarioResult });
5153

54+
const mustShouldAssertionsFailedCount =
55+
mustAssertionsFailedCount + shouldAssertionsFailedCount;
56+
5257
const hasNoSevereUnexpectedBehavior =
5358
severeImpactPassedAssertionCount > 0;
5459
const hasNoModerateUnexpectedBehavior =
@@ -119,7 +124,8 @@ const TestPlanResultsTable = ({
119124
<CommandHeading>
120125
{commandsString}&nbsp;Results:&nbsp;
121126
{assertionsPassedCount} passed,&nbsp;
122-
{assertionsFailedCount} failed
127+
{mustShouldAssertionsFailedCount} failed,&nbsp;
128+
{mayAssertionsFailedCount} unsupported
123129
</CommandHeading>
124130
<p className="test-plan-results-response-p">
125131
{test.at?.name} Response:

client/tests/e2e/snapshots/saved/_candidate-test-plan_24_1.html

+6-3
Original file line numberDiff line numberDiff line change
@@ -501,10 +501,12 @@ <h1>
501501
aria-labelledby="disclosure-btn-test-instructions-and-results-Test Results for Chrome"
502502
class="css-19fsyrg">
503503
<h2 class="test-results-header">
504-
Test Results&nbsp;(12 passed,&nbsp;0 failed)
504+
Test Results&nbsp;(12 passed,&nbsp;0
505+
failed,&nbsp;0 unsupported)
505506
</h2>
506507
<h3>
507-
Space&nbsp;Results:&nbsp;6 passed,&nbsp;0 failed
508+
Space&nbsp;Results:&nbsp;6 passed,&nbsp;0
509+
failed,&nbsp;0 unsupported
508510
</h3>
509511
<p class="test-plan-results-response-p">
510512
JAWS Response:
@@ -576,7 +578,8 @@ <h3>
576578
Other behaviors that create negative impact: None
577579
<hr aria-hidden="true" />
578580
<h3>
579-
Enter&nbsp;Results:&nbsp;6 passed,&nbsp;0 failed
581+
Enter&nbsp;Results:&nbsp;6 passed,&nbsp;0
582+
failed,&nbsp;0 unsupported
580583
</h3>
581584
<p class="test-plan-results-response-p">
582585
JAWS Response:

0 commit comments

Comments
 (0)