@progress/kendo-e2e 0.12.0 → 0.13.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/dist/a11y/a11y-wct-spec.d.ts +18 -0
- package/dist/a11y/a11y-wct-spec.js +155 -0
- package/dist/a11y/a11y-wct-spec.js.map +1 -0
- package/dist/a11y/index.d.ts +1 -0
- package/dist/a11y/index.js +6 -0
- package/dist/a11y/index.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/selenium/browser.d.ts +1 -1
- package/dist/selenium/browser.js +7 -7
- package/dist/selenium/browser.js.map +1 -1
- package/package.json +19 -20
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ThenableWebDriver } from "selenium-webdriver";
|
|
2
|
+
declare type WCTSpecResult = {
|
|
3
|
+
passed: string[];
|
|
4
|
+
skipped: string[];
|
|
5
|
+
errors: string[];
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Check current page for violations against WCT A11y Spec.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* await getWCTSpecViolations(browser, spec, ['k-multiselect-autocomplete']});
|
|
12
|
+
*
|
|
13
|
+
* @param driver WebDriver instance
|
|
14
|
+
* @param spec A spec object (like https://unpkg.com/@progress/wct-a11y-spec@1.0.3/dist/jquery/test-def/test-definitions.json).
|
|
15
|
+
* @param excludeErrors Array of validation IDs that will be skipped.
|
|
16
|
+
*/
|
|
17
|
+
export declare function getWCTSpecViolations(driver: ThenableWebDriver, spec: any, excludeErrors?: string[]): Promise<WCTSpecResult>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.getWCTSpecViolations = void 0;
|
|
13
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
14
|
+
const selenium_webdriver_1 = require("selenium-webdriver");
|
|
15
|
+
/**
|
|
16
|
+
* Check current page for violations against WCT A11y Spec.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* await getWCTSpecViolations(browser, spec, ['k-multiselect-autocomplete']});
|
|
20
|
+
*
|
|
21
|
+
* @param driver WebDriver instance
|
|
22
|
+
* @param spec A spec object (like https://unpkg.com/@progress/wct-a11y-spec@1.0.3/dist/jquery/test-def/test-definitions.json).
|
|
23
|
+
* @param excludeErrors Array of validation IDs that will be skipped.
|
|
24
|
+
*/
|
|
25
|
+
function getWCTSpecViolations(driver, spec, excludeErrors = []) {
|
|
26
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
const passed = [];
|
|
28
|
+
const skipped = [];
|
|
29
|
+
const errors = [];
|
|
30
|
+
const result = { passed, skipped, errors };
|
|
31
|
+
for (const key of Object.keys(spec)) {
|
|
32
|
+
const component = spec[key];
|
|
33
|
+
const rules = component['rules'];
|
|
34
|
+
const keySelector = `.k-${key}`;
|
|
35
|
+
if ((yield driver.findElements(selenium_webdriver_1.By.css(keySelector))).length > 0) {
|
|
36
|
+
for (const rule of rules) {
|
|
37
|
+
const selector = rule['selector'];
|
|
38
|
+
let arraySelector = selector.split(',');
|
|
39
|
+
if (selector !== keySelector &&
|
|
40
|
+
selector.indexOf('.k-animation-container') === -1 &&
|
|
41
|
+
selector.indexOf('.k-list-ul') === -1 &&
|
|
42
|
+
selector.indexOf('.k-list-item') === -1 &&
|
|
43
|
+
selector.indexOf('.k-list-filter') === -1) {
|
|
44
|
+
arraySelector = arraySelector.map(s => keySelector + ' ' + s);
|
|
45
|
+
}
|
|
46
|
+
arraySelector.forEach((sel) => __awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
if ((yield driver.findElements(selenium_webdriver_1.By.css(sel))).length > 0) {
|
|
48
|
+
const checks = rule['checks'], asyncSome = (arr, predicate) => __awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
for (const e of arr) {
|
|
50
|
+
if (yield predicate(e))
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
return false;
|
|
54
|
+
});
|
|
55
|
+
for (const check of checks) {
|
|
56
|
+
const checkId = check['id'];
|
|
57
|
+
const conditionalCheck = check['when'];
|
|
58
|
+
const attribute = check['attribute'];
|
|
59
|
+
let expectedValue = check['value'];
|
|
60
|
+
if (typeof expectedValue === 'string' && expectedValue.includes(' ')) {
|
|
61
|
+
const refElementSelector = expectedValue.split(' ')[0];
|
|
62
|
+
if ((yield driver.findElements(selenium_webdriver_1.By.css(refElementSelector))).length > 0) {
|
|
63
|
+
expectedValue = yield (yield driver.findElement(selenium_webdriver_1.By.css(refElementSelector))).getAttribute(expectedValue.split(' ')[1]);
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
result.skipped.push(`[${checkId}]: Skip check for ${sel}, as no ${refElementSelector} was found.`);
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if (conditionalCheck !== undefined) {
|
|
71
|
+
result.skipped.push(`[${checkId}]: Skip check for ${sel}, conditional checks not supported.`);
|
|
72
|
+
}
|
|
73
|
+
else if (Array.isArray(attribute)) {
|
|
74
|
+
const pass = yield asyncSome(attribute, (attr) => __awaiter(this, void 0, void 0, function* () {
|
|
75
|
+
let attributeValue;
|
|
76
|
+
if (attr.indexOf('=') > -1) {
|
|
77
|
+
expectedValue = attr.split('=')[1];
|
|
78
|
+
attr = attr.split('=')[0];
|
|
79
|
+
}
|
|
80
|
+
if (attr === 'label for') {
|
|
81
|
+
attributeValue = yield (yield driver.findElement(selenium_webdriver_1.By.css(sel))).getAttribute('id');
|
|
82
|
+
const locator = selenium_webdriver_1.By.css(`label[for='${attributeValue}']`);
|
|
83
|
+
if ((yield driver.findElements(locator)).length > 0) {
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
else if (attr === 'nodeName') {
|
|
88
|
+
attributeValue = (yield (yield driver.findElement(selenium_webdriver_1.By.css(sel))).getTagName()).toLowerCase();
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
attributeValue = yield (yield driver.findElement(selenium_webdriver_1.By.css(sel))).getAttribute(attr);
|
|
92
|
+
}
|
|
93
|
+
if (expectedValue) {
|
|
94
|
+
return attributeValue === expectedValue;
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
return attributeValue !== null;
|
|
98
|
+
}
|
|
99
|
+
}));
|
|
100
|
+
if (pass) {
|
|
101
|
+
result.passed.push(`[${checkId}]: ${sel} has ${attribute} attribute.`);
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
result.errors.push(`[${checkId}]: ${sel} has no "${attribute}"`);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
const attributeValue = yield (yield driver.findElement(selenium_webdriver_1.By.css(sel))).getAttribute(attribute);
|
|
109
|
+
const elType = (yield (yield driver.findElement(selenium_webdriver_1.By.css(sel))).getTagName()).toLowerCase();
|
|
110
|
+
if (attribute === 'tabindex' && expectedValue === '0') {
|
|
111
|
+
if ((elType === 'input' || elType === 'button' || elType === 'a') &&
|
|
112
|
+
(attributeValue === "0" || attributeValue === null)) {
|
|
113
|
+
result.passed.push(`[${checkId}]: ${sel} has ${attribute} attribute with ${expectedValue} value.`);
|
|
114
|
+
}
|
|
115
|
+
else if (attributeValue === expectedValue) {
|
|
116
|
+
result.passed.push(`[${checkId}]: ${sel} has ${attribute} attribute with ${expectedValue} value.`);
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
result.errors.push(`[${checkId}]: ${sel} does not have "${attribute}" attribute with "${expectedValue}" value.`);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
else if (Array.isArray(expectedValue)) {
|
|
123
|
+
if (expectedValue.includes(attributeValue)) {
|
|
124
|
+
result.passed.push(`[${checkId}]: ${sel} has ${attribute} attribute with ${expectedValue} value.`);
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
result.errors.push(`[${checkId}]: ${sel} has "${attribute}" which does not contain any of "${expectedValue}".`);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
if (expectedValue === undefined && !attributeValue) {
|
|
132
|
+
result.errors.push(`[${checkId}]: ${sel} does not have "${attribute}" attribute with value.`);
|
|
133
|
+
}
|
|
134
|
+
else if (attributeValue !== expectedValue && expectedValue !== undefined) {
|
|
135
|
+
result.errors.push(`[${checkId}]: ${sel} does not have "${attribute}" attribute with "${expectedValue}" value.`);
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
result.passed.push(`[${checkId}]: ${sel} has ${attribute} attribute with ${expectedValue} value.`);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}));
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
for (const error of excludeErrors) {
|
|
149
|
+
result.errors = result.errors.filter(item => !item.includes(error));
|
|
150
|
+
}
|
|
151
|
+
return result;
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
exports.getWCTSpecViolations = getWCTSpecViolations;
|
|
155
|
+
//# sourceMappingURL=a11y-wct-spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":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,OAAO,MAAM,GAAG,QAAQ,SAAS,mBAAmB,aAAa,SAAS,CAAC,CAAC;yCACtG;qCACJ;iCACJ;6BACJ;yBACJ;oBACL,CAAC,CAAA,CAAC,CAAC;iBACN;aACJ;SACJ;QAED,KAAK,MAAM,KAAK,IAAI,aAAa,EAAE;YAC/B,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;SACvE;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;CAAA;AAhID,oDAgIC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getWCTSpecViolations } from './a11y-wct-spec';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getWCTSpecViolations = void 0;
|
|
4
|
+
var a11y_wct_spec_1 = require("./a11y-wct-spec");
|
|
5
|
+
Object.defineProperty(exports, "getWCTSpecViolations", { enumerable: true, get: function () { return a11y_wct_spec_1.getWCTSpecViolations; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/a11y/index.ts"],"names":[],"mappings":";;;AAAA,iDAAuD;AAA9C,qHAAA,oBAAoB,OAAA"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -16,6 +16,7 @@ Object.defineProperty(exports, "By", { enumerable: true, get: function () { retu
|
|
|
16
16
|
Object.defineProperty(exports, "Key", { enumerable: true, get: function () { return selenium_webdriver_1.Key; } });
|
|
17
17
|
Object.defineProperty(exports, "until", { enumerable: true, get: function () { return selenium_webdriver_1.until; } });
|
|
18
18
|
Object.defineProperty(exports, "WebElement", { enumerable: true, get: function () { return selenium_webdriver_1.WebElement; } });
|
|
19
|
+
__exportStar(require("./a11y"), exports);
|
|
19
20
|
__exportStar(require("./components"), exports);
|
|
20
21
|
__exportStar(require("./selenium"), exports);
|
|
21
22
|
__exportStar(require("./settings"), exports);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,yDAAiE;AAAxD,wGAAA,EAAE,OAAA;AAAE,yGAAA,GAAG,OAAA;AAAE,2GAAA,KAAK,OAAA;AAAE,gHAAA,UAAU,OAAA;AACnC,+CAA6B;AAC7B,6CAA2B;AAC3B,6CAA2B;AAC3B,oDAAkC;AAClC,kEAAgD"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,yDAAiE;AAAxD,wGAAA,EAAE,OAAA;AAAE,yGAAA,GAAG,OAAA;AAAE,2GAAA,KAAK,OAAA;AAAE,gHAAA,UAAU,OAAA;AACnC,yCAAuB;AACvB,+CAA6B;AAC7B,6CAA2B;AAC3B,6CAA2B;AAC3B,oDAAkC;AAClC,kEAAgD"}
|
|
@@ -13,7 +13,7 @@ export declare class Browser extends WebApp {
|
|
|
13
13
|
navigateTo(url: string): Promise<void>;
|
|
14
14
|
refresh(): Promise<void>;
|
|
15
15
|
getCurrentUrl(): Promise<string>;
|
|
16
|
-
getAccessibilityViolations(cssSelector?: string, disableRules?: string[]): Promise<[]>;
|
|
17
16
|
getBrowserName(): Promise<string>;
|
|
17
|
+
getAccessibilityViolations(cssSelector?: string, disableRules?: string[]): Promise<[]>;
|
|
18
18
|
getErrorLogs(excludeList?: string[]): Promise<string[]>;
|
|
19
19
|
}
|
package/dist/selenium/browser.js
CHANGED
|
@@ -53,6 +53,13 @@ class Browser extends web_app_1.WebApp {
|
|
|
53
53
|
return yield this.driver.getCurrentUrl();
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
|
+
getBrowserName() {
|
|
57
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
const capabilities = (yield (yield this.driver).getCapabilities());
|
|
59
|
+
const browserName = capabilities.getBrowserName().toLowerCase();
|
|
60
|
+
return browserName;
|
|
61
|
+
});
|
|
62
|
+
}
|
|
56
63
|
getAccessibilityViolations(cssSelector = "html", disableRules = ["color-contrast"]) {
|
|
57
64
|
return __awaiter(this, void 0, void 0, function* () {
|
|
58
65
|
yield this.find(selenium_webdriver_1.By.css(cssSelector));
|
|
@@ -63,13 +70,6 @@ class Browser extends web_app_1.WebApp {
|
|
|
63
70
|
return result.violations;
|
|
64
71
|
});
|
|
65
72
|
}
|
|
66
|
-
getBrowserName() {
|
|
67
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
68
|
-
const capabilities = (yield (yield this.driver).getCapabilities());
|
|
69
|
-
const browserName = capabilities.getBrowserName().toLowerCase();
|
|
70
|
-
return browserName;
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
73
|
getErrorLogs(excludeList = ["favicon.ico"]) {
|
|
74
74
|
return __awaiter(this, void 0, void 0, function* () {
|
|
75
75
|
const errors = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../../src/selenium/browser.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,wEAA+C;AAC/C,2DAA2D;AAC3D,4DAA6D;AAC7D,qDAAiD;AACjD,uCAAmC;AAEnC,yDAAmG;AAA1F,wGAAA,EAAE,OAAA;AAAqB,2GAAA,KAAK,OAAA;AAAE,gHAAA,UAAU,OAAA;AAAE,yHAAA,mBAAmB,OAAA;AAEtE;;;;;GAKG;AACH,MAAa,OAAQ,SAAQ,gBAAM;IAC/B,YAAY,SAA4B,IAAI,8BAAa,EAAE,CAAC,SAAS,EAAE;QACnE,KAAK,CAAC,MAAM,CAAC,CAAC;IAClB,CAAC;IAEY,KAAK;;YACd,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,EA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
|
"description": "Kendo UI end-to-end test utilities.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"scripts": {
|
|
11
11
|
"lint": "npx eslint src/**/*.ts tests/**/*.ts",
|
|
12
12
|
"build": "npm run lint && npx tsc",
|
|
13
|
+
"test:a11y": "npx jest tests/a11y",
|
|
13
14
|
"test:e2e": "npx jest tests/e2e",
|
|
14
15
|
"test:visual": "npx jest tests/visual",
|
|
15
16
|
"semantic-release": "semantic-release pre && semantic-prerelease publish --public && semantic-release post"
|
|
@@ -52,33 +53,31 @@
|
|
|
52
53
|
},
|
|
53
54
|
"homepage": "https://github.com/telerik/kendo-e2e#readme",
|
|
54
55
|
"dependencies": {
|
|
55
|
-
"@axe-core/webdriverjs": "4.3
|
|
56
|
-
"@types/selenium-webdriver": "4.1.
|
|
56
|
+
"@axe-core/webdriverjs": "4.4.3",
|
|
57
|
+
"@types/selenium-webdriver": "4.1.2",
|
|
57
58
|
"js-beautify": "^1.13.13",
|
|
58
59
|
"jsdom": "^16.6.0",
|
|
59
60
|
"looks-same": "^7.3.0",
|
|
60
61
|
"pngjs": "^6.0.0",
|
|
61
|
-
"selenium-webdriver": "4.3.
|
|
62
|
+
"selenium-webdriver": "4.3.1"
|
|
62
63
|
},
|
|
63
64
|
"devDependencies": {
|
|
64
|
-
"@commitlint/cli": "^
|
|
65
|
-
"@commitlint/config-conventional": "^
|
|
66
|
-
"@
|
|
67
|
-
"@
|
|
68
|
-
"@
|
|
65
|
+
"@commitlint/cli": "^17.0.3",
|
|
66
|
+
"@commitlint/config-conventional": "^17.0.3",
|
|
67
|
+
"@progress/kendo-common-tasks": "^8.0.2",
|
|
68
|
+
"@telerik/semantic-prerelease": "^2.0.1",
|
|
69
|
+
"@types/jest": "^28.1.6",
|
|
69
70
|
"@types/node": "ts4.3",
|
|
70
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
71
|
-
"@typescript-eslint/parser": "^
|
|
72
|
-
"eslint": "^
|
|
73
|
-
"geckodriver": "3.0.
|
|
74
|
-
"husky": "^
|
|
75
|
-
"jest": "^
|
|
76
|
-
"jest-
|
|
77
|
-
"jest-junit": "12.0.0",
|
|
78
|
-
"jest-preset-typescript": "^1.2.0",
|
|
71
|
+
"@typescript-eslint/eslint-plugin": "^5.31.0",
|
|
72
|
+
"@typescript-eslint/parser": "^5.31.0",
|
|
73
|
+
"eslint": "^8.20.0",
|
|
74
|
+
"geckodriver": "3.0.2",
|
|
75
|
+
"husky": "^8.0.1",
|
|
76
|
+
"jest": "^28.1.3",
|
|
77
|
+
"jest-junit": "14.0.0",
|
|
79
78
|
"semantic-release": "^6.3.6",
|
|
80
|
-
"ts-jest": "^
|
|
81
|
-
"ts-node": "^10.
|
|
79
|
+
"ts-jest": "^28.0.7",
|
|
80
|
+
"ts-node": "^10.9.1",
|
|
82
81
|
"tslib": "^2.3.0",
|
|
83
82
|
"typescript": "~4.3.4"
|
|
84
83
|
}
|