Skip to content

Commit 1c72b65

Browse files
committed
docs: fix results-api.mdx getResults script
1 parent 80dd7cb commit 1c72b65

File tree

2 files changed

+22
-28
lines changed

2 files changed

+22
-28
lines changed

docs/accessibility/results-api.mdx

+20-23
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,24 @@ The Cypress App [repository](https://github.com/cypress-io/cypress) uses the Res
5252
```javascript title="scripts/verifyAccessibilityResults.js"
5353
const { getAccessibilityResults } = require('@cypress/extract-cloud-results')
5454

55+
/**
56+
* The list of rules that currently have 1+ elements that have been flagged with
57+
* violations within the Cypress Accessibility report that need to be addressed.
58+
*
59+
* Once the violation is fixed in the Accessibility report,
60+
* the fixed rule should be removed from this list.
61+
*
62+
* View the Accessibility report for the Cypress run in the Cloud
63+
* for more details on how to address these failures.
64+
*/
65+
const rulesWithExistingViolations = [
66+
'aria-required-children',
67+
'empty-heading',
68+
'aria-dialog-name',
69+
'link-in-text-block',
70+
'list',
71+
];
72+
5573
getAccessibilityResults({
5674
projectId: '...', // optional if set from env
5775
recordKey: '...', // optional if set from env
@@ -60,11 +78,8 @@ getAccessibilityResults({
6078
const { runNumber, accessibilityReportUrl, summary, rules } = results
6179
const { total } = summary.violationCounts
6280

63-
console
64-
.log(
65-
`Received ${summary.isPartialReport ? 'partial' : ''} results for run #${runNumber}.`
66-
)
67-
.console.log(`See full report at ${accessibilityReportUrl}.`)
81+
console.log(`Received ${summary.isPartialReport ? 'partial' : ''} results for run #${runNumber}.`)
82+
console.log(`See full report at ${accessibilityReportUrl}.`)
6883

6984
// write your logic to conditionally fail based on the results
7085
if (total === 0) {
@@ -101,24 +116,6 @@ getAccessibilityResults({
101116
}
102117

103118
console.log('No new Accessibility violations detected!')
104-
105-
/**
106-
* The list of rules that currently have 1+ elements that have been flagged with
107-
* violations within the Cypress Accessibility report that need to be addressed.
108-
*
109-
* Once the violation is fixed in the Accessibility report,
110-
* the fixed rule should be removed from this list.
111-
*
112-
* View the Accessibility report for the Cypress run in the Cloud
113-
* for more details on how to address these failures.
114-
*/
115-
const rulesWithExistingViolations = [
116-
'aria-required-children',
117-
'empty-heading',
118-
'aria-dialog-name',
119-
'link-in-text-block',
120-
'list',
121-
]
122119
})
123120
```
124121

docs/ui-coverage/results-api.mdx

+2-5
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,8 @@ getUICoverageResults({
5555
}).then((results) => {
5656
const { runNumber, uiCoverageReportUrl, summary, views } = results
5757

58-
console
59-
.log(
60-
`Received ${summary.isPartialReport ? 'partial' : ''} results for run #${runNumber}.`
61-
)
62-
.console.log(`See full report at ${uiCoverageReportUrl}.`)
58+
console.log(`Received ${summary.isPartialReport ? 'partial' : ''} results for run #${runNumber}.`)
59+
console.log(`See full report at ${uiCoverageReportUrl}.`)
6360

6461
// verify project coverage
6562
if (summary.coverage < 80) {

0 commit comments

Comments
 (0)