From 26070c48b65f0c70a21565e49376caadb8b270fe Mon Sep 17 00:00:00 2001 From: Stalgia Grigg Date: Thu, 1 Aug 2024 16:11:26 -0700 Subject: [PATCH 01/11] Reusable proptypes --- .../DataManagementRow/index.jsx | 34 +- .../MarkBotRunFinishedButton/index.jsx | 3 +- .../RetryCanceledCollectionsButton/index.jsx | 12 +- .../StopRunningCollectionButton/index.jsx | 12 +- .../ManageBotRunDialog/WithButton.jsx | 5 +- .../components/ManageBotRunDialog/index.jsx | 5 +- .../ManageTestQueue/ManageAtVersions.jsx | 16 +- client/components/ManageTestQueue/index.jsx | 18 +- .../Reports/SummarizeTestPlanReport.jsx | 60 +--- .../Reports/SummarizeTestPlanReports.jsx | 22 +- .../Reports/SummarizeTestPlanVersion.jsx | 26 +- .../ReviewConflicts/ReviewConflicts.jsx | 55 +-- .../TestPlanReportStatusDialog/index.jsx | 33 +- client/components/TestQueue/Actions.jsx | 45 +-- client/components/TestQueue/AssignTesters.jsx | 54 +-- .../CompletionStatusListItem/index.jsx | 20 +- .../BotTestCompletionStatus/index.js | 18 +- .../index.js | 11 +- .../TestRenderer/OutputTextArea/index.jsx | 17 +- client/components/TestRenderer/index.jsx | 5 +- .../TestRun/CollectionJobContext.js | 10 +- .../TestRun/ReviewConflictsModal/index.jsx | 11 +- .../common/AssignTesterDropdown/index.jsx | 19 +- .../common/AtAndBrowserDetailsModal/index.jsx | 6 +- client/components/common/BasicModal/index.jsx | 13 +- .../common/BasicThemedModal/index.jsx | 8 +- .../common/ReportStatusSummary/index.jsx | 13 +- .../common/TestPlanResultsTable/index.jsx | 12 +- client/components/common/proptypes/index.js | 322 ++++++++++++++++++ client/tests/e2e/CandidateReview.e2e.test.js | 8 +- client/tests/e2e/DataManagement.e2e.test.js | 16 +- client/tests/e2e/Reports.e2e.test.js | 13 +- client/tests/e2e/TestPlanVersions.e2e.test.js | 14 +- client/tests/e2e/TestQueue.e2e.test.js | 10 +- client/tests/e2e/TestReview.e2e.test.js | 15 +- client/tests/e2e/TestRun.e2e.test.js | 11 +- client/tests/e2e/UserSettings.e2e.test.js | 21 +- client/tests/e2e/util/index.js | 26 +- 38 files changed, 519 insertions(+), 500 deletions(-) create mode 100644 client/components/common/proptypes/index.js diff --git a/client/components/DataManagement/DataManagementRow/index.jsx b/client/components/DataManagement/DataManagementRow/index.jsx index e597f5dfd..0705ed644 100644 --- a/client/components/DataManagement/DataManagementRow/index.jsx +++ b/client/components/DataManagement/DataManagementRow/index.jsx @@ -23,6 +23,11 @@ import VersionString from '../../common/VersionString'; import PhasePill from '../../common/PhasePill'; import { differenceBy, uniq as unique, uniqBy as uniqueBy } from 'lodash'; import { getVersionData } from '../utils'; +import { + AtPropType, + TestPlanPropType, + TestPlanVersionPropType +} from '../../common/proptypes'; const StatusCell = styled.div` display: flex; @@ -1089,32 +1094,9 @@ const DataManagementRow = ({ DataManagementRow.propTypes = { isAdmin: PropTypes.bool, - ats: PropTypes.arrayOf( - PropTypes.shape({ - id: PropTypes.string, - name: PropTypes.string - }) - ), - testPlan: PropTypes.shape({ - id: PropTypes.string, - title: PropTypes.string, - directory: PropTypes.string - }).isRequired, - testPlanVersions: PropTypes.arrayOf( - PropTypes.shape({ - id: PropTypes.string, - title: PropTypes.string, - phase: PropTypes.string, - gitSha: PropTypes.string, - testPlan: PropTypes.shape({ - directory: PropTypes.string - }), - updatedAt: PropTypes.string, - draftPhaseReachedAt: PropTypes.string, - candidatePhaseReachedAt: PropTypes.string, - recommendedPhaseReachedAt: PropTypes.string - }) - ).isRequired, + ats: PropTypes.arrayOf(AtPropType), + testPlan: TestPlanPropType.isRequired, + testPlanVersions: PropTypes.arrayOf(TestPlanVersionPropType).isRequired, tableRowIndex: PropTypes.number.isRequired, setTestPlanVersions: PropTypes.func }; diff --git a/client/components/ManageBotRunDialog/MarkBotRunFinishedButton/index.jsx b/client/components/ManageBotRunDialog/MarkBotRunFinishedButton/index.jsx index bcec9dd67..6a8fdec5d 100644 --- a/client/components/ManageBotRunDialog/MarkBotRunFinishedButton/index.jsx +++ b/client/components/ManageBotRunDialog/MarkBotRunFinishedButton/index.jsx @@ -10,6 +10,7 @@ import { LoadingStatus, useTriggerLoad } from '../../common/LoadingStatus'; import { useTestPlanRunValidatedAssertionCounts } from '../../../hooks/useTestPlanRunValidatedAssertionCounts'; import BasicModal from '../../common/BasicModal'; import { useTestPlanRunIsFinished } from '../../../hooks/useTestPlanRunIsFinished'; +import { TestPlanRunPropType } from '../../common/proptypes'; const MarkBotRunFinishedButton = ({ testPlanRun, onClick = () => {} }) => { const { @@ -86,7 +87,7 @@ const MarkBotRunFinishedButton = ({ testPlanRun, onClick = () => {} }) => { }; MarkBotRunFinishedButton.propTypes = { - testPlanRun: PropTypes.object.isRequired, + testPlanRun: TestPlanRunPropType.isRequired, onClick: PropTypes.func }; diff --git a/client/components/ManageBotRunDialog/RetryCanceledCollectionsButton/index.jsx b/client/components/ManageBotRunDialog/RetryCanceledCollectionsButton/index.jsx index a842b8142..947b480dd 100644 --- a/client/components/ManageBotRunDialog/RetryCanceledCollectionsButton/index.jsx +++ b/client/components/ManageBotRunDialog/RetryCanceledCollectionsButton/index.jsx @@ -3,6 +3,7 @@ import PropTypes from 'prop-types'; import { Button } from 'react-bootstrap'; import { useMutation } from '@apollo/client'; import { RETRY_CANCELED_COLLECTIONS } from '../queries'; +import { CollectionJobPropType } from '../../common/proptypes'; const RetryCanceledCollectionsButton = ({ collectionJob, @@ -33,16 +34,7 @@ const RetryCanceledCollectionsButton = ({ }; RetryCanceledCollectionsButton.propTypes = { - collectionJob: PropTypes.shape({ - id: PropTypes.string, - status: PropTypes.oneOf([ - 'QUEUED', - 'RUNNING', - 'CANCELLED', - 'COMPLETED', - 'ERROR' - ]) - }), + collectionJob: CollectionJobPropType, onClick: PropTypes.func }; diff --git a/client/components/ManageBotRunDialog/StopRunningCollectionButton/index.jsx b/client/components/ManageBotRunDialog/StopRunningCollectionButton/index.jsx index b985996fd..a1fa69c61 100644 --- a/client/components/ManageBotRunDialog/StopRunningCollectionButton/index.jsx +++ b/client/components/ManageBotRunDialog/StopRunningCollectionButton/index.jsx @@ -4,6 +4,7 @@ import { Button } from 'react-bootstrap'; import { useMutation } from '@apollo/client'; import { CANCEL_COLLECTION_JOB } from '../queries'; import { LoadingStatus, useTriggerLoad } from '../../common/LoadingStatus'; +import { CollectionJobPropType } from '../../common/proptypes'; const StopRunningCollectionButton = ({ collectionJob, onClick = () => {} }) => { if (!collectionJob) { @@ -44,16 +45,7 @@ const StopRunningCollectionButton = ({ collectionJob, onClick = () => {} }) => { }; StopRunningCollectionButton.propTypes = { - collectionJob: PropTypes.shape({ - id: PropTypes.string, - status: PropTypes.oneOf([ - 'QUEUED', - 'RUNNING', - 'CANCELLED', - 'COMPLETED', - 'ERROR' - ]).isRequired - }), + collectionJob: CollectionJobPropType, onClick: PropTypes.func }; diff --git a/client/components/ManageBotRunDialog/WithButton.jsx b/client/components/ManageBotRunDialog/WithButton.jsx index ea6f9018a..1eac6318a 100644 --- a/client/components/ManageBotRunDialog/WithButton.jsx +++ b/client/components/ManageBotRunDialog/WithButton.jsx @@ -5,6 +5,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faRobot } from '@fortawesome/free-solid-svg-icons'; import ManageBotRunDialog from '.'; import { useTestPlanRunIsFinished } from '../../hooks/useTestPlanRunIsFinished'; +import { TestPlanRunPropType, UserPropType } from '../common/proptypes'; const ManageBotRunDialogWithButton = ({ testPlanRun, @@ -49,10 +50,10 @@ const ManageBotRunDialogWithButton = ({ }; ManageBotRunDialogWithButton.propTypes = { - testPlanRun: PropTypes.object.isRequired, + testPlanRun: TestPlanRunPropType.isRequired, testPlanReportId: PropTypes.string.isRequired, runnableTestsLength: PropTypes.number.isRequired, - testers: PropTypes.array.isRequired, + testers: PropTypes.arrayOf(UserPropType).isRequired, onChange: PropTypes.func.isRequired }; diff --git a/client/components/ManageBotRunDialog/index.jsx b/client/components/ManageBotRunDialog/index.jsx index 154a8db6b..8915ad55b 100644 --- a/client/components/ManageBotRunDialog/index.jsx +++ b/client/components/ManageBotRunDialog/index.jsx @@ -16,6 +16,7 @@ import MarkBotRunFinishedButton from './MarkBotRunFinishedButton'; import RetryCanceledCollectionsButton from './RetryCanceledCollectionsButton'; import StopRunningCollectionButton from './StopRunningCollectionButton'; import ViewLogsButton from './ViewLogsButton'; +import { TestPlanRunPropType, UserPropType } from '../common/proptypes'; const ManageBotRunDialog = ({ testPlanReportId, @@ -177,10 +178,10 @@ const ManageBotRunDialog = ({ }; ManageBotRunDialog.propTypes = { - testPlanRun: PropTypes.object.isRequired, + testPlanRun: TestPlanRunPropType.isRequired, show: PropTypes.bool.isRequired, setShow: PropTypes.func.isRequired, - testers: PropTypes.array.isRequired, + testers: PropTypes.arrayOf(UserPropType).isRequired, testPlanReportId: PropTypes.string.isRequired, runnableTestsLength: PropTypes.number.isRequired, onChange: PropTypes.func.isRequired diff --git a/client/components/ManageTestQueue/ManageAtVersions.jsx b/client/components/ManageTestQueue/ManageAtVersions.jsx index 289293780..0cad9fdde 100644 --- a/client/components/ManageTestQueue/ManageAtVersions.jsx +++ b/client/components/ManageTestQueue/ManageAtVersions.jsx @@ -15,6 +15,7 @@ import { import { useTriggerLoad } from '@components/common/LoadingStatus'; import { THEMES, useThemedModal } from '@client/hooks/useThemedModal'; import PropTypes from 'prop-types'; +import { AtPropType } from '../common/proptypes'; const ManageAtVersions = ({ ats = [], triggerUpdate = () => {} }) => { const { triggerLoad } = useTriggerLoad(); @@ -410,20 +411,7 @@ const ManageAtVersions = ({ ats = [], triggerUpdate = () => {} }) => { }; ManageAtVersions.propTypes = { - ats: PropTypes.arrayOf( - PropTypes.shape({ - id: PropTypes.string.isRequired, - key: PropTypes.string.isRequired, - name: PropTypes.string.isRequired, - browsers: PropTypes.arrayOf( - PropTypes.shape({ - id: PropTypes.string.isRequired, - key: PropTypes.string.isRequired, - name: PropTypes.string.isRequired - }) - ).isRequired - }) - ).isRequired, + ats: PropTypes.arrayOf(AtPropType).isRequired, triggerUpdate: PropTypes.func }; diff --git a/client/components/ManageTestQueue/index.jsx b/client/components/ManageTestQueue/index.jsx index d5aa795af..3bf82420d 100644 --- a/client/components/ManageTestQueue/index.jsx +++ b/client/components/ManageTestQueue/index.jsx @@ -5,6 +5,7 @@ import { LoadingStatus, useTriggerLoad } from '../common/LoadingStatus'; import DisclosureComponent from '../common/DisclosureComponent'; import ManageAtVersions from '@components/ManageTestQueue/ManageAtVersions'; import AddTestPlans from '@components/ManageTestQueue/AddTestPlans'; +import { AtPropType, TestPlanVersionPropType } from '../common/proptypes'; export const DisclosureContainer = styled.div` // Following directives are related to the ManageTestQueue component @@ -148,21 +149,8 @@ const ManageTestQueue = ({ }; ManageTestQueue.propTypes = { - ats: PropTypes.arrayOf( - PropTypes.shape({ - id: PropTypes.string.isRequired, - key: PropTypes.string.isRequired, - name: PropTypes.string.isRequired, - browsers: PropTypes.arrayOf( - PropTypes.shape({ - id: PropTypes.string.isRequired, - key: PropTypes.string.isRequired, - name: PropTypes.string.isRequired - }) - ).isRequired - }) - ).isRequired, - testPlanVersions: PropTypes.array, + ats: PropTypes.arrayOf(AtPropType).isRequired, + testPlanVersions: PropTypes.arrayOf(TestPlanVersionPropType), triggerUpdate: PropTypes.func }; diff --git a/client/components/Reports/SummarizeTestPlanReport.jsx b/client/components/Reports/SummarizeTestPlanReport.jsx index cda558bc9..a6c9bb5e6 100644 --- a/client/components/Reports/SummarizeTestPlanReport.jsx +++ b/client/components/Reports/SummarizeTestPlanReport.jsx @@ -19,6 +19,10 @@ import TestPlanResultsTable from '../common/TestPlanResultsTable'; import DisclosureComponent from '../common/DisclosureComponent'; import { Link, Navigate, useLocation, useParams } from 'react-router-dom'; import createIssueLink from '../../utils/createIssueLink'; +import { + TestPlanReportPropType, + TestPlanVersionPropType +} from '../common/proptypes'; const ResultsContainer = styled.div` padding: 1em 1.75em; @@ -378,60 +382,8 @@ const SummarizeTestPlanReport = ({ testPlanVersion, testPlanReports }) => { }; SummarizeTestPlanReport.propTypes = { - testPlanVersion: PropTypes.object.isRequired, - testPlanReports: PropTypes.arrayOf( - PropTypes.shape({ - id: PropTypes.string.isRequired, - runnableTests: PropTypes.arrayOf(PropTypes.object.isRequired).isRequired, - at: PropTypes.shape({ - id: PropTypes.string.isRequired, - name: PropTypes.string.isRequired - }).isRequired, - browser: PropTypes.shape({ - id: PropTypes.string.isRequired, - name: PropTypes.string.isRequired - }).isRequired, - finalizedTestResults: PropTypes.arrayOf( - PropTypes.shape({ - id: PropTypes.string.isRequired, - test: PropTypes.shape({ - title: PropTypes.string.isRequired, - renderedUrl: PropTypes.string.isRequired - }).isRequired, - scenarioResults: PropTypes.arrayOf( - PropTypes.shape({ - id: PropTypes.string.isRequired, - output: PropTypes.string.isRequired, - assertionResults: PropTypes.arrayOf( - PropTypes.shape({ - id: PropTypes.string.isRequired, - passed: PropTypes.bool.isRequired, - assertion: PropTypes.shape({ - text: PropTypes.string.isRequired - }).isRequired - }).isRequired - ).isRequired, - unexpectedBehaviors: PropTypes.arrayOf( - PropTypes.shape({ - id: PropTypes.string.isRequired, - text: PropTypes.string.isRequired, - impact: PropTypes.string.isRequired, - details: PropTypes.string.isRequired - }).isRequired - ).isRequired - }).isRequired - ).isRequired - }).isRequired - ).isRequired, - draftTestPlanRuns: PropTypes.arrayOf( - PropTypes.shape({ - tester: PropTypes.shape({ - username: PropTypes.string.isRequired - }) - }) - ) - }).isRequired - ) + testPlanVersion: TestPlanVersionPropType.isRequired, + testPlanReports: PropTypes.arrayOf(TestPlanReportPropType).isRequired }; export default SummarizeTestPlanReport; diff --git a/client/components/Reports/SummarizeTestPlanReports.jsx b/client/components/Reports/SummarizeTestPlanReports.jsx index 26867cd5a..ee3e4bbf7 100644 --- a/client/components/Reports/SummarizeTestPlanReports.jsx +++ b/client/components/Reports/SummarizeTestPlanReports.jsx @@ -9,6 +9,7 @@ import { derivePhaseName } from '../../utils/aria'; import { none } from './None'; import { getTestPlanTargetTitle, getTestPlanVersionTitle } from './getTitles'; import ClippedProgressBar from '@components/common/ClippedProgressBar'; +import { TestPlanVersionPropType } from '../common/proptypes'; const FullHeightContainer = styled(Container)` min-height: calc(100vh - 64px); @@ -151,26 +152,7 @@ const SummarizeTestPlanReports = ({ testPlanVersions }) => { }; SummarizeTestPlanReports.propTypes = { - testPlanVersions: PropTypes.arrayOf( - PropTypes.shape({ - id: PropTypes.string.isRequired, - title: PropTypes.string.isRequired, - phase: PropTypes.string.isRequired, - gitSha: PropTypes.string, - testPlan: PropTypes.shape({ - directory: PropTypes.string - }), - metadata: PropTypes.object, - testPlanReports: PropTypes.arrayOf( - PropTypes.shape({ - id: PropTypes.string.isRequired, - metrics: PropTypes.object.isRequired, - at: PropTypes.object.isRequired, - browser: PropTypes.object.isRequired - }) - ) - }) - ).isRequired + testPlanVersions: PropTypes.arrayOf(TestPlanVersionPropType).isRequired }; export default SummarizeTestPlanReports; diff --git a/client/components/Reports/SummarizeTestPlanVersion.jsx b/client/components/Reports/SummarizeTestPlanVersion.jsx index 427980839..8ab2d48b8 100644 --- a/client/components/Reports/SummarizeTestPlanVersion.jsx +++ b/client/components/Reports/SummarizeTestPlanVersion.jsx @@ -12,6 +12,10 @@ import { faHome } from '@fortawesome/free-solid-svg-icons'; import styled from '@emotion/styled'; import DisclaimerInfo from '../DisclaimerInfo'; import { convertDateToString } from '../../utils/formatter'; +import { + TestPlanReportPropType, + TestPlanVersionPropType +} from '../common/proptypes'; const FullHeightContainer = styled(Container)` min-height: calc(100vh - 64px); @@ -184,26 +188,8 @@ const SummarizeTestPlanVersion = ({ testPlanVersion, testPlanReports }) => { }; SummarizeTestPlanVersion.propTypes = { - testPlanVersion: PropTypes.shape({ - gitSha: PropTypes.string, - testPlan: PropTypes.object, - directory: PropTypes.string, - versionString: PropTypes.string, - id: PropTypes.string.isRequired, - title: PropTypes.string, - phase: PropTypes.string, - metadata: PropTypes.shape({ - exampleUrl: PropTypes.string.isRequired, - designPatternUrl: PropTypes.string - }).isRequired - }).isRequired, - testPlanReports: PropTypes.arrayOf( - PropTypes.shape({ - id: PropTypes.string.isRequired, - runnableTests: PropTypes.arrayOf(PropTypes.object).isRequired, - finalizedTestResults: PropTypes.arrayOf(PropTypes.object) - }).isRequired - ).isRequired + testPlanVersion: TestPlanVersionPropType.isRequired, + testPlanReports: PropTypes.arrayOf(TestPlanReportPropType).isRequired }; export default SummarizeTestPlanVersion; diff --git a/client/components/ReviewConflicts/ReviewConflicts.jsx b/client/components/ReviewConflicts/ReviewConflicts.jsx index c97740dc2..f272c5663 100644 --- a/client/components/ReviewConflicts/ReviewConflicts.jsx +++ b/client/components/ReviewConflicts/ReviewConflicts.jsx @@ -2,6 +2,7 @@ import React, { useEffect, useRef } from 'react'; import PropTypes from 'prop-types'; import styled from '@emotion/styled'; import TurndownService from 'turndown'; +import { TestPlanReportPropType, TestPropType } from '../common/proptypes'; const Wrapper = styled.div` & h2 { @@ -119,58 +120,8 @@ const ReviewConflicts = ({ }; ReviewConflicts.propTypes = { - testPlanReport: PropTypes.shape({ - id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), - conflicts: PropTypes.arrayOf( - PropTypes.shape({ - source: PropTypes.shape({ - test: PropTypes.shape({ - id: PropTypes.string.isRequired - }).isRequired, - scenario: PropTypes.shape({ - id: PropTypes.string.isRequired, - commands: PropTypes.arrayOf( - PropTypes.shape({ - text: PropTypes.string.isRequired - }) - ).isRequired - }).isRequired, - assertion: PropTypes.shape({ - id: PropTypes.string.isRequired, - text: PropTypes.string.isRequired - }) - }).isRequired, - conflictingResults: PropTypes.arrayOf( - PropTypes.shape({ - testPlanRun: PropTypes.shape({ - id: PropTypes.string.isRequired, - tester: PropTypes.shape({ - username: PropTypes.string.isRequired - }).isRequired - }).isRequired, - scenarioResult: PropTypes.shape({ - output: PropTypes.string.isRequired, - unexpectedBehaviors: PropTypes.arrayOf( - PropTypes.shape({ - text: PropTypes.string.isRequired, - impact: PropTypes.string.isRequired, - details: PropTypes.string.isRequired - }) - ).isRequired - }), - assertionResult: PropTypes.shape({ - passed: PropTypes.bool.isRequired - }) - }) - ).isRequired - }) - ).isRequired - }), - test: PropTypes.shape({ - id: PropTypes.string.isRequired, - title: PropTypes.string.isRequired, - rowNumber: PropTypes.number.isRequired - }), + testPlanReport: TestPlanReportPropType.isRequired, + test: TestPropType.isRequired, hideHeadline: PropTypes.bool, conflictMarkdownRef: PropTypes.shape({ current: PropTypes.string diff --git a/client/components/TestPlanReportStatusDialog/index.jsx b/client/components/TestPlanReportStatusDialog/index.jsx index 37d109f0a..7bd981b0b 100644 --- a/client/components/TestPlanReportStatusDialog/index.jsx +++ b/client/components/TestPlanReportStatusDialog/index.jsx @@ -9,6 +9,7 @@ import BasicModal from '../common/BasicModal'; import './TestPlanReportStatusDialog.css'; import ReportStatusSummary from '../common/ReportStatusSummary'; import { AtVersion } from '../common/AtBrowserVersion'; +import { TestPlanVersionPropType } from '../common/proptypes'; const TestPlanReportStatusDialog = ({ testPlanVersion, @@ -147,37 +148,7 @@ const TestPlanReportStatusDialog = ({ }; TestPlanReportStatusDialog.propTypes = { - testPlanVersion: PropTypes.shape({ - id: PropTypes.string.isRequired, - title: PropTypes.string.isRequired, - phase: PropTypes.string.isRequired, - testPlanReportStatuses: PropTypes.arrayOf( - PropTypes.shape({ - at: PropTypes.shape({ - id: PropTypes.string.isRequired, - name: PropTypes.string.isRequired - }).isRequired, - browser: PropTypes.shape({ - id: PropTypes.string.isRequired, - name: PropTypes.string.isRequired - }).isRequired, - minimumAtVersion: PropTypes.shape({ - id: PropTypes.string.isRequired, - name: PropTypes.string.isRequired - }), - exactAtVersion: PropTypes.shape({ - id: PropTypes.string.isRequired, - name: PropTypes.string.isRequired - }), - testPlanReport: PropTypes.shape({ - id: PropTypes.string.isRequired, - status: PropTypes.string, - runnableTests: PropTypes.arrayOf(PropTypes.object), - finalizedTestResults: PropTypes.arrayOf(PropTypes.object) - }) - }).isRequired - ).isRequired - }).isRequired, + testPlanVersion: TestPlanVersionPropType.isRequired, handleHide: PropTypes.func.isRequired, triggerUpdate: PropTypes.func, show: PropTypes.bool.isRequired diff --git a/client/components/TestQueue/Actions.jsx b/client/components/TestQueue/Actions.jsx index c9ba177cc..444e244a6 100644 --- a/client/components/TestQueue/Actions.jsx +++ b/client/components/TestQueue/Actions.jsx @@ -22,6 +22,11 @@ import BasicThemedModal from '../common/BasicThemedModal'; import { evaluateAuth } from '../../utils/evaluateAuth'; import { TEST_PLAN_REPORT_STATUS_DIALOG_QUERY } from '../TestPlanReportStatusDialog/queries'; import ManageBotRunDialogWithButton from '@components/ManageBotRunDialog/WithButton'; +import { + TestPlanPropType, + TestPlanReportPropType, + UserPropType +} from '../common/proptypes'; const ActionContainer = styled.div` display: flex; @@ -296,42 +301,10 @@ const Actions = ({ }; Actions.propTypes = { - me: PropTypes.shape({ - id: PropTypes.string.isRequired, - username: PropTypes.string.isRequired - }), - testPlan: PropTypes.shape({ - directory: PropTypes.string.isRequired - }).isRequired, - testPlanReport: PropTypes.shape({ - id: PropTypes.string.isRequired, - runnableTestsLength: PropTypes.number.isRequired, - conflictsLength: PropTypes.number.isRequired, - draftTestPlanRuns: PropTypes.arrayOf( - PropTypes.shape({ - id: PropTypes.string.isRequired, - testResultsLength: PropTypes.number.isRequired, - tester: PropTypes.shape({ - id: PropTypes.string.isRequired, - username: PropTypes.string.isRequired, - isBot: PropTypes.bool.isRequired - }) - }) - ).isRequired - }).isRequired, - testers: PropTypes.arrayOf( - PropTypes.shape({ - id: PropTypes.string.isRequired, - username: PropTypes.string.isRequired, - isBot: PropTypes.bool.isRequired, - ats: PropTypes.arrayOf( - PropTypes.shape({ - id: PropTypes.string.isRequired, - key: PropTypes.string.isRequired - }) - ) - }) - ).isRequired, + me: UserPropType, + testPlan: TestPlanPropType.isRequired, + testPlanReport: TestPlanReportPropType.isRequired, + testers: PropTypes.arrayOf(UserPropType).isRequired, triggerUpdate: PropTypes.func.isRequired }; diff --git a/client/components/TestQueue/AssignTesters.jsx b/client/components/TestQueue/AssignTesters.jsx index 38f50c076..7e2c64c1a 100644 --- a/client/components/TestQueue/AssignTesters.jsx +++ b/client/components/TestQueue/AssignTesters.jsx @@ -19,6 +19,7 @@ import { } from './queries'; import { SCHEDULE_COLLECTION_JOB_MUTATION } from '../AddTestToQueueWithConfirmation/queries'; import { TEST_PLAN_REPORT_STATUS_DIALOG_QUERY } from '../TestPlanReportStatusDialog/queries'; +import { TestPlanReportPropType, UserPropType } from '../common/proptypes'; const AssignTestersContainer = styled.div` display: flex; @@ -328,56 +329,9 @@ const AssignTesters = ({ me, testers, testPlanReport }) => { }; AssignTesters.propTypes = { - me: PropTypes.shape({ - id: PropTypes.string.isRequired - }), - testers: PropTypes.arrayOf( - PropTypes.shape({ - id: PropTypes.string.isRequired, - username: PropTypes.string.isRequired, - isBot: PropTypes.bool.isRequired, - ats: PropTypes.arrayOf( - PropTypes.shape({ - id: PropTypes.string.isRequired, - key: PropTypes.string.isRequired - }) - ) - }) - ).isRequired, - testPlanReport: PropTypes.shape({ - id: PropTypes.string.isRequired, - runnableTestsLength: PropTypes.number.isRequired, - draftTestPlanRuns: PropTypes.arrayOf( - PropTypes.shape({ - tester: PropTypes.shape({ id: PropTypes.string.isRequired }).isRequired - }) - ).isRequired, - at: PropTypes.shape({ - id: PropTypes.string.isRequired, - name: PropTypes.string.isRequired, - key: PropTypes.string.isRequired, - atVersions: PropTypes.arrayOf( - PropTypes.shape({ - id: PropTypes.string.isRequired, - name: PropTypes.string.isRequired, - supportedByAutomation: PropTypes.bool.isRequired - }) - ) - }).isRequired, - browser: PropTypes.shape({ - id: PropTypes.string.isRequired, - name: PropTypes.string.isRequired, - key: PropTypes.string.isRequired - }).isRequired, - minimumAtVersion: PropTypes.shape({ - id: PropTypes.string.isRequired, - name: PropTypes.string.isRequired - }), - exactAtVersion: PropTypes.shape({ - id: PropTypes.string.isRequired, - name: PropTypes.string.isRequired - }) - }).isRequired + me: UserPropType, + testers: PropTypes.arrayOf(UserPropType).isRequired, + testPlanReport: TestPlanReportPropType.isRequired }; export default AssignTesters; diff --git a/client/components/TestQueue/CompletionStatusListItem/index.jsx b/client/components/TestQueue/CompletionStatusListItem/index.jsx index 98ed53eaa..2ba2c1818 100644 --- a/client/components/TestQueue/CompletionStatusListItem/index.jsx +++ b/client/components/TestQueue/CompletionStatusListItem/index.jsx @@ -4,6 +4,11 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faRobot } from '@fortawesome/free-solid-svg-icons'; import BotTestCompletionStatus from '@components/TestQueueCompletionStatusListItem/BotTestCompletionStatus'; import PreviouslyAutomatedTestCompletionStatus from '@components/TestQueueCompletionStatusListItem/PreviouslyAutomatedTestCompletionStatus'; +import { + TestPlanReportPropType, + TestPlanRunPropType, + UserPropType +} from '../../common/proptypes'; const CompletionStatusListItem = ({ rowId, @@ -67,20 +72,11 @@ const CompletionStatusListItem = ({ ); }; -// TODO: Update shape for testPlanReport and tester CompletionStatusListItem.propTypes = { rowId: PropTypes.string.isRequired, - testPlanReport: PropTypes.object.isRequired, - testPlanRun: PropTypes.shape({ - id: PropTypes.string.isRequired, - testResultsLength: PropTypes.number.isRequired, - initiatedByAutomation: PropTypes.bool.isRequired, - tester: PropTypes.shape({ - username: PropTypes.string.isRequired, - isBot: PropTypes.bool.isRequired - }).isRequired - }).isRequired, - tester: PropTypes.object.isRequired + testPlanReport: TestPlanReportPropType.isRequired, + testPlanRun: TestPlanRunPropType.isRequired, + tester: UserPropType.isRequired }; export default CompletionStatusListItem; diff --git a/client/components/TestQueueCompletionStatusListItem/BotTestCompletionStatus/index.js b/client/components/TestQueueCompletionStatusListItem/BotTestCompletionStatus/index.js index 0368b1165..e7e6f7b2e 100644 --- a/client/components/TestQueueCompletionStatusListItem/BotTestCompletionStatus/index.js +++ b/client/components/TestQueueCompletionStatusListItem/BotTestCompletionStatus/index.js @@ -1,6 +1,7 @@ import React, { useEffect } from 'react'; import PropTypes from 'prop-types'; import { useTestPlanRunValidatedAssertionCounts } from '../../../hooks/useTestPlanRunValidatedAssertionCounts'; +import { TestPlanRunPropType } from '../../common/proptypes'; const BotTestCompletionStatus = ({ testPlanRun, id, runnableTestsLength }) => { const { @@ -31,22 +32,7 @@ const BotTestCompletionStatus = ({ testPlanRun, id, runnableTestsLength }) => { }; BotTestCompletionStatus.propTypes = { - testPlanRun: PropTypes.shape({ - id: PropTypes.string.isRequired, - testResults: PropTypes.arrayOf( - PropTypes.shape({ - scenarioResults: PropTypes.arrayOf( - PropTypes.shape({ - assertionResults: PropTypes.arrayOf( - PropTypes.shape({ - passed: PropTypes.bool - }) - ) - }) - ) - }) - ) - }).isRequired, + testPlanRun: TestPlanRunPropType.isRequired, id: PropTypes.string.isRequired, runnableTestsLength: PropTypes.number.isRequired }; diff --git a/client/components/TestQueueCompletionStatusListItem/index.js b/client/components/TestQueueCompletionStatusListItem/index.js index 165ad5a47..1da90dfba 100644 --- a/client/components/TestQueueCompletionStatusListItem/index.js +++ b/client/components/TestQueueCompletionStatusListItem/index.js @@ -4,6 +4,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faRobot } from '@fortawesome/free-solid-svg-icons'; import BotTestCompletionStatus from './BotTestCompletionStatus'; import PreviouslyAutomatedTestCompletionStatus from './PreviouslyAutomatedTestCompletionStatus'; +import { TestPlanRunPropType } from '../common/proptypes'; const TestQueueCompletionStatusListItem = ({ runnableTestsLength, @@ -77,15 +78,7 @@ const TestQueueCompletionStatusListItem = ({ TestQueueCompletionStatusListItem.propTypes = { runnableTestsLength: PropTypes.number.isRequired, - testPlanRun: PropTypes.shape({ - id: PropTypes.string.isRequired, - testResultsLength: PropTypes.number.isRequired, - initiatedByAutomation: PropTypes.bool.isRequired, - tester: PropTypes.shape({ - username: PropTypes.string.isRequired, - isBot: PropTypes.bool.isRequired - }).isRequired - }).isRequired, + testPlanRun: TestPlanRunPropType.isRequired, id: PropTypes.string.isRequired }; diff --git a/client/components/TestRenderer/OutputTextArea/index.jsx b/client/components/TestRenderer/OutputTextArea/index.jsx index 62b173ab3..79dea9570 100644 --- a/client/components/TestRenderer/OutputTextArea/index.jsx +++ b/client/components/TestRenderer/OutputTextArea/index.jsx @@ -4,6 +4,7 @@ import styled from '@emotion/styled'; import { Feedback } from '..'; import { Form } from 'react-bootstrap'; import { NO_OUTPUT_STRING } from './constants'; +import { AtOutputPropType } from '../../common/proptypes'; const OutputTextAreaWrapper = styled.div` > textarea { @@ -85,21 +86,7 @@ const OutputTextArea = ({ OutputTextArea.propTypes = { commandIndex: PropTypes.number.isRequired, - atOutput: PropTypes.shape({ - description: PropTypes.arrayOf( - PropTypes.oneOfType([ - PropTypes.string, - PropTypes.shape({ - required: PropTypes.bool.isRequired, - highlightRequired: PropTypes.bool.isRequired, - description: PropTypes.string.isRequired - }) - ]) - ).isRequired, - value: PropTypes.string.isRequired, - change: PropTypes.func.isRequired, - focus: PropTypes.bool.isRequired - }).isRequired, + atOutput: AtOutputPropType.isRequired, readOnly: PropTypes.bool, isSubmitted: PropTypes.bool.isRequired }; diff --git a/client/components/TestRenderer/index.jsx b/client/components/TestRenderer/index.jsx index aac75c423..1780eac67 100644 --- a/client/components/TestRenderer/index.jsx +++ b/client/components/TestRenderer/index.jsx @@ -26,6 +26,7 @@ import AssertionsFieldset from './AssertionsFieldset'; import UnexpectedBehaviorsFieldset from './UnexpectedBehaviorsFieldset'; import supportJson from '../../resources/support.json'; import commandsJson from '../../resources/commands.json'; +import { AtPropType, TestResultPropType } from '../common/proptypes/index.js'; const Container = styled.div` width: 100%; @@ -580,8 +581,8 @@ ErrorComponent.propTypes = { }; TestRenderer.propTypes = { - at: PropTypes.object, - testResult: PropTypes.object, + at: AtPropType, + testResult: TestResultPropType, support: PropTypes.object, testPageUrl: PropTypes.string, testFormatVersion: PropTypes.number, diff --git a/client/components/TestRun/CollectionJobContext.js b/client/components/TestRun/CollectionJobContext.js index af16f4f83..2b5b69f9b 100644 --- a/client/components/TestRun/CollectionJobContext.js +++ b/client/components/TestRun/CollectionJobContext.js @@ -3,6 +3,7 @@ import React, { createContext, useState, useEffect } from 'react'; import { useLazyQuery } from '@apollo/client'; import { COLLECTION_JOB_UPDATES_QUERY } from './queries'; import { isJobStatusFinal } from '../../utils/collectionJobStatus'; +import { TestPlanRunPropType } from '../common/proptypes'; const pollInterval = 5000; export const Context = createContext({ @@ -60,12 +61,5 @@ export const Provider = ({ children, testPlanRun }) => { Provider.propTypes = { children: PropTypes.node, - testPlanRun: PropTypes.shape({ - id: PropTypes.string, - collectionJob: PropTypes.shape({ - id: PropTypes.string.isRequired, - status: PropTypes.string.isRequired, - testStatus: PropTypes.arrayOf(PropTypes.object).isRequired - }) - }) + testPlanRun: TestPlanRunPropType }; diff --git a/client/components/TestRun/ReviewConflictsModal/index.jsx b/client/components/TestRun/ReviewConflictsModal/index.jsx index 94dcf5b03..40e0ffd59 100644 --- a/client/components/TestRun/ReviewConflictsModal/index.jsx +++ b/client/components/TestRun/ReviewConflictsModal/index.jsx @@ -3,6 +3,11 @@ import PropTypes from 'prop-types'; import { Button, Modal } from 'react-bootstrap'; import styled from '@emotion/styled'; import ReviewConflicts from '../../ReviewConflicts'; +import { + TestPlanReportPropType, + TestPlanVersionPropType, + TestPropType +} from '../../common/proptypes'; const H2 = styled.h2` margin-top: 0; @@ -57,9 +62,9 @@ const ReviewConflictsModal = ({ ReviewConflictsModal.propTypes = { show: PropTypes.bool, - testPlanVersion: PropTypes.object.isRequired, - testPlanReport: PropTypes.object.isRequired, - test: PropTypes.object.isRequired, + testPlanVersion: TestPlanVersionPropType.isRequired, + testPlanReport: TestPlanReportPropType.isRequired, + test: TestPropType.isRequired, handleClose: PropTypes.func, conflictMarkdown: PropTypes.string, issueLink: PropTypes.string.isRequired diff --git a/client/components/common/AssignTesterDropdown/index.jsx b/client/components/common/AssignTesterDropdown/index.jsx index f576549fd..5d4cd9ceb 100644 --- a/client/components/common/AssignTesterDropdown/index.jsx +++ b/client/components/common/AssignTesterDropdown/index.jsx @@ -19,6 +19,7 @@ import { SCHEDULE_COLLECTION_JOB_MUTATION } from '../../AddTestToQueueWithConfir import { isSupportedByResponseCollector } from '../../../utils/automation'; import './AssignTesterDropdown.css'; +import { TestPlanRunPropType, UserPropType } from '../proptypes'; const AssignTesterDropdown = ({ testPlanReportId, @@ -209,23 +210,11 @@ const AssignTesterDropdown = ({ AssignTesterDropdown.propTypes = { testPlanReportId: PropTypes.string.isRequired, - possibleTesters: PropTypes.arrayOf( - PropTypes.shape({ - id: PropTypes.string.isRequired, - username: PropTypes.string.isRequired, - isBot: PropTypes.bool.isRequired, - ats: PropTypes.arrayOf( - PropTypes.shape({ - id: PropTypes.string.isRequired, - key: PropTypes.string.isRequired - }) - ) - }) - ).isRequired, + possibleTesters: PropTypes.arrayOf(UserPropType).isRequired, onChange: PropTypes.func.isRequired, - testPlanRun: PropTypes.object, + testPlanRun: TestPlanRunPropType, label: PropTypes.string, - draftTestPlanRuns: PropTypes.array, + draftTestPlanRuns: PropTypes.arrayOf(TestPlanRunPropType), setAlertMessage: PropTypes.func, dropdownAssignTesterButtonRef: PropTypes.object }; diff --git a/client/components/common/AtAndBrowserDetailsModal/index.jsx b/client/components/common/AtAndBrowserDetailsModal/index.jsx index 1d8894153..e26475e18 100644 --- a/client/components/common/AtAndBrowserDetailsModal/index.jsx +++ b/client/components/common/AtAndBrowserDetailsModal/index.jsx @@ -10,6 +10,7 @@ import { } from '@fortawesome/free-solid-svg-icons'; import { useDetectUa } from '../../../hooks/useDetectUa'; import BasicModal from '../BasicModal'; +import { AtVersionPropType } from '../proptypes'; const ModalInnerSectionContainer = styled.div` display: flex; @@ -596,10 +597,7 @@ AtAndBrowserDetailsModal.propTypes = { browserVersions: PropTypes.arrayOf(PropTypes.string), patternName: PropTypes.string, testerName: PropTypes.string, - exactAtVersion: PropTypes.shape({ - id: PropTypes.string.isRequired, - name: PropTypes.string.isRequired - }), + exactAtVersion: AtVersionPropType, handleClose: PropTypes.func, handleAction: PropTypes.func }; diff --git a/client/components/common/BasicModal/index.jsx b/client/components/common/BasicModal/index.jsx index fdb015742..1ed363537 100644 --- a/client/components/common/BasicModal/index.jsx +++ b/client/components/common/BasicModal/index.jsx @@ -6,6 +6,7 @@ import FocusTrapper from '../FocusTrapper'; import { uniqueId } from 'lodash'; import './BasicModal.css'; +import { ModalActionPropType } from '../proptypes'; const ModalTitleStyle = styled.h1` border: 0; @@ -133,17 +134,7 @@ BasicModal.propTypes = { handleHide: PropTypes.func, staticBackdrop: PropTypes.bool, useOnHide: PropTypes.bool, - actions: PropTypes.arrayOf( - PropTypes.shape({ - label: PropTypes.string, - onClick: PropTypes.func, - variant: PropTypes.string, - className: PropTypes.string, - testId: PropTypes.string, - component: PropTypes.elementType, - props: PropTypes.object - }) - ), + actions: PropTypes.arrayOf(ModalActionPropType), initialFocusRef: PropTypes.shape({ current: PropTypes.any }) diff --git a/client/components/common/BasicThemedModal/index.jsx b/client/components/common/BasicThemedModal/index.jsx index d2dafffb2..5c53c5edb 100644 --- a/client/components/common/BasicThemedModal/index.jsx +++ b/client/components/common/BasicThemedModal/index.jsx @@ -5,6 +5,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons'; import styled from '@emotion/styled'; import { uniqueId } from 'lodash'; +import { ActionButtonPropType } from '../proptypes'; const ModalTitleStyle = styled.h1` border: 0; @@ -122,12 +123,7 @@ BasicThemedModal.propTypes = { dialogClassName: PropTypes.string, title: PropTypes.node.isRequired, content: PropTypes.node.isRequired, - actionButtons: PropTypes.arrayOf( - PropTypes.shape({ - text: PropTypes.string, - action: PropTypes.func - }) - ), + actionButtons: PropTypes.arrayOf(ActionButtonPropType), closeLabel: PropTypes.string, handleClose: PropTypes.func, showCloseAction: PropTypes.bool diff --git a/client/components/common/ReportStatusSummary/index.jsx b/client/components/common/ReportStatusSummary/index.jsx index 6e1ebf29e..c89cff1e2 100644 --- a/client/components/common/ReportStatusSummary/index.jsx +++ b/client/components/common/ReportStatusSummary/index.jsx @@ -3,6 +3,7 @@ import PropTypes from 'prop-types'; import styled from '@emotion/styled'; import { convertDateToString } from '../../../utils/formatter'; import { calculatePercentComplete } from '../../../utils/calculatePercentComplete'; +import { TestPlanVersionPropType, TestPlanRunPropType } from '../proptypes'; const IncompleteStatusReport = styled.span` min-width: 5rem; @@ -74,20 +75,12 @@ const ReportStatusSummary = ({ }; ReportStatusSummary.propTypes = { - testPlanVersion: PropTypes.shape({ - id: PropTypes.string.isRequired - }).isRequired, + testPlanVersion: TestPlanVersionPropType.isRequired, testPlanReport: PropTypes.shape({ id: PropTypes.string.isRequired, markedFinalAt: PropTypes.string, metrics: PropTypes.object, - draftTestPlanRuns: PropTypes.arrayOf( - PropTypes.shape({ - tester: PropTypes.shape({ - username: PropTypes.string.isRequired - }).isRequired - }) - ).isRequired + draftTestPlanRuns: PropTypes.arrayOf(TestPlanRunPropType).isRequired }), fromTestQueue: PropTypes.bool }; diff --git a/client/components/common/TestPlanResultsTable/index.jsx b/client/components/common/TestPlanResultsTable/index.jsx index c29bcb688..1cd97a814 100644 --- a/client/components/common/TestPlanResultsTable/index.jsx +++ b/client/components/common/TestPlanResultsTable/index.jsx @@ -4,6 +4,7 @@ import { Table } from 'react-bootstrap'; import nextId from 'react-id-generator'; import { getMetrics } from 'shared'; import './TestPlanResultsTable.css'; +import { TestPropType, TestResultPropType } from '../proptypes'; const getAssertionResultText = (passed, priority) => { if (priority === 'MAY') { @@ -191,15 +192,8 @@ const TestPlanResultsTable = ({ }; TestPlanResultsTable.propTypes = { - test: PropTypes.shape({ - title: PropTypes.string.isRequired, - at: PropTypes.shape({ - name: PropTypes.string.isRequired - }).isRequired - }), - testResult: PropTypes.shape({ - scenarioResults: PropTypes.array.isRequired - }), + test: TestPropType.isRequired, + testResult: TestResultPropType.isRequired, tableClassName: PropTypes.string, optionalHeader: PropTypes.node, commandHeadingLevel: PropTypes.number diff --git a/client/components/common/proptypes/index.js b/client/components/common/proptypes/index.js new file mode 100644 index 000000000..2d80dddf2 --- /dev/null +++ b/client/components/common/proptypes/index.js @@ -0,0 +1,322 @@ +import PropTypes from 'prop-types'; + +export const AtPropType = PropTypes.shape({ + __typename: PropTypes.string, + id: PropTypes.string.isRequired, + key: PropTypes.string.isRequired, + name: PropTypes.string.isRequired +}); + +export const AtVersionPropType = PropTypes.shape({ + __typename: PropTypes.string, + id: PropTypes.string.isRequired, + name: PropTypes.string.isRequired, + releasedAt: PropTypes.string, + supportedByAutomation: PropTypes.bool +}); + +export const AssertionResultPropType = PropTypes.shape({ + __typename: PropTypes.string, + id: PropTypes.string.isRequired, + passed: PropTypes.bool.isRequired, + assertion: PropTypes.shape({ + id: PropTypes.string.isRequired, + text: PropTypes.string.isRequired, + phrase: PropTypes.string, + priority: PropTypes.string + }).isRequired +}); + +export const BrowserPropType = PropTypes.shape({ + __typename: PropTypes.string, + id: PropTypes.string.isRequired, + key: PropTypes.string.isRequired, + name: PropTypes.string.isRequired +}); + +export const BrowserVersionPropType = PropTypes.shape({ + __typename: PropTypes.string, + id: PropTypes.string.isRequired, + name: PropTypes.string.isRequired +}); + +export const CollectionJobPropType = PropTypes.shape({ + __typename: PropTypes.string, + id: PropTypes.string.isRequired, + status: PropTypes.oneOf([ + 'QUEUED', + 'RUNNING', + 'CANCELLED', + 'COMPLETED', + 'ERROR' + ]), + externalLogsUrl: PropTypes.string, + testStatus: PropTypes.arrayOf( + PropTypes.shape({ + test: PropTypes.shape({ + id: PropTypes.string.isRequired + }).isRequired, + status: PropTypes.string.isRequired + }) + ) +}); + +export const IssuePropType = PropTypes.shape({ + __typename: PropTypes.string, + link: PropTypes.string.isRequired, + isOpen: PropTypes.bool.isRequired, + feedbackType: PropTypes.string, + isCandidateReview: PropTypes.bool, + title: PropTypes.string, + author: PropTypes.string, + testNumberFilteredByAt: PropTypes.number, + createdAt: PropTypes.string, + closedAt: PropTypes.string +}); + +export const MePropType = PropTypes.shape({ + __typename: PropTypes.string, + id: PropTypes.string.isRequired, + username: PropTypes.string.isRequired, + roles: PropTypes.arrayOf(PropTypes.string) +}); + +export const ScenarioResultPropType = PropTypes.shape({ + __typename: PropTypes.string, + id: PropTypes.string.isRequired, + output: PropTypes.string, + scenario: PropTypes.shape({ + commands: PropTypes.arrayOf( + PropTypes.shape({ + id: PropTypes.string.isRequired, + text: PropTypes.string.isRequired, + atOperatingMode: PropTypes.string + }) + ).isRequired + }).isRequired, + assertionResults: PropTypes.arrayOf(AssertionResultPropType), + mustAssertionResults: PropTypes.arrayOf(AssertionResultPropType), + shouldAssertionResults: PropTypes.arrayOf(AssertionResultPropType), + mayAssertionResults: PropTypes.arrayOf(AssertionResultPropType), + unexpectedBehaviors: PropTypes.arrayOf( + PropTypes.shape({ + id: PropTypes.string.isRequired, + text: PropTypes.string.isRequired, + impact: PropTypes.string, + details: PropTypes.string + }) + ) +}); + +export const TestPropType = PropTypes.shape({ + __typename: PropTypes.string, + id: PropTypes.string.isRequired, + title: PropTypes.string.isRequired, + rowNumber: PropTypes.number, + renderedUrl: PropTypes.string, + testFormatVersion: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), + ats: PropTypes.arrayOf(AtPropType), + scenarios: PropTypes.arrayOf( + PropTypes.shape({ + id: PropTypes.string.isRequired, + at: AtPropType, + commands: PropTypes.arrayOf( + PropTypes.shape({ + id: PropTypes.string.isRequired, + text: PropTypes.string.isRequired, + atOperatingMode: PropTypes.string + }) + ) + }) + ), + assertions: PropTypes.arrayOf( + PropTypes.shape({ + id: PropTypes.string.isRequired, + text: PropTypes.string.isRequired, + phrase: PropTypes.string, + priority: PropTypes.string + }) + ) +}); + +export const TestPlanPropType = PropTypes.shape({ + __typename: PropTypes.string, + id: PropTypes.string.isRequired, + title: PropTypes.string.isRequired, + directory: PropTypes.string +}); + +export const TestPlanReportPropType = PropTypes.shape({ + __typename: PropTypes.string, + id: PropTypes.string.isRequired, + metrics: PropTypes.object, + isFinal: PropTypes.bool, + createdAt: PropTypes.string, + markedFinalAt: PropTypes.string, + conflictsLength: PropTypes.number, + runnableTestsLength: PropTypes.number +}); + +export const TestPlanReportConflictPropType = PropTypes.shape({ + __typename: PropTypes.string, + source: PropTypes.shape({ + test: PropTypes.shape({ + id: PropTypes.string.isRequired, + title: PropTypes.string.isRequired, + rowNumber: PropTypes.number + }).isRequired, + scenario: PropTypes.shape({ + id: PropTypes.string.isRequired, + commands: PropTypes.arrayOf( + PropTypes.shape({ + id: PropTypes.string.isRequired, + text: PropTypes.string.isRequired, + atOperatingMode: PropTypes.string + }) + ) + }).isRequired, + assertion: PropTypes.shape({ + id: PropTypes.string.isRequired, + text: PropTypes.string.isRequired, + phrase: PropTypes.string, + priority: PropTypes.string + }).isRequired + }).isRequired, + conflictingResults: PropTypes.arrayOf( + PropTypes.shape({ + testPlanRun: PropTypes.shape({ + id: PropTypes.string.isRequired, + tester: PropTypes.shape({ + username: PropTypes.string.isRequired + }).isRequired + }).isRequired, + scenarioResult: PropTypes.shape({ + output: PropTypes.string, + unexpectedBehaviors: PropTypes.arrayOf( + PropTypes.shape({ + id: PropTypes.string.isRequired, + text: PropTypes.string.isRequired, + impact: PropTypes.string, + details: PropTypes.string + }) + ) + }), + assertionResult: PropTypes.shape({ + passed: PropTypes.bool.isRequired + }).isRequired + }) + ).isRequired +}); + +export const TestPlanReportStatusPropType = PropTypes.shape({ + __typename: PropTypes.string, + isRequired: PropTypes.bool, + at: AtPropType, + browser: BrowserPropType, + minimumAtVersion: AtVersionPropType, + exactAtVersion: AtVersionPropType, + testPlanReport: PropTypes.shape({ + id: PropTypes.string.isRequired, + metrics: PropTypes.object, + isFinal: PropTypes.bool, + markedFinalAt: PropTypes.string, + issues: PropTypes.arrayOf(IssuePropType), + draftTestPlanRuns: PropTypes.arrayOf( + PropTypes.shape({ + tester: PropTypes.shape({ + username: PropTypes.string.isRequired + }).isRequired, + testPlanReport: PropTypes.shape({ + id: PropTypes.string.isRequired + }).isRequired, + testResults: PropTypes.arrayOf( + PropTypes.shape({ + test: PropTypes.shape({ + id: PropTypes.string.isRequired + }).isRequired, + atVersion: AtVersionPropType, + browserVersion: BrowserVersionPropType, + completedAt: PropTypes.string + }) + ) + }) + ) + }).isRequired +}); + +export const TestPlanRunPropType = PropTypes.shape({ + __typename: PropTypes.string, + id: PropTypes.string, + initiatedByAutomation: PropTypes.bool, + tester: PropTypes.shape({ + id: PropTypes.string, + username: PropTypes.string.isRequired, + isBot: PropTypes.bool + }).isRequired +}); + +export const TestPlanVersionPropType = PropTypes.shape({ + __typename: PropTypes.string, + id: PropTypes.string.isRequired, + title: PropTypes.string.isRequired, + phase: PropTypes.string, + gitSha: PropTypes.string, + gitMessage: PropTypes.string, + versionString: PropTypes.string, + updatedAt: PropTypes.string, + draftPhaseReachedAt: PropTypes.string, + candidatePhaseReachedAt: PropTypes.string, + recommendedPhaseReachedAt: PropTypes.string, + recommendedPhaseTargetDate: PropTypes.string, + deprecatedAt: PropTypes.string, + testPageUrl: PropTypes.string, + metadata: PropTypes.object, + testPlan: PropTypes.shape({ + directory: PropTypes.string + }).isRequired +}); + +export const TestResultPropType = PropTypes.shape({ + __typename: PropTypes.string, + id: PropTypes.string.isRequired, + startedAt: PropTypes.string, + completedAt: PropTypes.string +}); + +export const UserPropType = PropTypes.shape({ + __typename: PropTypes.string, + id: PropTypes.string.isRequired, + username: PropTypes.string.isRequired, + isBot: PropTypes.bool +}); + +export const ModalActionPropType = PropTypes.shape({ + label: PropTypes.string, + onClick: PropTypes.func, + variant: PropTypes.string, + className: PropTypes.string, + testId: PropTypes.string, + component: PropTypes.elementType, + props: PropTypes.object +}); + +export const ActionButtonPropType = PropTypes.shape({ + label: PropTypes.string, + action: PropTypes.func +}); + +export const AtOutputPropType = PropTypes.shape({ + description: PropTypes.arrayOf( + PropTypes.oneOfType([ + PropTypes.string, + PropTypes.shape({ + required: PropTypes.bool.isRequired, + highlightRequired: PropTypes.bool.isRequired, + description: PropTypes.string.isRequired + }) + ]) + ).isRequired, + value: PropTypes.string.isRequired, + change: PropTypes.func.isRequired, + focus: PropTypes.bool.isRequired +}); diff --git a/client/tests/e2e/CandidateReview.e2e.test.js b/client/tests/e2e/CandidateReview.e2e.test.js index 63894da9a..d11a25abb 100644 --- a/client/tests/e2e/CandidateReview.e2e.test.js +++ b/client/tests/e2e/CandidateReview.e2e.test.js @@ -1,5 +1,5 @@ import getPage from '../util/getPage'; -import { text, display } from './util'; +import { text, display, checkConsoleErrors } from './util'; describe('Candidate Review when not signed in or tester', () => { it('does not render page if signed out', async () => { @@ -26,7 +26,11 @@ describe('Candidate Review when not signed in or tester', () => { describe('Candidate Review when signed in as vendor', () => { it('renders page if signed in', async () => { await getPage({ role: 'vendor', url: '/candidate-review' }, async page => { - await page.waitForSelector('h1 ::-p-text(Candidate Review)'); + const errors = await checkConsoleErrors(page, async () => { + await page.waitForSelector('h1 ::-p-text(Candidate Review)'); + }); + + expect(errors).toHaveLength(0); // Get section's disclosure titles await page.waitForSelector('h3 button ::-p-text(JAWS)'); diff --git a/client/tests/e2e/DataManagement.e2e.test.js b/client/tests/e2e/DataManagement.e2e.test.js index 7032bdc1b..827ab8b84 100644 --- a/client/tests/e2e/DataManagement.e2e.test.js +++ b/client/tests/e2e/DataManagement.e2e.test.js @@ -1,5 +1,5 @@ import getPage from '../util/getPage'; -import { text } from './util'; +import { checkConsoleErrors, text } from './util'; describe('Data Management common traits', () => { it('renders page h1', async () => { @@ -12,10 +12,15 @@ describe('Data Management common traits', () => { it('renders page with introduction', async () => { await getPage({ role: false, url: '/data-management' }, async page => { const introductionHeadingSelector = 'h2 ::-p-text(Introduction)'; - const introductionHeadingText = await text( - page, - introductionHeadingSelector - ); + const errors = await checkConsoleErrors(page, async () => { + const introductionHeadingText = await text( + page, + introductionHeadingSelector + ); + expect(introductionHeadingText).toBe('Introduction'); + }); + + expect(errors).toHaveLength(0); const introductionContentSelector = '[data-testid="data-management-instructions"]'; @@ -24,7 +29,6 @@ describe('Data Management common traits', () => { introductionContentSelector ); - expect(introductionHeadingText).toBe('Introduction'); expect(introductionContentText).toMatch( /This page provides a view of the latest test plan version information, and where they currently are in the ARIA-AT Community Group’s review process\./ ); diff --git a/client/tests/e2e/Reports.e2e.test.js b/client/tests/e2e/Reports.e2e.test.js index a89961592..094d7ec65 100644 --- a/client/tests/e2e/Reports.e2e.test.js +++ b/client/tests/e2e/Reports.e2e.test.js @@ -1,12 +1,17 @@ import getPage from '../util/getPage'; -import { text } from './util'; +import { checkConsoleErrors, text } from './util'; describe('Reports page', () => { it('renders reports page', async () => { await getPage({ role: false, url: '/reports' }, async page => { - await page.waitForSelector( - 'h1 ::-p-text(Assistive Technology Interoperability Reports)' - ); + const errors = await checkConsoleErrors(page, async () => { + await page.waitForSelector( + 'h1 ::-p-text(Assistive Technology Interoperability Reports)' + ); + }); + + expect(errors).toHaveLength(0); + await page.waitForSelector('h2 ::-p-text(Introduction)'); await page.waitForSelector('h2 ::-p-text(Support Levels)'); diff --git a/client/tests/e2e/TestPlanVersions.e2e.test.js b/client/tests/e2e/TestPlanVersions.e2e.test.js index 11763657a..7ac70b430 100644 --- a/client/tests/e2e/TestPlanVersions.e2e.test.js +++ b/client/tests/e2e/TestPlanVersions.e2e.test.js @@ -1,15 +1,19 @@ import getPage from '../util/getPage'; -import { text } from './util'; +import { checkConsoleErrors, text } from './util'; describe('Versions page for pattern with highest report being recommended', () => { it('renders page h1', async () => { await getPage( { role: false, url: '/data-management/checkbox-tri-state' }, async page => { - await text( - page, - 'h1 ::-p-text(Checkbox Example (Tri State) Test Plan Versions)' - ); + const errors = await checkConsoleErrors(page, async () => { + await text( + page, + 'h1 ::-p-text(Checkbox Example (Tri State) Test Plan Versions)' + ); + }); + + expect(errors).toHaveLength(0); } ); }); diff --git a/client/tests/e2e/TestQueue.e2e.test.js b/client/tests/e2e/TestQueue.e2e.test.js index 4e9793d69..83125c3b3 100644 --- a/client/tests/e2e/TestQueue.e2e.test.js +++ b/client/tests/e2e/TestQueue.e2e.test.js @@ -1,5 +1,5 @@ import getPage from '../util/getPage'; -import { text, display } from './util'; +import { text, display, checkConsoleErrors } from './util'; describe('Test Queue common traits', () => { it('renders page h1', async () => { @@ -13,8 +13,12 @@ describe('Test Queue common traits', () => { describe('Test Queue admin traits when reports exist', () => { it('renders page h1', async () => { await getPage({ role: 'admin', url: '/test-queue' }, async page => { - const h1Element = await text(page, 'h1'); - expect(h1Element).toBe('Test Queue'); + const errors = await checkConsoleErrors(page, async () => { + const h1Element = await text(page, 'h1'); + expect(h1Element).toBe('Test Queue'); + }); + + expect(errors).toHaveLength(0); }); }); diff --git a/client/tests/e2e/TestReview.e2e.test.js b/client/tests/e2e/TestReview.e2e.test.js index de41c77b2..5d245d1be 100644 --- a/client/tests/e2e/TestReview.e2e.test.js +++ b/client/tests/e2e/TestReview.e2e.test.js @@ -1,5 +1,5 @@ import getPage from '../util/getPage'; -import { text } from './util'; +import { checkConsoleErrors, text } from './util'; describe('Test Review page', () => { const getReviewPageElements = async (page, { isV2 = false } = {}) => { @@ -41,10 +41,15 @@ describe('Test Review page', () => { it('renders page for review page before test format v2', async () => { await getPage({ role: false, url: '/test-review/1' }, async page => { - await text( - page, - 'h1 ::-p-text(Alert Example Test Plan V22.04.14 (Deprecated))' - ); + const errors = await checkConsoleErrors(page, async () => { + await text( + page, + 'h1 ::-p-text(Alert Example Test Plan V22.04.14 (Deprecated))' + ); + }); + + expect(errors).toHaveLength(0); + await getReviewPageElements(page); }); }); diff --git a/client/tests/e2e/TestRun.e2e.test.js b/client/tests/e2e/TestRun.e2e.test.js index 5bb9453b3..dd5721571 100644 --- a/client/tests/e2e/TestRun.e2e.test.js +++ b/client/tests/e2e/TestRun.e2e.test.js @@ -1,5 +1,5 @@ import getPage from '../util/getPage'; -import { text } from './util'; +import { checkConsoleErrors, text } from './util'; describe('Test Run when not signed in', () => { it('renders invalid request when attempting to go directly to /run/:id', async () => { @@ -15,7 +15,13 @@ describe('Test Run when not signed in', () => { it('renders /test-plan-report/:id and can navigate between tests', async () => { // This should be NVDA + Chrome + Modal Dialog Example with 12 tests await getPage({ role: false, url: '/test-plan-report/19' }, async page => { - const h1Text = await text(page, 'h1'); + const errors = await checkConsoleErrors(page, async () => { + const h1Text = await text(page, 'h1'); + expect(h1Text.includes('Test 1:')).toBe(true); + }); + + expect(errors).toHaveLength(0); + const currentUrl = await page.url(); await page.waitForSelector('nav#test-navigator-nav ol'); @@ -57,7 +63,6 @@ describe('Test Run when not signed in', () => { await page.waitForSelector(`h3 ::-p-text(After)`); } - expect(h1Text.includes('Test 1:')).toBe(true); expect(currentUrl.includes('/test-plan-report/19')).toBe(true); expect(listItemsLength).toBeGreaterThan(1); }); diff --git a/client/tests/e2e/UserSettings.e2e.test.js b/client/tests/e2e/UserSettings.e2e.test.js index 49257f7a9..42fa35b10 100644 --- a/client/tests/e2e/UserSettings.e2e.test.js +++ b/client/tests/e2e/UserSettings.e2e.test.js @@ -1,5 +1,5 @@ import getPage from '../util/getPage'; -import { text } from './util'; +import { checkConsoleErrors, text } from './util'; describe('User Settings when not signed in', () => { it('does not render page if signed out', async () => { @@ -45,10 +45,18 @@ describe('User Settings common traits', () => { it('renders testable assistive technologies status and update on save', async () => { await getPage({ role: 'tester', url: '/account/settings' }, async page => { - const testableAtsStatusTextBeforeSave = await text( - page, - 'p[data-testid="testable-ats-status"]' - ); + const errors = await checkConsoleErrors(page, async () => { + const testableAtsStatusTextBeforeSave = await text( + page, + 'p[data-testid="testable-ats-status"]' + ); + expect(testableAtsStatusTextBeforeSave).toBe( + 'You have not yet selected any assistive technologies.' + ); + }); + + expect(errors).toHaveLength(0); + const jawsOptionSelector = 'input[id="1"][type="checkbox"]'; const nvdaOptionSelector = 'input[id="2"][type="checkbox"]'; const saveButtonSelector = 'button[type="submit"]'; @@ -70,9 +78,6 @@ describe('User Settings common traits', () => { }); expect(saveButtonText).toBe('Save'); - expect(testableAtsStatusTextBeforeSave).toBe( - 'You have not yet selected any assistive technologies.' - ); expect(testableAtsStatusTextAfterSave).toBe( 'You can currently test the following assistive technologies:' ); diff --git a/client/tests/e2e/util/index.js b/client/tests/e2e/util/index.js index 43411e792..3915b9dd7 100644 --- a/client/tests/e2e/util/index.js +++ b/client/tests/e2e/util/index.js @@ -11,7 +11,31 @@ const display = async (page, selector, { wait = true } = {}) => { }); }; +/** + * Checks for errors on a given page + * @param {Page} page - Puppeteer page object + * @param {Function} action - Async function to perform actions that might trigger PropType errors + * @param {number} [timeout=500] - Timeout in milliseconds to wait for errors + * @returns {Promise} - Array of error messages, if any + */ +async function checkConsoleErrors(page, action, timeout = 5000) { + let errors = []; + + page.on('console', msg => { + if (msg.type() === 'error') { + errors.push(msg.text()); + } + }); + + await action(); + + await page.waitForTimeout(timeout); + + return errors; +} + module.exports = { text, - display + display, + checkConsoleErrors }; From 59736cc7a75dd9d15a88de085906412f24581921 Mon Sep 17 00:00:00 2001 From: Stalgia Grigg Date: Thu, 1 Aug 2024 19:21:19 -0400 Subject: [PATCH 02/11] Update error catch timeout --- client/tests/e2e/util/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/tests/e2e/util/index.js b/client/tests/e2e/util/index.js index 3915b9dd7..3cd868763 100644 --- a/client/tests/e2e/util/index.js +++ b/client/tests/e2e/util/index.js @@ -18,7 +18,7 @@ const display = async (page, selector, { wait = true } = {}) => { * @param {number} [timeout=500] - Timeout in milliseconds to wait for errors * @returns {Promise} - Array of error messages, if any */ -async function checkConsoleErrors(page, action, timeout = 5000) { +async function checkConsoleErrors(page, action, timeout = 500) { let errors = []; page.on('console', msg => { From 59ffe642adc708973c65c809ea2eb95a630e5460 Mon Sep 17 00:00:00 2001 From: Stalgia Grigg Date: Mon, 5 Aug 2024 16:31:11 -0700 Subject: [PATCH 03/11] Return console errors with callback --- .../DataManagementRow/index.jsx | 9 +- client/components/common/proptypes/index.js | 4 +- client/tests/e2e/CandidateReview.e2e.test.js | 71 +++++++-------- client/tests/e2e/DataManagement.e2e.test.js | 35 ++++---- client/tests/e2e/Reports.e2e.test.js | 45 +++++----- client/tests/e2e/TestPlanVersions.e2e.test.js | 16 ++-- client/tests/e2e/TestQueue.e2e.test.js | 29 +++--- client/tests/e2e/TestReview.e2e.test.js | 16 ++-- client/tests/e2e/TestRun.e2e.test.js | 90 +++++++++---------- client/tests/e2e/UserSettings.e2e.test.js | 59 ++++++------ client/tests/e2e/util/index.js | 26 +----- client/tests/util/getPage.js | 14 ++- 12 files changed, 207 insertions(+), 207 deletions(-) diff --git a/client/components/DataManagement/DataManagementRow/index.jsx b/client/components/DataManagement/DataManagementRow/index.jsx index 0705ed644..eecaeec2e 100644 --- a/client/components/DataManagement/DataManagementRow/index.jsx +++ b/client/components/DataManagement/DataManagementRow/index.jsx @@ -1096,7 +1096,14 @@ DataManagementRow.propTypes = { isAdmin: PropTypes.bool, ats: PropTypes.arrayOf(AtPropType), testPlan: TestPlanPropType.isRequired, - testPlanVersions: PropTypes.arrayOf(TestPlanVersionPropType).isRequired, + testPlanVersions: PropTypes.arrayOf( + PropTypes.shape({ + ...TestPlanVersionPropType, + // Optional in this component + title: PropTypes.string, + isRequired: PropTypes.bool + }) + ), tableRowIndex: PropTypes.number.isRequired, setTestPlanVersions: PropTypes.func }; diff --git a/client/components/common/proptypes/index.js b/client/components/common/proptypes/index.js index 2d80dddf2..7d98d1d78 100644 --- a/client/components/common/proptypes/index.js +++ b/client/components/common/proptypes/index.js @@ -278,9 +278,9 @@ export const TestPlanVersionPropType = PropTypes.shape({ export const TestResultPropType = PropTypes.shape({ __typename: PropTypes.string, - id: PropTypes.string.isRequired, + id: PropTypes.string, startedAt: PropTypes.string, - completedAt: PropTypes.string + completedAt: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]) }); export const UserPropType = PropTypes.shape({ diff --git a/client/tests/e2e/CandidateReview.e2e.test.js b/client/tests/e2e/CandidateReview.e2e.test.js index d11a25abb..98c7811c1 100644 --- a/client/tests/e2e/CandidateReview.e2e.test.js +++ b/client/tests/e2e/CandidateReview.e2e.test.js @@ -1,5 +1,5 @@ import getPage from '../util/getPage'; -import { text, display, checkConsoleErrors } from './util'; +import { text, display } from './util'; describe('Candidate Review when not signed in or tester', () => { it('does not render page if signed out', async () => { @@ -25,42 +25,43 @@ describe('Candidate Review when not signed in or tester', () => { describe('Candidate Review when signed in as vendor', () => { it('renders page if signed in', async () => { - await getPage({ role: 'vendor', url: '/candidate-review' }, async page => { - const errors = await checkConsoleErrors(page, async () => { + await getPage( + { role: 'vendor', url: '/candidate-review' }, + async (page, { consoleErrors }) => { await page.waitForSelector('h1 ::-p-text(Candidate Review)'); - }); - - expect(errors).toHaveLength(0); - - // Get section's disclosure titles - await page.waitForSelector('h3 button ::-p-text(JAWS)'); - await page.waitForSelector('h3 button ::-p-text(NVDA)'); - await page.waitForSelector('h3 button ::-p-text(VoiceOver for macOS)'); - // Check for table headings - await page.waitForSelector('th ::-p-text(Candidate Test Plans)'); - await page.waitForSelector('th ::-p-text(Last Updated)'); - await page.waitForSelector('th ::-p-text(Target Completion Date)'); - await page.waitForSelector('th ::-p-text(Review Status)'); - await page.waitForSelector('th ::-p-text(Results Summary)'); - - await page.waitForSelector('h3 ::-p-text(Review Status Summary)'); - - // Test disclosure collapse interaction - const tableDisclosureContainerSelector = 'div#expand-at-1'; - const initialDisplayForTableDisclosureContainer = await display( - page, - tableDisclosureContainerSelector - ); - await page.click('h3 button ::-p-text(JAWS)'); - const afterClickDisplayForTableDisclosureContainer = await display( - page, - tableDisclosureContainerSelector - ); - - expect(initialDisplayForTableDisclosureContainer).not.toBe('none'); - expect(afterClickDisplayForTableDisclosureContainer).toBe('none'); - }); + // Get section's disclosure titles + await page.waitForSelector('h3 button ::-p-text(JAWS)'); + await page.waitForSelector('h3 button ::-p-text(NVDA)'); + await page.waitForSelector('h3 button ::-p-text(VoiceOver for macOS)'); + + // Check for table headings + await page.waitForSelector('th ::-p-text(Candidate Test Plans)'); + await page.waitForSelector('th ::-p-text(Last Updated)'); + await page.waitForSelector('th ::-p-text(Target Completion Date)'); + await page.waitForSelector('th ::-p-text(Review Status)'); + await page.waitForSelector('th ::-p-text(Results Summary)'); + + await page.waitForSelector('h3 ::-p-text(Review Status Summary)'); + + // Test disclosure collapse interaction + const tableDisclosureContainerSelector = 'div#expand-at-1'; + const initialDisplayForTableDisclosureContainer = await display( + page, + tableDisclosureContainerSelector + ); + await page.click('h3 button ::-p-text(JAWS)'); + const afterClickDisplayForTableDisclosureContainer = await display( + page, + tableDisclosureContainerSelector + ); + + expect(initialDisplayForTableDisclosureContainer).not.toBe('none'); + expect(afterClickDisplayForTableDisclosureContainer).toBe('none'); + + expect(consoleErrors).toHaveLength(0); + } + ); }); it('navigates to candidate test plan run page', async () => { diff --git a/client/tests/e2e/DataManagement.e2e.test.js b/client/tests/e2e/DataManagement.e2e.test.js index 827ab8b84..043a0263a 100644 --- a/client/tests/e2e/DataManagement.e2e.test.js +++ b/client/tests/e2e/DataManagement.e2e.test.js @@ -1,5 +1,5 @@ import getPage from '../util/getPage'; -import { checkConsoleErrors, text } from './util'; +import { text } from './util'; describe('Data Management common traits', () => { it('renders page h1', async () => { @@ -10,29 +10,32 @@ describe('Data Management common traits', () => { }); it('renders page with introduction', async () => { - await getPage({ role: false, url: '/data-management' }, async page => { - const introductionHeadingSelector = 'h2 ::-p-text(Introduction)'; - const errors = await checkConsoleErrors(page, async () => { + await getPage( + { role: false, url: '/data-management' }, + async (page, { consoleErrors }) => { + const introductionHeadingSelector = 'h2 ::-p-text(Introduction)'; const introductionHeadingText = await text( page, introductionHeadingSelector ); expect(introductionHeadingText).toBe('Introduction'); - }); - expect(errors).toHaveLength(0); + expect(consoleErrors).toHaveLength(0); - const introductionContentSelector = - '[data-testid="data-management-instructions"]'; - const introductionContentText = await text( - page, - introductionContentSelector - ); + const introductionContentSelector = + '[data-testid="data-management-instructions"]'; + const introductionContentText = await text( + page, + introductionContentSelector + ); - expect(introductionContentText).toMatch( - /This page provides a view of the latest test plan version information, and where they currently are in the ARIA-AT Community Group’s review process\./ - ); - }); + expect(introductionContentText).toMatch( + /This page provides a view of the latest test plan version information, and where they currently are in the ARIA-AT Community Group’s review process\./ + ); + + expect(consoleErrors).toHaveLength(0); + } + ); }); it('renders page with Test Plan Status Summary heading and table', async () => { diff --git a/client/tests/e2e/Reports.e2e.test.js b/client/tests/e2e/Reports.e2e.test.js index 094d7ec65..92bc8ab04 100644 --- a/client/tests/e2e/Reports.e2e.test.js +++ b/client/tests/e2e/Reports.e2e.test.js @@ -1,37 +1,38 @@ import getPage from '../util/getPage'; -import { checkConsoleErrors, text } from './util'; +import { text } from './util'; describe('Reports page', () => { it('renders reports page', async () => { - await getPage({ role: false, url: '/reports' }, async page => { - const errors = await checkConsoleErrors(page, async () => { + await getPage( + { role: false, url: '/reports' }, + async (page, { consoleErrors }) => { await page.waitForSelector( 'h1 ::-p-text(Assistive Technology Interoperability Reports)' ); - }); - expect(errors).toHaveLength(0); + await page.waitForSelector('h2 ::-p-text(Introduction)'); + await page.waitForSelector('h2 ::-p-text(Support Levels)'); - await page.waitForSelector('h2 ::-p-text(Introduction)'); - await page.waitForSelector('h2 ::-p-text(Support Levels)'); + const tableRowsLength = await page.$eval( + 'table[aria-label="Support Levels"]', + el => Array.from(el.rows).length + ); - const tableRowsLength = await page.$eval( - 'table[aria-label="Support Levels"]', - el => Array.from(el.rows).length - ); + // Check that the currently 'required' reports combinations exist; these + // combinations must exist in the table to be on this page + await page.waitForSelector('th ::-p-text(Test Plan)'); + await page.waitForSelector('th ::-p-text(JAWS and Chrome)'); + await page.waitForSelector('th ::-p-text(NVDA and Chrome)'); + await page.waitForSelector( + 'th ::-p-text(VoiceOver for macOS and Safari)' + ); - // Check that the currently 'required' reports combinations exist; these - // combinations must exist in the table to be on this page - await page.waitForSelector('th ::-p-text(Test Plan)'); - await page.waitForSelector('th ::-p-text(JAWS and Chrome)'); - await page.waitForSelector('th ::-p-text(NVDA and Chrome)'); - await page.waitForSelector( - 'th ::-p-text(VoiceOver for macOS and Safari)' - ); + // There is more than just the thead row + expect(tableRowsLength).toBeGreaterThan(1); - // There is more than just the thead row - expect(tableRowsLength).toBeGreaterThan(1); - }); + expect(consoleErrors).toHaveLength(0); + } + ); }); }); diff --git a/client/tests/e2e/TestPlanVersions.e2e.test.js b/client/tests/e2e/TestPlanVersions.e2e.test.js index 7ac70b430..958e1d27e 100644 --- a/client/tests/e2e/TestPlanVersions.e2e.test.js +++ b/client/tests/e2e/TestPlanVersions.e2e.test.js @@ -1,19 +1,17 @@ import getPage from '../util/getPage'; -import { checkConsoleErrors, text } from './util'; +import { text } from './util'; describe('Versions page for pattern with highest report being recommended', () => { it('renders page h1', async () => { await getPage( { role: false, url: '/data-management/checkbox-tri-state' }, - async page => { - const errors = await checkConsoleErrors(page, async () => { - await text( - page, - 'h1 ::-p-text(Checkbox Example (Tri State) Test Plan Versions)' - ); - }); + async (page, { consoleErrors }) => { + await text( + page, + 'h1 ::-p-text(Checkbox Example (Tri State) Test Plan Versions)' + ); - expect(errors).toHaveLength(0); + expect(consoleErrors).toHaveLength(0); } ); }); diff --git a/client/tests/e2e/TestQueue.e2e.test.js b/client/tests/e2e/TestQueue.e2e.test.js index 83125c3b3..f8168bed3 100644 --- a/client/tests/e2e/TestQueue.e2e.test.js +++ b/client/tests/e2e/TestQueue.e2e.test.js @@ -1,5 +1,5 @@ import getPage from '../util/getPage'; -import { text, display, checkConsoleErrors } from './util'; +import { text, display } from './util'; describe('Test Queue common traits', () => { it('renders page h1', async () => { @@ -13,24 +13,25 @@ describe('Test Queue common traits', () => { describe('Test Queue admin traits when reports exist', () => { it('renders page h1', async () => { await getPage({ role: 'admin', url: '/test-queue' }, async page => { - const errors = await checkConsoleErrors(page, async () => { - const h1Element = await text(page, 'h1'); - expect(h1Element).toBe('Test Queue'); - }); - - expect(errors).toHaveLength(0); + const h1Element = await text(page, 'h1'); + expect(h1Element).toBe('Test Queue'); }); }); it('renders page with instructions', async () => { - await getPage({ role: 'admin', url: '/test-queue' }, async page => { - const instructionsSelector = '[data-testid="test-queue-instructions"]'; - const instructionsText = await text(page, instructionsSelector); + await getPage( + { role: 'admin', url: '/test-queue' }, + async (page, { consoleErrors }) => { + const instructionsSelector = '[data-testid="test-queue-instructions"]'; + const instructionsText = await text(page, instructionsSelector); + + expect(instructionsText).toBe( + 'Manage the test plans, assign yourself a test plan or start executing one that is already assigned to you.' + ); - expect(instructionsText).toBe( - 'Manage the test plans, assign yourself a test plan or start executing one that is already assigned to you.' - ); - }); + expect(consoleErrors).toHaveLength(0); + } + ); }); it('renders page with known pattern sections', async () => { diff --git a/client/tests/e2e/TestReview.e2e.test.js b/client/tests/e2e/TestReview.e2e.test.js index 5d245d1be..61d979c15 100644 --- a/client/tests/e2e/TestReview.e2e.test.js +++ b/client/tests/e2e/TestReview.e2e.test.js @@ -1,5 +1,5 @@ import getPage from '../util/getPage'; -import { checkConsoleErrors, text } from './util'; +import { text } from './util'; describe('Test Review page', () => { const getReviewPageElements = async (page, { isV2 = false } = {}) => { @@ -40,18 +40,18 @@ describe('Test Review page', () => { }; it('renders page for review page before test format v2', async () => { - await getPage({ role: false, url: '/test-review/1' }, async page => { - const errors = await checkConsoleErrors(page, async () => { + await getPage( + { role: false, url: '/test-review/1' }, + async (page, { consoleErrors }) => { await text( page, 'h1 ::-p-text(Alert Example Test Plan V22.04.14 (Deprecated))' ); - }); - - expect(errors).toHaveLength(0); - await getReviewPageElements(page); - }); + await getReviewPageElements(page); + expect(consoleErrors).toHaveLength(0); + } + ); }); it('renders page for review page after test format v2', async () => { diff --git a/client/tests/e2e/TestRun.e2e.test.js b/client/tests/e2e/TestRun.e2e.test.js index dd5721571..859f6361d 100644 --- a/client/tests/e2e/TestRun.e2e.test.js +++ b/client/tests/e2e/TestRun.e2e.test.js @@ -1,5 +1,5 @@ import getPage from '../util/getPage'; -import { checkConsoleErrors, text } from './util'; +import { text } from './util'; describe('Test Run when not signed in', () => { it('renders invalid request when attempting to go directly to /run/:id', async () => { @@ -14,58 +14,58 @@ describe('Test Run when not signed in', () => { it('renders /test-plan-report/:id and can navigate between tests', async () => { // This should be NVDA + Chrome + Modal Dialog Example with 12 tests - await getPage({ role: false, url: '/test-plan-report/19' }, async page => { - const errors = await checkConsoleErrors(page, async () => { + await getPage( + { role: false, url: '/test-plan-report/19' }, + async (page, { consoleErrors }) => { const h1Text = await text(page, 'h1'); expect(h1Text.includes('Test 1:')).toBe(true); - }); - expect(errors).toHaveLength(0); + const currentUrl = await page.url(); - const currentUrl = await page.url(); + await page.waitForSelector('nav#test-navigator-nav ol'); + const testNavigatorListItemsHandle = await page.evaluateHandle(() => { + const testNavigatorListSelector = 'nav#test-navigator-nav ol'; + const testNavigatorList = document.querySelector( + testNavigatorListSelector + ); + return Array.from(testNavigatorList.querySelectorAll('li')); + }); - await page.waitForSelector('nav#test-navigator-nav ol'); - const testNavigatorListItemsHandle = await page.evaluateHandle(() => { - const testNavigatorListSelector = 'nav#test-navigator-nav ol'; - const testNavigatorList = document.querySelector( - testNavigatorListSelector + const testNavigatorListItemsMap = + await testNavigatorListItemsHandle.getProperties(); + const testNavigatorListItems = Array.from( + testNavigatorListItemsMap.values() ); - return Array.from(testNavigatorList.querySelectorAll('li')); - }); - - const testNavigatorListItemsMap = - await testNavigatorListItemsHandle.getProperties(); - const testNavigatorListItems = Array.from( - testNavigatorListItemsMap.values() - ); - const listItemsLength = testNavigatorListItems.length; - - // Click each navigation item and confirm the h1 on page has changed - for (const [index, li] of testNavigatorListItems.entries()) { - // Randomly navigate using the navigation link or the next button - if (Math.random()) - await li.evaluate(el => el.querySelector('a').click()); - else await page.click('button ::-p-text(Next Test)'); + const listItemsLength = testNavigatorListItems.length; + + // Click each navigation item and confirm the h1 on page has changed + for (const [index, li] of testNavigatorListItems.entries()) { + // Randomly navigate using the navigation link or the next button + if (Math.random()) + await li.evaluate(el => el.querySelector('a').click()); + else await page.click('button ::-p-text(Next Test)'); + + await page.waitForSelector(`h1 ::-p-text(Test ${index + 1}:)`); + await page.waitForSelector( + `div[class="info-label"] ::-p-text(Test Plan:)` + ); + await page.waitForSelector(`div[class="info-label"] ::-p-text(AT:)`); + await page.waitForSelector( + `div[class="info-label"] ::-p-text(Browser:)` + ); + await page.waitForSelector( + `div[class="info-label"] ::-p-text(${listItemsLength} tests to view)` + ); + await page.waitForSelector(`h2 ::-p-text(Instructions)`); + await page.waitForSelector(`h2 ::-p-text(Record Results)`); + await page.waitForSelector(`h3 ::-p-text(After)`); + } - await page.waitForSelector(`h1 ::-p-text(Test ${index + 1}:)`); - await page.waitForSelector( - `div[class="info-label"] ::-p-text(Test Plan:)` - ); - await page.waitForSelector(`div[class="info-label"] ::-p-text(AT:)`); - await page.waitForSelector( - `div[class="info-label"] ::-p-text(Browser:)` - ); - await page.waitForSelector( - `div[class="info-label"] ::-p-text(${listItemsLength} tests to view)` - ); - await page.waitForSelector(`h2 ::-p-text(Instructions)`); - await page.waitForSelector(`h2 ::-p-text(Record Results)`); - await page.waitForSelector(`h3 ::-p-text(After)`); + expect(currentUrl.includes('/test-plan-report/19')).toBe(true); + expect(listItemsLength).toBeGreaterThan(1); + expect(consoleErrors).toHaveLength(0); } - - expect(currentUrl.includes('/test-plan-report/19')).toBe(true); - expect(listItemsLength).toBeGreaterThan(1); - }); + ); }); }); diff --git a/client/tests/e2e/UserSettings.e2e.test.js b/client/tests/e2e/UserSettings.e2e.test.js index 42fa35b10..f796b7f4a 100644 --- a/client/tests/e2e/UserSettings.e2e.test.js +++ b/client/tests/e2e/UserSettings.e2e.test.js @@ -1,5 +1,5 @@ import getPage from '../util/getPage'; -import { checkConsoleErrors, text } from './util'; +import { text } from './util'; describe('User Settings when not signed in', () => { it('does not render page if signed out', async () => { @@ -44,8 +44,9 @@ describe('User Settings common traits', () => { }); it('renders testable assistive technologies status and update on save', async () => { - await getPage({ role: 'tester', url: '/account/settings' }, async page => { - const errors = await checkConsoleErrors(page, async () => { + await getPage( + { role: 'tester', url: '/account/settings' }, + async (page, { consoleErrors }) => { const testableAtsStatusTextBeforeSave = await text( page, 'p[data-testid="testable-ats-status"]' @@ -53,37 +54,37 @@ describe('User Settings common traits', () => { expect(testableAtsStatusTextBeforeSave).toBe( 'You have not yet selected any assistive technologies.' ); - }); - expect(errors).toHaveLength(0); + const jawsOptionSelector = 'input[id="1"][type="checkbox"]'; + const nvdaOptionSelector = 'input[id="2"][type="checkbox"]'; + const saveButtonSelector = 'button[type="submit"]'; + const saveButtonText = await text(page, saveButtonSelector); - const jawsOptionSelector = 'input[id="1"][type="checkbox"]'; - const nvdaOptionSelector = 'input[id="2"][type="checkbox"]'; - const saveButtonSelector = 'button[type="submit"]'; - const saveButtonText = await text(page, saveButtonSelector); + await page.click(jawsOptionSelector); + await page.click(nvdaOptionSelector); + await page.click(saveButtonSelector); - await page.click(jawsOptionSelector); - await page.click(nvdaOptionSelector); - await page.click(saveButtonSelector); + await page.waitForNetworkIdle(); - await page.waitForNetworkIdle(); + const testableAtsStatusTextAfterSave = await text( + page, + 'p[data-testid="testable-ats-status"]' + ); + const selectedAtsListItems = await page.$eval('ul', el => { + const liElements = el.querySelectorAll('li'); + return Array.from(liElements, li => li.innerText.trim()); + }); - const testableAtsStatusTextAfterSave = await text( - page, - 'p[data-testid="testable-ats-status"]' - ); - const selectedAtsListItems = await page.$eval('ul', el => { - const liElements = el.querySelectorAll('li'); - return Array.from(liElements, li => li.innerText.trim()); - }); + expect(saveButtonText).toBe('Save'); + expect(testableAtsStatusTextAfterSave).toBe( + 'You can currently test the following assistive technologies:' + ); + expect(selectedAtsListItems.length).toBe(2); + expect(selectedAtsListItems.includes('JAWS')).toBe(true); + expect(selectedAtsListItems.includes('NVDA')).toBe(true); - expect(saveButtonText).toBe('Save'); - expect(testableAtsStatusTextAfterSave).toBe( - 'You can currently test the following assistive technologies:' - ); - expect(selectedAtsListItems.length).toBe(2); - expect(selectedAtsListItems.includes('JAWS')).toBe(true); - expect(selectedAtsListItems.includes('NVDA')).toBe(true); - }); + expect(consoleErrors).toHaveLength(0); + } + ); }); }); diff --git a/client/tests/e2e/util/index.js b/client/tests/e2e/util/index.js index 3cd868763..43411e792 100644 --- a/client/tests/e2e/util/index.js +++ b/client/tests/e2e/util/index.js @@ -11,31 +11,7 @@ const display = async (page, selector, { wait = true } = {}) => { }); }; -/** - * Checks for errors on a given page - * @param {Page} page - Puppeteer page object - * @param {Function} action - Async function to perform actions that might trigger PropType errors - * @param {number} [timeout=500] - Timeout in milliseconds to wait for errors - * @returns {Promise} - Array of error messages, if any - */ -async function checkConsoleErrors(page, action, timeout = 500) { - let errors = []; - - page.on('console', msg => { - if (msg.type() === 'error') { - errors.push(msg.text()); - } - }); - - await action(); - - await page.waitForTimeout(timeout); - - return errors; -} - module.exports = { text, - display, - checkConsoleErrors + display }; diff --git a/client/tests/util/getPage.js b/client/tests/util/getPage.js index ebff8cd77..4bc966446 100644 --- a/client/tests/util/getPage.js +++ b/client/tests/util/getPage.js @@ -144,6 +144,14 @@ const getPage = async (options, callback) => { page.setDefaultTimeout(604800000 /* a week should be enough */); } + let consoleErrors = []; + + page.on('console', msg => { + if (msg.type() === 'error') { + consoleErrors.push(msg.text()); + } + }); + await page.goto(`${baseUrl}${url}`); await page.waitForNetworkIdle(); @@ -178,7 +186,11 @@ const getPage = async (options, callback) => { } try { - await callback(page, { browser: global.browser, baseUrl }); + await callback(page, { + browser: global.browser, + baseUrl, + consoleErrors + }); } finally { await page.evaluate('endTestTransaction()'); } From 9a176e574a86d0ef62ea55794db2f1bd9d882b26 Mon Sep 17 00:00:00 2001 From: Stalgia Grigg Date: Tue, 6 Aug 2024 10:29:43 -0700 Subject: [PATCH 04/11] Ignore favicon errors --- client/tests/util/getPage.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/tests/util/getPage.js b/client/tests/util/getPage.js index 4bc966446..abd333d29 100644 --- a/client/tests/util/getPage.js +++ b/client/tests/util/getPage.js @@ -147,7 +147,8 @@ const getPage = async (options, callback) => { let consoleErrors = []; page.on('console', msg => { - if (msg.type() === 'error') { + // App does not use a favicon, so we can ignore these errors + if (msg.type() === 'error' && !msg.text().includes('favicon')) { consoleErrors.push(msg.text()); } }); From 7c0ab79fa6e2ed5cc7d33bd9d62f5fa00d1f2099 Mon Sep 17 00:00:00 2001 From: Stalgia Grigg Date: Tue, 6 Aug 2024 10:49:48 -0700 Subject: [PATCH 05/11] Prevent default browser favicon fetch attempt --- client/static/index.html | 2 ++ client/tests/util/getPage.js | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/client/static/index.html b/client/static/index.html index 057213870..c5deb380d 100644 --- a/client/static/index.html +++ b/client/static/index.html @@ -5,6 +5,8 @@ + + ARIA-AT App diff --git a/client/tests/util/getPage.js b/client/tests/util/getPage.js index abd333d29..4bc966446 100644 --- a/client/tests/util/getPage.js +++ b/client/tests/util/getPage.js @@ -147,8 +147,7 @@ const getPage = async (options, callback) => { let consoleErrors = []; page.on('console', msg => { - // App does not use a favicon, so we can ignore these errors - if (msg.type() === 'error' && !msg.text().includes('favicon')) { + if (msg.type() === 'error') { consoleErrors.push(msg.text()); } }); From 8313369f2eecfef641f5124f37abfe2bf69400ae Mon Sep 17 00:00:00 2001 From: Stalgia Grigg Date: Tue, 6 Aug 2024 11:07:56 -0700 Subject: [PATCH 06/11] Use improved favicon ignore strategy to prevent double fetch --- client/static/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/static/index.html b/client/static/index.html index c5deb380d..8ed7de471 100644 --- a/client/static/index.html +++ b/client/static/index.html @@ -5,8 +5,8 @@ - - + + ARIA-AT App From 7f5c05200ec672891836d0921c9b26d63a9697c7 Mon Sep 17 00:00:00 2001 From: Stalgia Grigg Date: Tue, 6 Aug 2024 11:22:40 -0700 Subject: [PATCH 07/11] Remove comment in index.html --- client/static/index.html | 1 - 1 file changed, 1 deletion(-) diff --git a/client/static/index.html b/client/static/index.html index 8ed7de471..5db6d0959 100644 --- a/client/static/index.html +++ b/client/static/index.html @@ -5,7 +5,6 @@ - ARIA-AT App From 51edd0b5a48b304a8d840352a0075defaf11e37a Mon Sep 17 00:00:00 2001 From: Stalgia Grigg Date: Tue, 6 Aug 2024 11:52:20 -0700 Subject: [PATCH 08/11] Update snapshots --- client/tests/e2e/snapshots/saved/_.html | 1 + client/tests/e2e/snapshots/saved/_404.html | 1 + client/tests/e2e/snapshots/saved/_account_settings.html | 1 + client/tests/e2e/snapshots/saved/_candidate-review.html | 1 + client/tests/e2e/snapshots/saved/_candidate-test-plan_24_1.html | 1 + client/tests/e2e/snapshots/saved/_data-management.html | 1 + client/tests/e2e/snapshots/saved/_data-management_meter.html | 1 + client/tests/e2e/snapshots/saved/_reports.html | 1 + client/tests/e2e/snapshots/saved/_run_2.html | 1 + client/tests/e2e/snapshots/saved/_signup-instructions.html | 1 + client/tests/e2e/snapshots/saved/_test-plan-report_1.html | 1 + client/tests/e2e/snapshots/saved/_test-queue.html | 1 + client/tests/e2e/snapshots/saved/_test-review_8.html | 1 + 13 files changed, 13 insertions(+) diff --git a/client/tests/e2e/snapshots/saved/_.html b/client/tests/e2e/snapshots/saved/_.html index 731c7809a..1b0fdcadb 100644 --- a/client/tests/e2e/snapshots/saved/_.html +++ b/client/tests/e2e/snapshots/saved/_.html @@ -5,6 +5,7 @@ + Home | ARIA-AT diff --git a/client/tests/e2e/snapshots/saved/_404.html b/client/tests/e2e/snapshots/saved/_404.html index 025770160..3e7edfdea 100644 --- a/client/tests/e2e/snapshots/saved/_404.html +++ b/client/tests/e2e/snapshots/saved/_404.html @@ -5,6 +5,7 @@ + Page Not Found | ARIA-AT diff --git a/client/tests/e2e/snapshots/saved/_account_settings.html b/client/tests/e2e/snapshots/saved/_account_settings.html index dbbc8ef09..460460d0f 100644 --- a/client/tests/e2e/snapshots/saved/_account_settings.html +++ b/client/tests/e2e/snapshots/saved/_account_settings.html @@ -5,6 +5,7 @@ + Settings | ARIA-AT diff --git a/client/tests/e2e/snapshots/saved/_candidate-review.html b/client/tests/e2e/snapshots/saved/_candidate-review.html index 417a14e3d..4fb2ede26 100644 --- a/client/tests/e2e/snapshots/saved/_candidate-review.html +++ b/client/tests/e2e/snapshots/saved/_candidate-review.html @@ -5,6 +5,7 @@ + Candidate Review | ARIA-AT diff --git a/client/tests/e2e/snapshots/saved/_candidate-test-plan_24_1.html b/client/tests/e2e/snapshots/saved/_candidate-test-plan_24_1.html index 11f9e9f92..922a703db 100644 --- a/client/tests/e2e/snapshots/saved/_candidate-test-plan_24_1.html +++ b/client/tests/e2e/snapshots/saved/_candidate-test-plan_24_1.html @@ -5,6 +5,7 @@ + Candidate Test Run Page | ARIA-AT diff --git a/client/tests/e2e/snapshots/saved/_data-management.html b/client/tests/e2e/snapshots/saved/_data-management.html index 0cc8608bf..40a32a26f 100644 --- a/client/tests/e2e/snapshots/saved/_data-management.html +++ b/client/tests/e2e/snapshots/saved/_data-management.html @@ -5,6 +5,7 @@ + Data Management | ARIA-AT diff --git a/client/tests/e2e/snapshots/saved/_data-management_meter.html b/client/tests/e2e/snapshots/saved/_data-management_meter.html index 906c5b3a3..7de71e1eb 100644 --- a/client/tests/e2e/snapshots/saved/_data-management_meter.html +++ b/client/tests/e2e/snapshots/saved/_data-management_meter.html @@ -5,6 +5,7 @@ + Meter Test Plan Versions | ARIA-AT diff --git a/client/tests/e2e/snapshots/saved/_reports.html b/client/tests/e2e/snapshots/saved/_reports.html index 04c8d23bf..21dc0c932 100644 --- a/client/tests/e2e/snapshots/saved/_reports.html +++ b/client/tests/e2e/snapshots/saved/_reports.html @@ -5,6 +5,7 @@ + AT Interop Reports | ARIA-AT diff --git a/client/tests/e2e/snapshots/saved/_run_2.html b/client/tests/e2e/snapshots/saved/_run_2.html index 44b16c8b8..af9cc307b 100644 --- a/client/tests/e2e/snapshots/saved/_run_2.html +++ b/client/tests/e2e/snapshots/saved/_run_2.html @@ -5,6 +5,7 @@ + Navigate forwards to a collapsed select-only combobox in reading mode for NVDA 2020.4 and Firefox 99 | ARIA-AT diff --git a/client/tests/e2e/snapshots/saved/_signup-instructions.html b/client/tests/e2e/snapshots/saved/_signup-instructions.html index 04ccc5fab..aa808af49 100644 --- a/client/tests/e2e/snapshots/saved/_signup-instructions.html +++ b/client/tests/e2e/snapshots/saved/_signup-instructions.html @@ -5,6 +5,7 @@ <meta name="google" content="notranslate" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> + <link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon" /> <title>ARIA-AT App diff --git a/client/tests/e2e/snapshots/saved/_test-plan-report_1.html b/client/tests/e2e/snapshots/saved/_test-plan-report_1.html index 3037ef439..44050c71e 100644 --- a/client/tests/e2e/snapshots/saved/_test-plan-report_1.html +++ b/client/tests/e2e/snapshots/saved/_test-plan-report_1.html @@ -5,6 +5,7 @@ + Navigate forwards to a not pressed toggle button in reading mode for JAWS 2021.2111.13 and Chrome 99 | ARIA-AT diff --git a/client/tests/e2e/snapshots/saved/_test-queue.html b/client/tests/e2e/snapshots/saved/_test-queue.html index 97db5f56f..12ddaf1e5 100644 --- a/client/tests/e2e/snapshots/saved/_test-queue.html +++ b/client/tests/e2e/snapshots/saved/_test-queue.html @@ -5,6 +5,7 @@ <meta name="google" content="notranslate" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> + <link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon" /> <title>Test Queue | ARIA-AT diff --git a/client/tests/e2e/snapshots/saved/_test-review_8.html b/client/tests/e2e/snapshots/saved/_test-review_8.html index 9a0562f2f..03df550a9 100644 --- a/client/tests/e2e/snapshots/saved/_test-review_8.html +++ b/client/tests/e2e/snapshots/saved/_test-review_8.html @@ -5,6 +5,7 @@ + Command Button Example Test Plan V22.05.04 | ARIA-AT From 43e4eae7e3d40e3326c92a28085df3c9919f1399 Mon Sep 17 00:00:00 2001 From: Stalgia Grigg Date: Thu, 8 Aug 2024 08:40:24 -0700 Subject: [PATCH 09/11] Remove unnecessary assertions --- client/tests/e2e/TestRun.e2e.test.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/client/tests/e2e/TestRun.e2e.test.js b/client/tests/e2e/TestRun.e2e.test.js index 43f0c9c0a..4a38f2e26 100644 --- a/client/tests/e2e/TestRun.e2e.test.js +++ b/client/tests/e2e/TestRun.e2e.test.js @@ -65,9 +65,6 @@ describe('Test Run when not signed in', () => { new RegExp(`/test-plan-report/19#${index + 1}$`) ); } - - expect(currentUrl.includes('/test-plan-report/19')).toBe(true); - expect(listItemsLength).toBeGreaterThan(1); expect(consoleErrors).toHaveLength(0); } ); From 1810266616181abdf013c1e40e81a4df9de6ba70 Mon Sep 17 00:00:00 2001 From: Stalgia Grigg Date: Thu, 8 Aug 2024 08:59:24 -0700 Subject: [PATCH 10/11] Update snapshots --- .../e2e/snapshots/saved/_data-management.html | 20 +++++++++---------- .../e2e/snapshots/saved/_test-queue.html | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/client/tests/e2e/snapshots/saved/_data-management.html b/client/tests/e2e/snapshots/saved/_data-management.html index 40a32a26f..0569b4f95 100644 --- a/client/tests/e2e/snapshots/saved/_data-management.html +++ b/client/tests/e2e/snapshots/saved/_data-management.html @@ -210,7 +210,7 @@

@@ -623,7 +623,7 @@

Test Plans Status Summary

R&D -

Complete Mar 17, 2022

+

Complete Aug 8, 2024

@@ -1095,7 +1095,7 @@

Test Plans Status Summary

V22.03.17-1V24.08.08