@@ -52,6 +52,24 @@ The Cypress App [repository](https://github.com/cypress-io/cypress) uses the Res
52
52
``` javascript title="scripts/verifyAccessibilityResults.js"
53
53
const { getAccessibilityResults } = require (' @cypress/extract-cloud-results' )
54
54
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
+
55
73
getAccessibilityResults ({
56
74
projectId: ' ...' , // optional if set from env
57
75
recordKey: ' ...' , // optional if set from env
@@ -60,11 +78,8 @@ getAccessibilityResults({
60
78
const { runNumber , accessibilityReportUrl , summary , rules } = results
61
79
const { total } = summary .violationCounts
62
80
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} .` )
68
83
69
84
// write your logic to conditionally fail based on the results
70
85
if (total === 0 ) {
@@ -101,24 +116,6 @@ getAccessibilityResults({
101
116
}
102
117
103
118
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
- ]
122
119
})
123
120
```
124
121
0 commit comments