diff --git a/client/components/CandidateReview/CandidateTestPlanRun/queries.js b/client/components/CandidateReview/CandidateTestPlanRun/queries.js index f30e88353..73ee3dae8 100644 --- a/client/components/CandidateReview/CandidateTestPlanRun/queries.js +++ b/client/components/CandidateReview/CandidateTestPlanRun/queries.js @@ -112,24 +112,28 @@ export const CANDIDATE_REPORTS_QUERY = gql` id assertion { text + phrase } passed } mustAssertionResults: assertionResults(priority: MUST) { assertion { text + phrase } passed } shouldAssertionResults: assertionResults(priority: SHOULD) { assertion { text + phrase } passed } mayAssertionResults: assertionResults(priority: MAY) { assertion { text + phrase } passed } diff --git a/client/components/Reports/queries.js b/client/components/Reports/queries.js index 4c25ccb7b..90afc509a 100644 --- a/client/components/Reports/queries.js +++ b/client/components/Reports/queries.js @@ -78,12 +78,14 @@ export const REPORT_PAGE_QUERY = gql` id assertion { text + phrase } passed } mustAssertionResults: assertionResults(priority: MUST) { assertion { text + phrase } passed } @@ -92,12 +94,14 @@ export const REPORT_PAGE_QUERY = gql` ) { assertion { text + phrase } passed } mayAssertionResults: assertionResults(priority: MAY) { assertion { text + phrase } passed } diff --git a/client/components/TestRun/queries.js b/client/components/TestRun/queries.js index fd563084b..e8d485dbe 100644 --- a/client/components/TestRun/queries.js +++ b/client/components/TestRun/queries.js @@ -33,24 +33,28 @@ export const TEST_RUN_PAGE_QUERY = gql` id assertion { text + phrase } passed } mustAssertionResults: assertionResults(priority: MUST) { assertion { text + phrase } passed } shouldAssertionResults: assertionResults(priority: SHOULD) { assertion { text + phrase } passed } mayAssertionResults: assertionResults(priority: MAY) { assertion { text + phrase } passed } @@ -88,6 +92,7 @@ export const TEST_RUN_PAGE_QUERY = gql` assertion { id text + phrase } } conflictingResults { @@ -198,6 +203,7 @@ export const TEST_RUN_PAGE_ANON_QUERY = gql` assertion { id text + phrase } } conflictingResults { @@ -323,6 +329,7 @@ export const FIND_OR_CREATE_TEST_RESULT_MUTATION = gql` id assertion { text + phrase } passed } @@ -331,6 +338,7 @@ export const FIND_OR_CREATE_TEST_RESULT_MUTATION = gql` ) { assertion { text + phrase } passed } @@ -339,6 +347,7 @@ export const FIND_OR_CREATE_TEST_RESULT_MUTATION = gql` ) { assertion { text + phrase } passed } @@ -347,6 +356,7 @@ export const FIND_OR_CREATE_TEST_RESULT_MUTATION = gql` ) { assertion { text + phrase } passed } @@ -384,6 +394,7 @@ export const FIND_OR_CREATE_TEST_RESULT_MUTATION = gql` assertion { id text + phrase } } conflictingResults { @@ -480,6 +491,7 @@ export const FIND_OR_CREATE_TEST_RESULT_MUTATION = gql` assertion { id text + phrase } } conflictingResults { @@ -609,6 +621,7 @@ export const SAVE_TEST_RESULT_MUTATION = gql` id assertion { text + phrase } passed } @@ -617,6 +630,7 @@ export const SAVE_TEST_RESULT_MUTATION = gql` ) { assertion { text + phrase } passed } @@ -625,6 +639,7 @@ export const SAVE_TEST_RESULT_MUTATION = gql` ) { assertion { text + phrase } passed } @@ -633,6 +648,7 @@ export const SAVE_TEST_RESULT_MUTATION = gql` ) { assertion { text + phrase } passed } @@ -670,6 +686,7 @@ export const SAVE_TEST_RESULT_MUTATION = gql` assertion { id text + phrase } } conflictingResults { @@ -766,6 +783,7 @@ export const SAVE_TEST_RESULT_MUTATION = gql` assertion { id text + phrase } } conflictingResults { @@ -895,6 +913,7 @@ export const SUBMIT_TEST_RESULT_MUTATION = gql` id assertion { text + phrase } passed } @@ -903,6 +922,7 @@ export const SUBMIT_TEST_RESULT_MUTATION = gql` ) { assertion { text + phrase } passed } @@ -911,6 +931,7 @@ export const SUBMIT_TEST_RESULT_MUTATION = gql` ) { assertion { text + phrase } passed } @@ -919,6 +940,7 @@ export const SUBMIT_TEST_RESULT_MUTATION = gql` ) { assertion { text + phrase } passed } @@ -956,6 +978,7 @@ export const SUBMIT_TEST_RESULT_MUTATION = gql` assertion { id text + phrase } } conflictingResults { @@ -1052,6 +1075,7 @@ export const SUBMIT_TEST_RESULT_MUTATION = gql` assertion { id text + phrase } } conflictingResults { diff --git a/client/components/common/TestPlanResultsTable/index.jsx b/client/components/common/TestPlanResultsTable/index.jsx index 319cc974b..30dccaa36 100644 --- a/client/components/common/TestPlanResultsTable/index.jsx +++ b/client/components/common/TestPlanResultsTable/index.jsx @@ -9,7 +9,13 @@ const renderAssertionRow = (assertionResult, priorityString) => { return ( {priorityString} - {assertionResult.assertion.text} + + {assertionResult.assertion.phrase + ? assertionResult.assertion.phrase.charAt(0).toUpperCase() + + assertionResult.assertion.phrase.slice(1) + : assertionResult.assertion.text.charAt(0).toUpperCase() + + assertionResult.assertion.text.slice(1)} + {assertionResult.passed ? 'Passed' : 'Failed'} ); diff --git a/server/graphql-schema.js b/server/graphql-schema.js index 92cf9d25a..5c69873a0 100644 --- a/server/graphql-schema.js +++ b/server/graphql-schema.js @@ -565,12 +565,19 @@ const graphqlSchema = gql` Whether this assertion contributes to the test failing or not. """ priority: AssertionPriority! - # TODO: consider adding a automatedAssertion field which uses regex or - # similar to automatically determine pass or fail. """ - A human-readable version of the assertion. + A human-readable version of the assertion, like "Role 'radio button' is + conveyed". """ text: String! + """ + For TestPlanVersions that use the V2 test format, this field contains + text like "convey role 'radio button'". + + See the link for more information: + https://github.com/w3c/aria-at/wiki/Test-Format-Definition-V2#assertionphrase + """ + phrase: String } """ diff --git a/server/models/services/TestsService.js b/server/models/services/TestsService.js index 25d52e9a7..03fa55187 100644 --- a/server/models/services/TestsService.js +++ b/server/models/services/TestsService.js @@ -50,7 +50,8 @@ const getTests = parentRecord => { }), assertions: test.assertions.map(assertion => ({ ...assertion, - text: isV2 ? assertion.assertionStatement : assertion.text + text: isV2 ? assertion.assertionStatement : assertion.text, + phrase: isV2 ? assertion.assertionPhrase : null })) })); }; diff --git a/server/tests/integration/graphql.test.js b/server/tests/integration/graphql.test.js index 9bfeca0d8..14dcb22e2 100644 --- a/server/tests/integration/graphql.test.js +++ b/server/tests/integration/graphql.test.js @@ -273,6 +273,18 @@ describe('graphql', () => { id status } + v2TestPlanVersion: testPlanVersion(id: 133) { + __typename + id + metadata + tests { + __typename + assertions { + __typename + phrase + } + } + } testPlan(id: "checkbox") { __typename id @@ -967,3 +979,7 @@ const getMutationInputs = async () => { browserVersionId: browserVersion.id }; }; + +/* Add the phrase to the assertion query. It will not work unless phrase is returned. +Find a test plan version that does have a phrase (V2). +*/