From b98852b62a1569c979ac7eb8b837cb6b38187180 Mon Sep 17 00:00:00 2001 From: Paul Clue <67766160+Paul-Clue@users.noreply.github.com> Date: Wed, 22 Nov 2023 15:48:57 -0500 Subject: [PATCH] No longer mark test plan reports with skipped tests as final (#833) * Hide mark as final button * No mark as final for skipped tests in graphql * Remove skipped tests from the UI * Add migration for unfinished tests * Simplify necessary files * Fix failing tests * Add code review fixes * Remove no-longer-necessary style class * Remove reference --- client/components/Reports/Reports.css | 31 --------- .../Reports/SummarizeTestPlanReport.jsx | 26 ------- .../Reports/SummarizeTestPlanVersion.jsx | 18 ----- client/components/TestQueueRow/index.jsx | 8 ++- client/components/TestRun/TestRun.css | 2 +- .../20231031162340-verifyNoSkippedTests.js | 63 +++++++++++++++++ .../finalizedTestResultsResolver.js | 27 +++----- .../markAsFinalResolver.js | 18 ++--- server/resolvers/testPlanReportsResolver.js | 9 +-- server/scripts/populate-test-data/index.js | 6 +- .../populateFakeTestResults.js | 69 +++++++++++++------ server/tests/integration/graphql.test.js | 4 +- 12 files changed, 144 insertions(+), 137 deletions(-) create mode 100644 server/migrations/20231031162340-verifyNoSkippedTests.js diff --git a/client/components/Reports/Reports.css b/client/components/Reports/Reports.css index e6c96b768..2a3768dbd 100644 --- a/client/components/Reports/Reports.css +++ b/client/components/Reports/Reports.css @@ -56,36 +56,6 @@ margin-top: 1em; } -.skipped-tests-heading { - background: #fefbea; - padding: 1.75em 1.75em 1em 1.75em; - border: 1px solid #eddfbe; - border-bottom: 0; - margin-top: 2em; -} - -.skipped-tests { - columns: 2; - line-height: 2; - border: 1px solid #eddfbe; - padding: 1.5em 3em; - background: #fdfcf6; -} - -.skipped-tests li { - margin-bottom: 0.5em; - border-bottom: 1px solid #eddfbe; - padding-bottom: 0.5em; - margin-right: 3em; - -webkit-column-break-inside: avoid; - page-break-inside: avoid; - break-inside: avoid; -} - -.skipped-tests li:last-child { - border-bottom: none; -} - .test-result-heading { display: flex; justify-content: space-between; @@ -100,7 +70,6 @@ margin-bottom: 0; } -.skipped-tests-heading h2, .test-result-heading h2 { margin-top: 0; } diff --git a/client/components/Reports/SummarizeTestPlanReport.jsx b/client/components/Reports/SummarizeTestPlanReport.jsx index ad6d6542c..0b21f494c 100644 --- a/client/components/Reports/SummarizeTestPlanReport.jsx +++ b/client/components/Reports/SummarizeTestPlanReport.jsx @@ -10,7 +10,6 @@ import { faExternalLinkAlt, faHome } from '@fortawesome/free-solid-svg-icons'; -import { differenceBy } from 'lodash'; import { convertDateToString } from '../../utils/formatter'; import DisclaimerInfo from '../DisclaimerInfo'; import TestPlanResultsTable from '../common/TestPlanResultsTable'; @@ -100,11 +99,6 @@ const SummarizeTestPlanReport = ({ testPlanVersion, testPlanReports }) => { browser }; - const skippedTests = differenceBy( - testPlanReport.runnableTests, - testPlanReport.finalizedTestResults, - testOrTestResult => testOrTestResult.test?.id ?? testOrTestResult.id - ); return ( @@ -269,26 +263,6 @@ const SummarizeTestPlanReport = ({ testPlanVersion, testPlanReports }) => { ); })} - {skippedTests.length ? ( - -
-

- Skipped Tests -

-

- The following tests have been skipped in this test - run: -

-
-
    - {skippedTests.map(test => ( -
  1. - {test.title} -
  2. - ))} -
-
- ) : null}
); }; diff --git a/client/components/Reports/SummarizeTestPlanVersion.jsx b/client/components/Reports/SummarizeTestPlanVersion.jsx index 6cdedc1b6..e9528f4ca 100644 --- a/client/components/Reports/SummarizeTestPlanVersion.jsx +++ b/client/components/Reports/SummarizeTestPlanVersion.jsx @@ -1,7 +1,6 @@ import React, { Fragment } from 'react'; import PropTypes from 'prop-types'; import { Helmet } from 'react-helmet'; -import { differenceBy } from 'lodash'; import getMetrics from './getMetrics'; import { getTestPlanTargetTitle, getTestPlanVersionTitle } from './getTitles'; import { Breadcrumb, Button, Container, Table } from 'react-bootstrap'; @@ -86,12 +85,6 @@ const SummarizeTestPlanVersion = ({ testPlanVersion, testPlanReports }) => { {testPlanReports.map(testPlanReport => { if (testPlanReport.status === 'DRAFT') return null; - const skippedTests = differenceBy( - testPlanReport.runnableTests, - testPlanReport.finalizedTestResults, - testOrTestResult => - testOrTestResult.test?.id ?? testOrTestResult.id - ); const overallMetrics = getMetrics({ testPlanReport }); const { at, browser } = testPlanReport; @@ -124,17 +117,6 @@ const SummarizeTestPlanVersion = ({ testPlanVersion, testPlanReports }) => { View Complete Results - {skippedTests.length ? ( - - {skippedTests.length} Tests Were Skipped - - ) : null} + testPlanRun.testResultsLength === testPlanReport.runnableTestsLength + ); + return ( @@ -494,7 +499,8 @@ const TestQueueRow = ({ !testPlanReport.conflictsLength && testPlanReport.draftTestPlanRuns.length && testPlanReport.draftTestPlanRuns[0] - .testResultsLength ? ( + .testResultsLength && + completedAllTests ? ( <>