@uuv/cypress 2.42.0 → 2.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/dist/cucumber/step_definitions/cypress/_.common.d.ts +10 -0
- package/dist/cucumber/step_definitions/cypress/_.common.js +1 -1
- package/dist/cucumber/step_definitions/cypress/a11y-engine.d.ts +2 -1
- package/dist/cucumber/step_definitions/cypress/a11y-engine.js +91 -67
- package/dist/cucumber/step_definitions/cypress/core-engine.js +1 -2
- package/dist/cucumber/step_definitions/cypress/generated/_en-generated-cucumber-steps-definition.js +45 -18
- package/dist/cucumber/step_definitions/cypress/generated/_fr-generated-cucumber-steps-definition.js +45 -18
- package/dist/cypress/commands.d.ts +2 -1
- package/dist/cypress/cypress.config.js +10 -4
- package/dist/lib/runner-cypress.js +4 -1
- package/package.json +7 -6
- package/src/cucumber/step_definitions/cypress/generated/_en-generated-cucumber-steps-definition.ts +46 -19
- package/src/cucumber/step_definitions/cypress/generated/_fr-generated-cucumber-steps-definition.ts +46 -19
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
# [2.44.0](https://github.com/e2e-test-quest/uuv/compare/runner-cypress-v2.43.0...runner-cypress-v2.44.0) (2024-12-15)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* add a11y-dashboard project to workspace, [#460](https://github.com/e2e-test-quest/uuv/issues/460) ([5051848](https://github.com/e2e-test-quest/uuv/commit/5051848c426350746ba319f7227c10d4af71b0fe))
|
|
7
|
+
|
|
8
|
+
# [2.43.0](https://github.com/e2e-test-quest/uuv/compare/runner-cypress-v2.42.0...runner-cypress-v2.43.0) (2024-12-08)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **assistant:** update dependency @codemirror/view to v6.35.2 ([33e5c81](https://github.com/e2e-test-quest/uuv/commit/33e5c810caa5c19f96305f721bb10ab8d762ec64))
|
|
14
|
+
* **assistant:** update dependency antd to v5.22.3 ([e47ecd5](https://github.com/e2e-test-quest/uuv/commit/e47ecd56df07c844e3b448e0d02204903c1eb879))
|
|
15
|
+
* **runner-cypress:** update dependency cypress to v13.16.1 ([090cb35](https://github.com/e2e-test-quest/uuv/commit/090cb35efa1ad5c30a44ec4565a653eff1117fc7))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* **runner-playwright:** update dependency chokidar to v4 ([463c2c0](https://github.com/e2e-test-quest/uuv/commit/463c2c01f60c9ade5de26b1ce2c61c3e27e95cf2))
|
|
21
|
+
|
|
1
22
|
# [2.42.0](https://github.com/e2e-test-quest/uuv/compare/runner-cypress-v2.41.0...runner-cypress-v2.42.0) (2024-12-02)
|
|
2
23
|
|
|
3
24
|
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
import { ByRoleOptions } from "@testing-library/cypress";
|
|
14
14
|
import { Context } from "./_context";
|
|
15
15
|
import Chainable = Cypress.Chainable;
|
|
16
|
+
import { A11yReferenceEnum } from "@uuv/a11y";
|
|
16
17
|
export declare const shouldGenerateA11yReport: () => boolean;
|
|
17
18
|
export declare const getA11yResultFilePath: () => string;
|
|
18
19
|
export declare const uuvGetContext: () => Chainable<Context>;
|
|
@@ -25,3 +26,12 @@ export declare function uuvFindByText(textToSearch: string, roleOptions: ByRoleO
|
|
|
25
26
|
export declare function uuvFindByTestId(testId: string): Cypress.Chainable<JQuery<HTMLElement>>;
|
|
26
27
|
export declare function uuvFoundedElement(subject: any): Cypress.Chainable<JQuery<HTMLElement>>;
|
|
27
28
|
export declare function pressKey(key: string): void;
|
|
29
|
+
export type UuvA11yOptions = {
|
|
30
|
+
reference: A11yReferenceEnum;
|
|
31
|
+
runnerOptions?: any;
|
|
32
|
+
expectedResult?: UuvA11yExpectedResult;
|
|
33
|
+
};
|
|
34
|
+
export type UuvA11yExpectedResult = {
|
|
35
|
+
value: any;
|
|
36
|
+
isContainsMode?: boolean;
|
|
37
|
+
};
|
|
@@ -31,7 +31,7 @@ const shouldGenerateA11yReport = () => {
|
|
|
31
31
|
};
|
|
32
32
|
exports.shouldGenerateA11yReport = shouldGenerateA11yReport;
|
|
33
33
|
const getA11yResultFilePath = () => {
|
|
34
|
-
return Cypress.env("uuvOptions").report.a11y.
|
|
34
|
+
return Cypress.env("uuvOptions").report.a11y.relativePath;
|
|
35
35
|
};
|
|
36
36
|
exports.getA11yResultFilePath = getA11yResultFilePath;
|
|
37
37
|
const uuvGetContext = () => {
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* understanding English or French.
|
|
12
12
|
*/
|
|
13
13
|
import { A11yReferenceEnum } from "@uuv/a11y";
|
|
14
|
+
import { UuvA11yOptions } from "./_.common";
|
|
14
15
|
export declare const injectUvvA11y: () => void;
|
|
15
|
-
export declare const checkUvvA11y: (
|
|
16
|
+
export declare const checkUvvA11y: (options: UuvA11yOptions) => void;
|
|
16
17
|
export declare const showUvvA11yReport: (reference: A11yReferenceEnum) => void;
|
|
@@ -17,9 +17,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.showUvvA11yReport = exports.checkUvvA11y = exports.injectUvvA11y = void 0;
|
|
19
19
|
const a11y_1 = require("@uuv/a11y");
|
|
20
|
-
const rxjs_1 = require("rxjs");
|
|
21
20
|
const jquery_1 = __importDefault(require("jquery"));
|
|
22
21
|
const __common_1 = require("./_.common");
|
|
22
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
23
23
|
const injectUvvA11y = () => {
|
|
24
24
|
const fileName = typeof require?.resolve === "function"
|
|
25
25
|
? require.resolve("@uuv/a11y/bundle")
|
|
@@ -29,21 +29,36 @@ const injectUvvA11y = () => {
|
|
|
29
29
|
}));
|
|
30
30
|
};
|
|
31
31
|
exports.injectUvvA11y = injectUvvA11y;
|
|
32
|
-
const checkUvvA11y = (
|
|
32
|
+
const checkUvvA11y = (options) => {
|
|
33
33
|
cy.window({ log: false })
|
|
34
34
|
.then((win) => {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
return new Cypress.Promise(async (resolve, reject) => {
|
|
36
|
+
try {
|
|
37
|
+
const url = win.location.href;
|
|
38
|
+
const a11yChecker = getA11yCheckerForReference(win, options, url);
|
|
39
|
+
assert.isDefined(a11yChecker, "A11y reference not found");
|
|
40
|
+
const reportOfUsecase = await (a11yChecker?.validate(Cypress.currentTest.title, "empty Script", {
|
|
41
|
+
file: Cypress.spec.relative,
|
|
42
|
+
column: 0,
|
|
43
|
+
line: 0
|
|
44
|
+
})).toPromise();
|
|
45
|
+
if ((0, __common_1.shouldGenerateA11yReport)() && reportOfUsecase) {
|
|
46
|
+
storeA11yResult(reportOfUsecase).then(() => {
|
|
47
|
+
logAllA11yRuleResult(options.reference, reportOfUsecase);
|
|
48
|
+
assertWithExpectedResult(options, reportOfUsecase);
|
|
49
|
+
});
|
|
50
|
+
resolve();
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
logAllA11yRuleResult(options.reference, reportOfUsecase);
|
|
54
|
+
assertWithExpectedResult(options, reportOfUsecase);
|
|
55
|
+
resolve();
|
|
56
|
+
}
|
|
42
57
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
58
|
+
catch (error) {
|
|
59
|
+
reject(error);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
47
62
|
});
|
|
48
63
|
};
|
|
49
64
|
exports.checkUvvA11y = checkUvvA11y;
|
|
@@ -56,10 +71,12 @@ const showUvvA11yReport = (reference) => {
|
|
|
56
71
|
log.finish();
|
|
57
72
|
};
|
|
58
73
|
exports.showUvvA11yReport = showUvvA11yReport;
|
|
59
|
-
function getA11yCheckerForReference(win,
|
|
60
|
-
let
|
|
61
|
-
|
|
74
|
+
function getA11yCheckerForReference(win, options, url) {
|
|
75
|
+
let checker;
|
|
76
|
+
console.debug("reference", options.reference);
|
|
77
|
+
switch (options.reference) {
|
|
62
78
|
case a11y_1.A11yReferenceEnum.WCAG_WEB:
|
|
79
|
+
checker = new win.uuvA11y.WcagChecker(url, options.runnerOptions);
|
|
63
80
|
break;
|
|
64
81
|
case a11y_1.A11yReferenceEnum.WCAG_ANDROID:
|
|
65
82
|
break;
|
|
@@ -67,45 +84,47 @@ function getA11yCheckerForReference(win, reference, url) {
|
|
|
67
84
|
break;
|
|
68
85
|
case a11y_1.A11yReferenceEnum.RGAA:
|
|
69
86
|
default:
|
|
70
|
-
|
|
87
|
+
checker = new win.uuvA11y.RgaaChecker(url);
|
|
71
88
|
break;
|
|
72
89
|
}
|
|
73
|
-
return
|
|
90
|
+
return checker;
|
|
74
91
|
}
|
|
75
|
-
function assertWithExpectedResult(
|
|
92
|
+
function assertWithExpectedResult(options, reportOfUsecase) {
|
|
76
93
|
const validationFailedMessage = "A11y validation failed";
|
|
77
|
-
if (expectedResult) {
|
|
78
|
-
|
|
79
|
-
|
|
94
|
+
if (options.expectedResult) {
|
|
95
|
+
const summary = (reportOfUsecase?.result.rawResult).summary();
|
|
96
|
+
if (!options.expectedResult.isContainsMode) {
|
|
97
|
+
assert.deepEqual(summary, options.expectedResult.value, validationFailedMessage);
|
|
80
98
|
}
|
|
81
99
|
else {
|
|
82
|
-
cy.wrap(
|
|
83
|
-
.should("containSubset", expectedResult);
|
|
100
|
+
cy.wrap(summary)
|
|
101
|
+
.should("containSubset", options.expectedResult.value);
|
|
84
102
|
}
|
|
85
103
|
}
|
|
86
104
|
else {
|
|
87
|
-
assert.
|
|
88
|
-
assert.
|
|
105
|
+
assert.equal(reportOfUsecase?.result.issues.filter(issue => issue.type === a11y_1.IssueType.Error).length, 0, validationFailedMessage);
|
|
106
|
+
assert.equal(reportOfUsecase?.result.issues.filter(issue => issue.type === a11y_1.IssueType.Warning).length, 0, validationFailedMessage);
|
|
89
107
|
}
|
|
90
108
|
}
|
|
91
|
-
function logAllA11yRuleResult(
|
|
92
|
-
result.
|
|
109
|
+
function logAllA11yRuleResult(reference, reportOfUsecase) {
|
|
110
|
+
reportOfUsecase?.result.issues.forEach(a11yIssue => {
|
|
93
111
|
// logValidatingA11yRule(result.reference, ruleResult);
|
|
94
|
-
logA11yRuleResult(
|
|
112
|
+
logA11yRuleResult(reference, a11yIssue);
|
|
95
113
|
});
|
|
96
114
|
}
|
|
97
|
-
function logA11yRuleResult(reference,
|
|
98
|
-
switch (
|
|
99
|
-
case
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
case a11y_1.A11yResultStatus.MANUAL:
|
|
103
|
-
logNodeToCheckManually(reference, ruleResult);
|
|
104
|
-
break;
|
|
105
|
-
case a11y_1.A11yResultStatus.UNKNOWN:
|
|
106
|
-
break;
|
|
107
|
-
case a11y_1.A11yResultStatus.SUCCESS:
|
|
115
|
+
function logA11yRuleResult(reference, a11yIssue) {
|
|
116
|
+
switch (a11yIssue.type) {
|
|
117
|
+
case "error":
|
|
118
|
+
case "warning":
|
|
119
|
+
logNonCompliantNode(reference, a11yIssue);
|
|
108
120
|
break;
|
|
121
|
+
// case A11yResultStatus.MANUAL:
|
|
122
|
+
// logNodeToCheckManually(reference, ruleResult);
|
|
123
|
+
// break;
|
|
124
|
+
// case A11yResultStatus.UNKNOWN:
|
|
125
|
+
// break;
|
|
126
|
+
// case A11yResultStatus.SUCCESS:
|
|
127
|
+
// break;
|
|
109
128
|
}
|
|
110
129
|
}
|
|
111
130
|
function buildCypressLog(name, message, consoleLog) {
|
|
@@ -118,38 +137,43 @@ function buildCypressLog(name, message, consoleLog) {
|
|
|
118
137
|
}
|
|
119
138
|
});
|
|
120
139
|
}
|
|
121
|
-
function logNonCompliantNode(reference,
|
|
122
|
-
const
|
|
123
|
-
const log = buildCypressLog(`${reference.
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
const nodesToCheckManually = ruleResult.getNodesToCheckManually();
|
|
129
|
-
const log = buildCypressLog(`${reference.name} to validate manually !`, `criteria ${ruleResult.rule.criterion} on ${nodesToCheckManually.length} nodes`, getConsoleDetails(reference, ruleResult, nodesToCheckManually));
|
|
130
|
-
nodesToCheckManually.forEach(nodeToCheck => log.set({ $el: (0, jquery_1.default)(nodeToCheck.node.domNode) }).snapshot());
|
|
131
|
-
log.finish();
|
|
140
|
+
function logNonCompliantNode(reference, a11yIssue) {
|
|
141
|
+
const errorNode = a11yIssue.htmlElement;
|
|
142
|
+
const log = buildCypressLog(`${reference.toString()} error !`, `criteria ${a11yIssue.code} with message : ${a11yIssue.message}`, getConsoleDetails(a11yIssue, errorNode));
|
|
143
|
+
if (errorNode) {
|
|
144
|
+
log.set({ $el: (0, jquery_1.default)(errorNode) }).snapshot();
|
|
145
|
+
}
|
|
146
|
+
log.error(new Error(`Validation ${a11yIssue.type} on node: ${errorNode}`));
|
|
132
147
|
}
|
|
133
|
-
function
|
|
148
|
+
// function logNodeToCheckManually(reference: A11yReferenceEnum, ruleResult: A11yRuleResult) {
|
|
149
|
+
// const nodesToCheckManually = ruleResult.getNodesToCheckManually();
|
|
150
|
+
// const log = buildCypressLog(
|
|
151
|
+
// `${reference.toString()} to validate manually !`,
|
|
152
|
+
// `criteria ${ruleResult.rule.criterion} on ${nodesToCheckManually.length} nodes`,
|
|
153
|
+
// getConsoleDetails(reference, ruleResult, nodesToCheckManually)
|
|
154
|
+
// );
|
|
155
|
+
// nodesToCheckManually.forEach(nodeToCheck => log.set({ $el: $(nodeToCheck.node.domNode) }).snapshot());
|
|
156
|
+
// log.finish();
|
|
157
|
+
// }
|
|
158
|
+
function getConsoleDetails(a11yIssue, nodes) {
|
|
134
159
|
return {
|
|
135
|
-
Id:
|
|
136
|
-
WCAG:
|
|
137
|
-
targetUrl: ruleResult.url,
|
|
138
|
-
|
|
139
|
-
"Element type": ruleResult.rule.elementType,
|
|
140
|
-
|
|
141
|
-
|
|
160
|
+
// Id: a11yIssue.runnerExtras.help rule.id,
|
|
161
|
+
// WCAG: a11yIssue.code,
|
|
162
|
+
// targetUrl: ruleResult.url,
|
|
163
|
+
criteria: a11yIssue.code,
|
|
164
|
+
// "Element type": ruleResult.rule.elementType,
|
|
165
|
+
help: `${a11yIssue.runnerExtras.help}, ${a11yIssue.runnerExtras.helpUrl}`,
|
|
166
|
+
runnerExtra: a11yIssue.runnerExtras,
|
|
142
167
|
nodes: nodes
|
|
143
168
|
};
|
|
144
169
|
}
|
|
145
|
-
function storeA11yResult(
|
|
146
|
-
const
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
writeA11yReport(list);
|
|
170
|
+
function storeA11yResult(reportOfUsecase) {
|
|
171
|
+
const reportOfUsecaseToSore = lodash_1.default.cloneDeep(reportOfUsecase);
|
|
172
|
+
reportOfUsecaseToSore.result.issues.forEach(issue => delete issue.htmlElement);
|
|
173
|
+
const filePath = (0, __common_1.getA11yResultFilePath)();
|
|
174
|
+
return cy.readFile(filePath).then((report) => {
|
|
175
|
+
report.app.usecases.push(reportOfUsecaseToSore);
|
|
176
|
+
writeA11yReport(report);
|
|
153
177
|
});
|
|
154
178
|
}
|
|
155
179
|
function readA11yReport() {
|
|
@@ -23,14 +23,13 @@ exports.findWithRoleAndNameAndContentEnable = findWithRoleAndNameAndContentEnabl
|
|
|
23
23
|
exports.findWithRoleAndNameAndAttribute = findWithRoleAndNameAndAttribute;
|
|
24
24
|
exports.click = click;
|
|
25
25
|
const _context_1 = require("./_context");
|
|
26
|
-
const a11y_1 = require("@uuv/a11y");
|
|
27
26
|
const __common_1 = require("./_.common");
|
|
28
27
|
beforeEach(function () {
|
|
29
28
|
cy.wrap(new _context_1.Context()).as("context");
|
|
30
29
|
});
|
|
31
30
|
after(function () {
|
|
32
31
|
if ((0, __common_1.shouldGenerateA11yReport)()) {
|
|
33
|
-
cy.showUvvA11yReport(
|
|
32
|
+
// cy.showUvvA11yReport(A11yReferenceEnum.RGAA);
|
|
34
33
|
}
|
|
35
34
|
return null;
|
|
36
35
|
});
|
package/dist/cucumber/step_definitions/cypress/generated/_en-generated-cucumber-steps-definition.js
CHANGED
|
@@ -410,36 +410,47 @@ const __common_1 = require("./../_.common");
|
|
|
410
410
|
* Check that the current page have no accessibility issue for [axe-core](https://github.com/dequelabs/axe-core/blob/develop/doc/rule-descriptions.md)
|
|
411
411
|
* */
|
|
412
412
|
(0, cypress_cucumber_preprocessor_1.Then)(`I should not have any axe-core accessibility issue`, function () {
|
|
413
|
-
cy.
|
|
414
|
-
cy.
|
|
413
|
+
cy.injectUvvA11y();
|
|
414
|
+
cy.checkUvvA11y({
|
|
415
|
+
reference: a11y_1.A11yReferenceEnum.WCAG_WEB
|
|
416
|
+
});
|
|
415
417
|
});
|
|
416
418
|
/**
|
|
417
419
|
* Check that the current page have not critical accessibility issue for [axe-core](https://github.com/dequelabs/axe-core/blob/develop/doc/rule-descriptions.md)
|
|
418
420
|
* */
|
|
419
421
|
(0, cypress_cucumber_preprocessor_1.Then)(`I should not have any axe-core critical accessibility issue`, function () {
|
|
420
|
-
cy.
|
|
421
|
-
cy.
|
|
422
|
-
|
|
422
|
+
cy.injectUvvA11y();
|
|
423
|
+
cy.checkUvvA11y({
|
|
424
|
+
reference: a11y_1.A11yReferenceEnum.WCAG_WEB,
|
|
425
|
+
runnerOptions: {
|
|
426
|
+
includedImpacts: ["critical"]
|
|
427
|
+
}
|
|
423
428
|
});
|
|
424
429
|
});
|
|
425
430
|
/**
|
|
426
431
|
* Check that the current page have not accessibility issue for [axe-core](https://github.com/dequelabs/axe-core/blob/develop/doc/rule-descriptions.md) with one or more impacts in: 'minor','moderate','serious','critical'
|
|
427
432
|
* */
|
|
428
433
|
(0, cypress_cucumber_preprocessor_1.Then)(`I should not have any axe-core accessibility issue with {} impact(s)`, function (impacts) {
|
|
429
|
-
cy.
|
|
430
|
-
cy.
|
|
431
|
-
|
|
434
|
+
cy.injectUvvA11y();
|
|
435
|
+
cy.checkUvvA11y({
|
|
436
|
+
reference: a11y_1.A11yReferenceEnum.WCAG_WEB,
|
|
437
|
+
runnerOptions: {
|
|
438
|
+
includedImpacts: [impacts]
|
|
439
|
+
}
|
|
432
440
|
});
|
|
433
441
|
});
|
|
434
442
|
/**
|
|
435
443
|
* Check that the current page have not accessibility issue for [axe-core](https://github.com/dequelabs/axe-core/blob/develop/doc/rule-descriptions.md) [with one or more Accessibility Standards](https://github.com/dequelabs/axe-core/blob/HEAD/doc/API.md#axe-core-tags)
|
|
436
444
|
* */
|
|
437
445
|
(0, cypress_cucumber_preprocessor_1.Then)(`I should not have any axe-core accessibility issue with accessibility standard(s) {}`, function (tags) {
|
|
438
|
-
cy.
|
|
439
|
-
cy.
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
446
|
+
cy.injectUvvA11y();
|
|
447
|
+
cy.checkUvvA11y({
|
|
448
|
+
reference: a11y_1.A11yReferenceEnum.WCAG_WEB,
|
|
449
|
+
runnerOptions: {
|
|
450
|
+
runOnly: {
|
|
451
|
+
type: "tag",
|
|
452
|
+
values: [tags]
|
|
453
|
+
}
|
|
443
454
|
}
|
|
444
455
|
});
|
|
445
456
|
});
|
|
@@ -458,9 +469,12 @@ const __common_1 = require("./../_.common");
|
|
|
458
469
|
* Check that the current page have no accessibility issue for [axe-core](https://github.com/dequelabs/axe-core/blob/develop/doc/rule-descriptions.md) [with an option](https://github.com/dequelabs/axe-core/blob/HEAD/doc/API.md#options-parameter)
|
|
459
470
|
* */
|
|
460
471
|
(0, cypress_cucumber_preprocessor_1.Then)(`I should not have any axe-core accessibility issue with option json fixture {}`, function (option) {
|
|
461
|
-
cy.
|
|
472
|
+
cy.injectUvvA11y();
|
|
462
473
|
cy.fixture(option).then(data => {
|
|
463
|
-
cy.
|
|
474
|
+
cy.checkUvvA11y({
|
|
475
|
+
reference: a11y_1.A11yReferenceEnum.WCAG_WEB,
|
|
476
|
+
runnerOptions: data
|
|
477
|
+
});
|
|
464
478
|
});
|
|
465
479
|
});
|
|
466
480
|
/**
|
|
@@ -468,15 +482,28 @@ const __common_1 = require("./../_.common");
|
|
|
468
482
|
* */
|
|
469
483
|
(0, cypress_cucumber_preprocessor_1.Then)(`I should not have any rgaa accessibility issue`, function () {
|
|
470
484
|
cy.injectUvvA11y();
|
|
471
|
-
cy.checkUvvA11y(
|
|
485
|
+
cy.checkUvvA11y({
|
|
486
|
+
reference: a11y_1.A11yReferenceEnum.RGAA
|
|
487
|
+
});
|
|
472
488
|
});
|
|
473
489
|
(0, cypress_cucumber_preprocessor_1.Then)(`I should have the following result based on the rgaa reference`, function (expectedResult) {
|
|
474
490
|
cy.injectUvvA11y();
|
|
475
|
-
cy.checkUvvA11y(
|
|
491
|
+
cy.checkUvvA11y({
|
|
492
|
+
reference: a11y_1.A11yReferenceEnum.RGAA,
|
|
493
|
+
expectedResult: {
|
|
494
|
+
value: JSON.parse(expectedResult)
|
|
495
|
+
}
|
|
496
|
+
});
|
|
476
497
|
});
|
|
477
498
|
(0, cypress_cucumber_preprocessor_1.Then)(`I should have the following partial result based on the rgaa reference`, function (expectedResult) {
|
|
478
499
|
cy.injectUvvA11y();
|
|
479
|
-
cy.checkUvvA11y(
|
|
500
|
+
cy.checkUvvA11y({
|
|
501
|
+
reference: a11y_1.A11yReferenceEnum.RGAA,
|
|
502
|
+
expectedResult: {
|
|
503
|
+
value: JSON.parse(expectedResult),
|
|
504
|
+
isContainsMode: true
|
|
505
|
+
}
|
|
506
|
+
});
|
|
480
507
|
});
|
|
481
508
|
function haveKeyBoardFocused() {
|
|
482
509
|
return Cypress.$(":focus").length > 0;
|
package/dist/cucumber/step_definitions/cypress/generated/_fr-generated-cucumber-steps-definition.js
CHANGED
|
@@ -410,36 +410,47 @@ const __common_1 = require("./../_.common");
|
|
|
410
410
|
* Vérifie sur la page courante qu'il n'y a aucune erreur d'accessibilité [axe-core](https://github.com/dequelabs/axe-core/blob/develop/doc/rule-descriptions.md)
|
|
411
411
|
* */
|
|
412
412
|
(0, cypress_cucumber_preprocessor_1.Then)(`je ne dois pas avoir de problèmes d'accessibilité axe-core`, function () {
|
|
413
|
-
cy.
|
|
414
|
-
cy.
|
|
413
|
+
cy.injectUvvA11y();
|
|
414
|
+
cy.checkUvvA11y({
|
|
415
|
+
reference: a11y_1.A11yReferenceEnum.WCAG_WEB
|
|
416
|
+
});
|
|
415
417
|
});
|
|
416
418
|
/**
|
|
417
419
|
* Vérifie sur la page courante qu'il n'y a aucune erreur d'accessibilité [axe-core](https://github.com/dequelabs/axe-core/blob/develop/doc/rule-descriptions.md) de niveau critique
|
|
418
420
|
* */
|
|
419
421
|
(0, cypress_cucumber_preprocessor_1.Then)(`je ne dois pas avoir de problèmes d'accessibilité axe-core de niveau critique`, function () {
|
|
420
|
-
cy.
|
|
421
|
-
cy.
|
|
422
|
-
|
|
422
|
+
cy.injectUvvA11y();
|
|
423
|
+
cy.checkUvvA11y({
|
|
424
|
+
reference: a11y_1.A11yReferenceEnum.WCAG_WEB,
|
|
425
|
+
runnerOptions: {
|
|
426
|
+
includedImpacts: ["critical"]
|
|
427
|
+
}
|
|
423
428
|
});
|
|
424
429
|
});
|
|
425
430
|
/**
|
|
426
431
|
* Vérifie sur la page courante qu'il n'y a aucune erreur d'accessibilité [axe-core](https://github.com/dequelabs/axe-core/blob/develop/doc/rule-descriptions.md)avec un ou plusieurs impacts parmi : 'minor','moderate','serious','critical'
|
|
427
432
|
* */
|
|
428
433
|
(0, cypress_cucumber_preprocessor_1.Then)(`je ne dois pas avoir de problèmes d'accessibilité axe-core avec l(es) impact(s) {}`, function (impacts) {
|
|
429
|
-
cy.
|
|
430
|
-
cy.
|
|
431
|
-
|
|
434
|
+
cy.injectUvvA11y();
|
|
435
|
+
cy.checkUvvA11y({
|
|
436
|
+
reference: a11y_1.A11yReferenceEnum.WCAG_WEB,
|
|
437
|
+
runnerOptions: {
|
|
438
|
+
includedImpacts: [impacts]
|
|
439
|
+
}
|
|
432
440
|
});
|
|
433
441
|
});
|
|
434
442
|
/**
|
|
435
443
|
* Vérifie sur la page courante qu'il n'y a aucune erreur d'accessibilité [axe-core](https://github.com/dequelabs/axe-core/blob/develop/doc/rule-descriptions.md) [avec le ou les standards d'accessibilité](https://github.com/dequelabs/axe-core/blob/HEAD/doc/API.md#axe-core-tags)
|
|
436
444
|
* */
|
|
437
445
|
(0, cypress_cucumber_preprocessor_1.Then)(`je ne dois pas avoir de problèmes d'accessibilité axe-core avec le(s) standard(s) {}`, function (tags) {
|
|
438
|
-
cy.
|
|
439
|
-
cy.
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
446
|
+
cy.injectUvvA11y();
|
|
447
|
+
cy.checkUvvA11y({
|
|
448
|
+
reference: a11y_1.A11yReferenceEnum.WCAG_WEB,
|
|
449
|
+
runnerOptions: {
|
|
450
|
+
runOnly: {
|
|
451
|
+
type: "tag",
|
|
452
|
+
values: [tags]
|
|
453
|
+
}
|
|
443
454
|
}
|
|
444
455
|
});
|
|
445
456
|
});
|
|
@@ -458,9 +469,12 @@ const __common_1 = require("./../_.common");
|
|
|
458
469
|
* Vérifie sur la page courante qu'il n'y a aucune erreur d'accessibilité [axe-core](https://github.com/dequelabs/axe-core/blob/develop/doc/rule-descriptions.md) [avec l'option](https://github.com/dequelabs/axe-core/blob/HEAD/doc/API.md#options-parameter)
|
|
459
470
|
* */
|
|
460
471
|
(0, cypress_cucumber_preprocessor_1.Then)(`je ne dois pas avoir de problèmes d'accessibilité axe-core avec le fichier json suivant d'option {}`, function (option) {
|
|
461
|
-
cy.
|
|
472
|
+
cy.injectUvvA11y();
|
|
462
473
|
cy.fixture(option).then(data => {
|
|
463
|
-
cy.
|
|
474
|
+
cy.checkUvvA11y({
|
|
475
|
+
reference: a11y_1.A11yReferenceEnum.WCAG_WEB,
|
|
476
|
+
runnerOptions: data
|
|
477
|
+
});
|
|
464
478
|
});
|
|
465
479
|
});
|
|
466
480
|
/**
|
|
@@ -468,15 +482,28 @@ const __common_1 = require("./../_.common");
|
|
|
468
482
|
* */
|
|
469
483
|
(0, cypress_cucumber_preprocessor_1.Then)(`je ne dois pas avoir de problèmes d'accessibilité rgaa`, function () {
|
|
470
484
|
cy.injectUvvA11y();
|
|
471
|
-
cy.checkUvvA11y(
|
|
485
|
+
cy.checkUvvA11y({
|
|
486
|
+
reference: a11y_1.A11yReferenceEnum.RGAA
|
|
487
|
+
});
|
|
472
488
|
});
|
|
473
489
|
(0, cypress_cucumber_preprocessor_1.Then)(`je dois avoir les résultats suivants selon le référentiel rgaa`, function (expectedResult) {
|
|
474
490
|
cy.injectUvvA11y();
|
|
475
|
-
cy.checkUvvA11y(
|
|
491
|
+
cy.checkUvvA11y({
|
|
492
|
+
reference: a11y_1.A11yReferenceEnum.RGAA,
|
|
493
|
+
expectedResult: {
|
|
494
|
+
value: JSON.parse(expectedResult)
|
|
495
|
+
}
|
|
496
|
+
});
|
|
476
497
|
});
|
|
477
498
|
(0, cypress_cucumber_preprocessor_1.Then)(`je dois avoir les résultats partiels suivants selon le référentiel rgaa`, function (expectedResult) {
|
|
478
499
|
cy.injectUvvA11y();
|
|
479
|
-
cy.checkUvvA11y(
|
|
500
|
+
cy.checkUvvA11y({
|
|
501
|
+
reference: a11y_1.A11yReferenceEnum.RGAA,
|
|
502
|
+
expectedResult: {
|
|
503
|
+
value: JSON.parse(expectedResult),
|
|
504
|
+
isContainsMode: true
|
|
505
|
+
}
|
|
506
|
+
});
|
|
480
507
|
});
|
|
481
508
|
function haveKeyBoardFocused() {
|
|
482
509
|
return Cypress.$(":focus").length > 0;
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
import "@testing-library/cypress/add-commands";
|
|
14
14
|
import "cypress-axe";
|
|
15
15
|
import { ByRoleOptions } from "@testing-library/cypress";
|
|
16
|
+
import { UuvA11yOptions } from "../cucumber/step_definitions/cypress/_.common";
|
|
16
17
|
import { Context } from "../cucumber/step_definitions/cypress/_context";
|
|
17
18
|
import "cypress-real-events";
|
|
18
19
|
import { A11yReferenceEnum, A11yResult } from "@uuv/a11y";
|
|
@@ -30,7 +31,7 @@ declare global {
|
|
|
30
31
|
uuvFindAllByRole(role: string, roleOptions: ByRoleOptions): Cypress.Chainable<JQuery<HTMLElement>>;
|
|
31
32
|
uuvFoundedElement(): Cypress.Chainable<JQuery<HTMLElement>>;
|
|
32
33
|
injectUvvA11y(): Cypress.Chainable<void>;
|
|
33
|
-
checkUvvA11y(
|
|
34
|
+
checkUvvA11y(options: UuvA11yOptions): Cypress.Chainable<A11yResult>;
|
|
34
35
|
showUvvA11yReport(reference: A11yReferenceEnum): Cypress.Chainable<A11yResult[]>;
|
|
35
36
|
}
|
|
36
37
|
}
|
|
@@ -41,6 +41,7 @@ const webpack = __importStar(require("@cypress/webpack-preprocessor"));
|
|
|
41
41
|
const cypress_cucumber_preprocessor_1 = require("@badeball/cypress-cucumber-preprocessor");
|
|
42
42
|
const fs_1 = __importDefault(require("fs"));
|
|
43
43
|
const event_1 = require("@uuv/runner-commons/runner/event");
|
|
44
|
+
const path_1 = __importDefault(require("path"));
|
|
44
45
|
async function setupNodeEvents(on, config) {
|
|
45
46
|
const startedFile = [];
|
|
46
47
|
await (0, cypress_cucumber_preprocessor_1.addCucumberPreprocessorPlugin)(on, config);
|
|
@@ -90,7 +91,7 @@ async function setupNodeEvents(on, config) {
|
|
|
90
91
|
const generateA11yReport = config.env["uuvOptions"].report.a11y.enabled;
|
|
91
92
|
clearA11yReport(a11yReportFilePath);
|
|
92
93
|
if (generateA11yReport === true) {
|
|
93
|
-
initA11yReport(a11yReportFilePath);
|
|
94
|
+
await initA11yReport(a11yReportFilePath);
|
|
94
95
|
}
|
|
95
96
|
event_1.UUVEventEmitter.getInstance().emitProgressStart();
|
|
96
97
|
});
|
|
@@ -146,10 +147,15 @@ async function setupNodeEvents(on, config) {
|
|
|
146
147
|
fs_1.default.rmSync(reportFilePath);
|
|
147
148
|
}
|
|
148
149
|
}
|
|
149
|
-
function initA11yReport(reportFilePath) {
|
|
150
|
+
async function initA11yReport(reportFilePath) {
|
|
151
|
+
// eslint-disable-next-line dot-notation
|
|
152
|
+
const packageJson = await Promise.resolve(`${path_1.default.join(config.env["uuvOptions"].projectDir, "package.json")}`).then(s => __importStar(require(s)));
|
|
150
153
|
const emptyReport = {
|
|
151
|
-
|
|
152
|
-
|
|
154
|
+
app: {
|
|
155
|
+
name: packageJson.name,
|
|
156
|
+
description: packageJson.description,
|
|
157
|
+
usecases: []
|
|
158
|
+
}
|
|
153
159
|
};
|
|
154
160
|
fs_1.default.writeFileSync(reportFilePath, JSON.stringify(emptyReport, null, 4), { flag: "w" });
|
|
155
161
|
}
|
|
@@ -89,7 +89,10 @@ class UUVCliCypressRunner {
|
|
|
89
89
|
executeOpenCommand(options) {
|
|
90
90
|
return this.getCypress().open({
|
|
91
91
|
project: this.projectDir,
|
|
92
|
-
env:
|
|
92
|
+
env: {
|
|
93
|
+
uuvOptions: options,
|
|
94
|
+
...options.extraArgs
|
|
95
|
+
},
|
|
93
96
|
});
|
|
94
97
|
}
|
|
95
98
|
createReportDirectories(options) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uuv/cypress",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.44.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"author": "Louis Fredice NJAKO MOLOM (https://github.com/luifr10) & Stanley SERVICAL (https://github.com/stanlee974)",
|
|
6
6
|
"description": "A solution to facilitate the writing and execution of E2E tests understandable by any human being using cucumber(BDD) and cypress",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"unit-tests": "jest --runInBand --coverage --config=./jest.config.ts --testPathIgnorePatterns=src/tests/report",
|
|
40
40
|
"verify-report": "jest --runInBand --coverage --config=./jest.config.ts --testPathPattern=src/tests/report",
|
|
41
41
|
"e2e-test:run": "ts-node test.ts e2e",
|
|
42
|
-
"e2e-test:open": "ts-node test.ts open
|
|
42
|
+
"e2e-test:open": "ts-node test.ts open",
|
|
43
43
|
"test": "npm run unit-test && npm run e2e-test:run",
|
|
44
44
|
"lint": "eslint -c .eslintrc.json"
|
|
45
45
|
},
|
|
@@ -47,20 +47,21 @@
|
|
|
47
47
|
"@badeball/cypress-cucumber-preprocessor": "20.1.2",
|
|
48
48
|
"@cypress/webpack-preprocessor": "6.0.2",
|
|
49
49
|
"@testing-library/cypress": "10.0.2",
|
|
50
|
-
"@uuv/a11y": "1.0.0-beta.
|
|
51
|
-
"@uuv/runner-commons": "2.
|
|
50
|
+
"@uuv/a11y": "1.0.0-beta.56",
|
|
51
|
+
"@uuv/runner-commons": "2.38.0",
|
|
52
52
|
"axe-core": "4.10.2",
|
|
53
53
|
"chai-subset": "^1.6.0",
|
|
54
|
-
"cypress": "13.16.
|
|
54
|
+
"cypress": "13.16.1",
|
|
55
55
|
"cypress-axe": "1.5.0",
|
|
56
56
|
"cypress-real-events": "^1.10.0",
|
|
57
57
|
"is-admin": "4.0.0",
|
|
58
58
|
"junit-report-merger": "^7.0.0",
|
|
59
|
+
"lodash": "^4.17.21",
|
|
59
60
|
"multiple-cucumber-html-reporter": "3.8.0",
|
|
60
61
|
"path-browserify": "^1.0.1",
|
|
61
62
|
"ts-node": "10.9.2",
|
|
62
63
|
"typescript": "5.7.2",
|
|
63
|
-
"webpack": "5.
|
|
64
|
+
"webpack": "5.95.0"
|
|
64
65
|
},
|
|
65
66
|
"types": "./dist/index.d.ts",
|
|
66
67
|
"main": "./dist/index.js",
|
package/src/cucumber/step_definitions/cypress/generated/_en-generated-cucumber-steps-definition.ts
CHANGED
|
@@ -520,8 +520,10 @@ Then(`I should see an element with selector {string}`, function(selector: string
|
|
|
520
520
|
Then(
|
|
521
521
|
`I should not have any axe-core accessibility issue`,
|
|
522
522
|
function() {
|
|
523
|
-
|
|
524
|
-
|
|
523
|
+
cy.injectUvvA11y();
|
|
524
|
+
cy.checkUvvA11y({
|
|
525
|
+
reference: A11yReferenceEnum.WCAG_WEB
|
|
526
|
+
});
|
|
525
527
|
});
|
|
526
528
|
|
|
527
529
|
/**
|
|
@@ -530,9 +532,12 @@ Then(
|
|
|
530
532
|
Then(
|
|
531
533
|
`I should not have any axe-core critical accessibility issue`,
|
|
532
534
|
function() {
|
|
533
|
-
cy.
|
|
534
|
-
cy.
|
|
535
|
-
|
|
535
|
+
cy.injectUvvA11y();
|
|
536
|
+
cy.checkUvvA11y({
|
|
537
|
+
reference: A11yReferenceEnum.WCAG_WEB,
|
|
538
|
+
runnerOptions: {
|
|
539
|
+
includedImpacts: ["critical"]
|
|
540
|
+
}
|
|
536
541
|
});
|
|
537
542
|
});
|
|
538
543
|
|
|
@@ -542,9 +547,12 @@ Then(
|
|
|
542
547
|
Then(
|
|
543
548
|
`I should not have any axe-core accessibility issue with {} impact(s)`,
|
|
544
549
|
function(impacts: any) {
|
|
545
|
-
cy.
|
|
546
|
-
cy.
|
|
547
|
-
|
|
550
|
+
cy.injectUvvA11y();
|
|
551
|
+
cy.checkUvvA11y({
|
|
552
|
+
reference: A11yReferenceEnum.WCAG_WEB,
|
|
553
|
+
runnerOptions: {
|
|
554
|
+
includedImpacts: [impacts]
|
|
555
|
+
}
|
|
548
556
|
});
|
|
549
557
|
});
|
|
550
558
|
|
|
@@ -554,12 +562,15 @@ Then(
|
|
|
554
562
|
Then(
|
|
555
563
|
`I should not have any axe-core accessibility issue with accessibility standard(s) {}`,
|
|
556
564
|
function(tags: any) {
|
|
557
|
-
cy.
|
|
558
|
-
cy.
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
565
|
+
cy.injectUvvA11y();
|
|
566
|
+
cy.checkUvvA11y({
|
|
567
|
+
reference: A11yReferenceEnum.WCAG_WEB,
|
|
568
|
+
runnerOptions: {
|
|
569
|
+
runOnly: {
|
|
570
|
+
type: "tag",
|
|
571
|
+
values: [tags]
|
|
572
|
+
}
|
|
573
|
+
}
|
|
563
574
|
});
|
|
564
575
|
});
|
|
565
576
|
|
|
@@ -583,9 +594,12 @@ Then(
|
|
|
583
594
|
Then(
|
|
584
595
|
`I should not have any axe-core accessibility issue with option json fixture {}`,
|
|
585
596
|
function(option: any) {
|
|
586
|
-
cy.
|
|
597
|
+
cy.injectUvvA11y();
|
|
587
598
|
cy.fixture(option).then(data => {
|
|
588
|
-
|
|
599
|
+
cy.checkUvvA11y({
|
|
600
|
+
reference: A11yReferenceEnum.WCAG_WEB,
|
|
601
|
+
runnerOptions: data
|
|
602
|
+
});
|
|
589
603
|
});
|
|
590
604
|
});
|
|
591
605
|
|
|
@@ -597,21 +611,34 @@ Then(
|
|
|
597
611
|
`I should not have any rgaa accessibility issue`,
|
|
598
612
|
function() {
|
|
599
613
|
cy.injectUvvA11y();
|
|
600
|
-
cy.checkUvvA11y(
|
|
614
|
+
cy.checkUvvA11y({
|
|
615
|
+
reference: A11yReferenceEnum.RGAA
|
|
616
|
+
});
|
|
601
617
|
});
|
|
602
618
|
|
|
603
619
|
Then(
|
|
604
620
|
`I should have the following result based on the rgaa reference`,
|
|
605
621
|
function(expectedResult: string) {
|
|
606
622
|
cy.injectUvvA11y();
|
|
607
|
-
cy.checkUvvA11y(
|
|
623
|
+
cy.checkUvvA11y({
|
|
624
|
+
reference: A11yReferenceEnum.RGAA,
|
|
625
|
+
expectedResult: {
|
|
626
|
+
value: JSON.parse(expectedResult)
|
|
627
|
+
}
|
|
628
|
+
});
|
|
608
629
|
});
|
|
609
630
|
|
|
610
631
|
Then(
|
|
611
632
|
`I should have the following partial result based on the rgaa reference`,
|
|
612
633
|
function(expectedResult: string) {
|
|
613
634
|
cy.injectUvvA11y();
|
|
614
|
-
cy.checkUvvA11y(
|
|
635
|
+
cy.checkUvvA11y({
|
|
636
|
+
reference: A11yReferenceEnum.RGAA,
|
|
637
|
+
expectedResult: {
|
|
638
|
+
value: JSON.parse(expectedResult),
|
|
639
|
+
isContainsMode: true
|
|
640
|
+
}
|
|
641
|
+
});
|
|
615
642
|
});
|
|
616
643
|
|
|
617
644
|
function haveKeyBoardFocused() {
|
package/src/cucumber/step_definitions/cypress/generated/_fr-generated-cucumber-steps-definition.ts
CHANGED
|
@@ -520,8 +520,10 @@ Then(`je dois voir un élément ayant pour sélecteur {string}`, function(select
|
|
|
520
520
|
Then(
|
|
521
521
|
`je ne dois pas avoir de problèmes d'accessibilité axe-core`,
|
|
522
522
|
function() {
|
|
523
|
-
|
|
524
|
-
|
|
523
|
+
cy.injectUvvA11y();
|
|
524
|
+
cy.checkUvvA11y({
|
|
525
|
+
reference: A11yReferenceEnum.WCAG_WEB
|
|
526
|
+
});
|
|
525
527
|
});
|
|
526
528
|
|
|
527
529
|
/**
|
|
@@ -530,9 +532,12 @@ Then(
|
|
|
530
532
|
Then(
|
|
531
533
|
`je ne dois pas avoir de problèmes d'accessibilité axe-core de niveau critique`,
|
|
532
534
|
function() {
|
|
533
|
-
cy.
|
|
534
|
-
cy.
|
|
535
|
-
|
|
535
|
+
cy.injectUvvA11y();
|
|
536
|
+
cy.checkUvvA11y({
|
|
537
|
+
reference: A11yReferenceEnum.WCAG_WEB,
|
|
538
|
+
runnerOptions: {
|
|
539
|
+
includedImpacts: ["critical"]
|
|
540
|
+
}
|
|
536
541
|
});
|
|
537
542
|
});
|
|
538
543
|
|
|
@@ -542,9 +547,12 @@ Then(
|
|
|
542
547
|
Then(
|
|
543
548
|
`je ne dois pas avoir de problèmes d'accessibilité axe-core avec l(es) impact(s) {}`,
|
|
544
549
|
function(impacts: any) {
|
|
545
|
-
cy.
|
|
546
|
-
cy.
|
|
547
|
-
|
|
550
|
+
cy.injectUvvA11y();
|
|
551
|
+
cy.checkUvvA11y({
|
|
552
|
+
reference: A11yReferenceEnum.WCAG_WEB,
|
|
553
|
+
runnerOptions: {
|
|
554
|
+
includedImpacts: [impacts]
|
|
555
|
+
}
|
|
548
556
|
});
|
|
549
557
|
});
|
|
550
558
|
|
|
@@ -554,12 +562,15 @@ Then(
|
|
|
554
562
|
Then(
|
|
555
563
|
`je ne dois pas avoir de problèmes d'accessibilité axe-core avec le(s) standard(s) {}`,
|
|
556
564
|
function(tags: any) {
|
|
557
|
-
cy.
|
|
558
|
-
cy.
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
565
|
+
cy.injectUvvA11y();
|
|
566
|
+
cy.checkUvvA11y({
|
|
567
|
+
reference: A11yReferenceEnum.WCAG_WEB,
|
|
568
|
+
runnerOptions: {
|
|
569
|
+
runOnly: {
|
|
570
|
+
type: "tag",
|
|
571
|
+
values: [tags]
|
|
572
|
+
}
|
|
573
|
+
}
|
|
563
574
|
});
|
|
564
575
|
});
|
|
565
576
|
|
|
@@ -583,9 +594,12 @@ Then(
|
|
|
583
594
|
Then(
|
|
584
595
|
`je ne dois pas avoir de problèmes d'accessibilité axe-core avec le fichier json suivant d'option {}`,
|
|
585
596
|
function(option: any) {
|
|
586
|
-
cy.
|
|
597
|
+
cy.injectUvvA11y();
|
|
587
598
|
cy.fixture(option).then(data => {
|
|
588
|
-
|
|
599
|
+
cy.checkUvvA11y({
|
|
600
|
+
reference: A11yReferenceEnum.WCAG_WEB,
|
|
601
|
+
runnerOptions: data
|
|
602
|
+
});
|
|
589
603
|
});
|
|
590
604
|
});
|
|
591
605
|
|
|
@@ -597,21 +611,34 @@ Then(
|
|
|
597
611
|
`je ne dois pas avoir de problèmes d'accessibilité rgaa`,
|
|
598
612
|
function() {
|
|
599
613
|
cy.injectUvvA11y();
|
|
600
|
-
cy.checkUvvA11y(
|
|
614
|
+
cy.checkUvvA11y({
|
|
615
|
+
reference: A11yReferenceEnum.RGAA
|
|
616
|
+
});
|
|
601
617
|
});
|
|
602
618
|
|
|
603
619
|
Then(
|
|
604
620
|
`je dois avoir les résultats suivants selon le référentiel rgaa`,
|
|
605
621
|
function(expectedResult: string) {
|
|
606
622
|
cy.injectUvvA11y();
|
|
607
|
-
cy.checkUvvA11y(
|
|
623
|
+
cy.checkUvvA11y({
|
|
624
|
+
reference: A11yReferenceEnum.RGAA,
|
|
625
|
+
expectedResult: {
|
|
626
|
+
value: JSON.parse(expectedResult)
|
|
627
|
+
}
|
|
628
|
+
});
|
|
608
629
|
});
|
|
609
630
|
|
|
610
631
|
Then(
|
|
611
632
|
`je dois avoir les résultats partiels suivants selon le référentiel rgaa`,
|
|
612
633
|
function(expectedResult: string) {
|
|
613
634
|
cy.injectUvvA11y();
|
|
614
|
-
cy.checkUvvA11y(
|
|
635
|
+
cy.checkUvvA11y({
|
|
636
|
+
reference: A11yReferenceEnum.RGAA,
|
|
637
|
+
expectedResult: {
|
|
638
|
+
value: JSON.parse(expectedResult),
|
|
639
|
+
isContainsMode: true
|
|
640
|
+
}
|
|
641
|
+
});
|
|
615
642
|
});
|
|
616
643
|
|
|
617
644
|
function haveKeyBoardFocused() {
|