@progress/kendo-e2e 0.13.0 → 1.1.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/README.md +21 -5
- package/dist/a11y/a11y-wct-spec.js +150 -83
- package/dist/a11y/a11y-wct-spec.js.map +1 -1
- package/dist/components/grid.d.ts +13 -13
- package/dist/components/grid.js +25 -25
- package/dist/selenium/web-app.js +10 -2
- package/dist/selenium/web-app.js.map +1 -1
- package/package.json +12 -8
package/README.md
CHANGED
|
@@ -132,19 +132,33 @@ To check available mobile devices and capabilities please visit [this](https://w
|
|
|
132
132
|
|
|
133
133
|
### Find Elements and Wait for Conditions
|
|
134
134
|
|
|
135
|
-
|
|
135
|
+
Selenium default behavior when you search for element is to return it if available and throw if not available (do not try to wait until element is available).
|
|
136
136
|
|
|
137
|
-
|
|
137
|
+
To make writing e2e tests easier and tests more stable in `kendo-e2e` we have:
|
|
138
138
|
|
|
139
|
-
|
|
139
|
+
```js
|
|
140
|
+
const element = await browser.find(locator, timeout);
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
This `find` with wait until element is available (until timeout reached), if timeout reached and element still not found it will throw.
|
|
140
144
|
|
|
141
145
|
### Detect JavaScript errors in Browser Logs
|
|
142
146
|
|
|
143
|
-
|
|
147
|
+
```js
|
|
148
|
+
await browser.getErrorLogs()
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Will return all errors in browser console and it is nice check we can perform after each test to ensure we have no missing resources or scripts throwing errors.
|
|
144
152
|
|
|
145
153
|
### Detect Accessibility Violations
|
|
146
154
|
|
|
147
|
-
|
|
155
|
+
```js
|
|
156
|
+
const disableRules = ['aria-allowed-role', 'label'];
|
|
157
|
+
const errors = await browser.getAccessibilityViolations('#table', disableRules);
|
|
158
|
+
expect(errors).toEqual([]);
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
`getAccessibilityViolations` uses [axe](https://www.deque.com/axe/) to detect WCAG 2.1 violations.
|
|
148
162
|
|
|
149
163
|
### Kendo UI Components Abstractions
|
|
150
164
|
|
|
@@ -169,5 +183,7 @@ npm run build
|
|
|
169
183
|
Run tests:
|
|
170
184
|
|
|
171
185
|
```bash
|
|
186
|
+
npm run tests:a11y
|
|
172
187
|
npm run tests:e2e
|
|
188
|
+
npm run tests:visual
|
|
173
189
|
```
|
|
@@ -10,6 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.getWCTSpecViolations = void 0;
|
|
13
|
+
/* eslint-disable @typescript-eslint/ban-types */
|
|
13
14
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
14
15
|
const selenium_webdriver_1 = require("selenium-webdriver");
|
|
15
16
|
/**
|
|
@@ -28,120 +29,144 @@ function getWCTSpecViolations(driver, spec, excludeErrors = []) {
|
|
|
28
29
|
const skipped = [];
|
|
29
30
|
const errors = [];
|
|
30
31
|
const result = { passed, skipped, errors };
|
|
32
|
+
const RULES = 'rules';
|
|
33
|
+
const SELECTOR = 'selector';
|
|
34
|
+
const CHECKS = 'checks';
|
|
35
|
+
const ID = 'id';
|
|
36
|
+
const WHEN = 'when';
|
|
37
|
+
const ATTRIBUTE = 'attribute';
|
|
38
|
+
const VALUE = 'value';
|
|
39
|
+
const STRING = 'string';
|
|
40
|
+
const TABINDEX = 'tabindex';
|
|
41
|
+
const INPUT = 'INPUT';
|
|
42
|
+
const BUTTON = 'BUTTON';
|
|
43
|
+
const ANCHOR = 'A';
|
|
44
|
+
const ZERO = '0';
|
|
45
|
+
const COMMA = ',';
|
|
46
|
+
const EMPTY = ' ';
|
|
47
|
+
const ANIMATION_CONTAINER = '.k-animation-container';
|
|
48
|
+
const LIST = '.k-list-ul';
|
|
49
|
+
const LIST_ITEM = '.k-list-item';
|
|
50
|
+
const LIST_FILTER = '.k-list-filter';
|
|
51
|
+
const DISABLED = '.k-disabled';
|
|
52
|
+
const ELMENTS_MAP = {
|
|
53
|
+
buttongroup: '.k-button-group',
|
|
54
|
+
floatingactionbutton: '.k-fab',
|
|
55
|
+
pager: '.k-pager-wrap'
|
|
56
|
+
};
|
|
31
57
|
for (const key of Object.keys(spec)) {
|
|
32
58
|
const component = spec[key];
|
|
33
|
-
const rules = component[
|
|
34
|
-
const keySelector = `.k-${key}`;
|
|
59
|
+
const rules = component[RULES];
|
|
60
|
+
const keySelector = ELMENTS_MAP[key] || `.k-${key}`;
|
|
35
61
|
if ((yield driver.findElements(selenium_webdriver_1.By.css(keySelector))).length > 0) {
|
|
36
62
|
for (const rule of rules) {
|
|
37
|
-
const selector = rule[
|
|
38
|
-
let arraySelector = selector.split(
|
|
39
|
-
if (selector
|
|
40
|
-
selector.indexOf(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
63
|
+
const selector = rule[SELECTOR];
|
|
64
|
+
let arraySelector = selector.split(COMMA);
|
|
65
|
+
if (selector.indexOf(DISABLED) > -1) {
|
|
66
|
+
if (selector.indexOf(keySelector) === -1) {
|
|
67
|
+
arraySelector = arraySelector.map((s) => keySelector + s);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
else if (selector !== keySelector &&
|
|
71
|
+
selector.indexOf(ANIMATION_CONTAINER) === -1 &&
|
|
72
|
+
selector.indexOf(LIST) === -1 &&
|
|
73
|
+
selector.indexOf(LIST_ITEM) === -1 &&
|
|
74
|
+
selector.indexOf(LIST_FILTER) === -1) {
|
|
75
|
+
arraySelector = arraySelector.map((s) => keySelector + EMPTY + s);
|
|
45
76
|
}
|
|
46
|
-
|
|
77
|
+
for (const sel of arraySelector) {
|
|
47
78
|
if ((yield driver.findElements(selenium_webdriver_1.By.css(sel))).length > 0) {
|
|
48
|
-
const checks = rule[
|
|
49
|
-
for (const e of arr) {
|
|
50
|
-
if (yield predicate(e))
|
|
51
|
-
return true;
|
|
52
|
-
}
|
|
53
|
-
return false;
|
|
54
|
-
});
|
|
79
|
+
const checks = rule[CHECKS];
|
|
55
80
|
for (const check of checks) {
|
|
56
|
-
const checkId = check[
|
|
57
|
-
const conditionalCheck = check[
|
|
58
|
-
const attribute = check[
|
|
59
|
-
let expectedValue = check[
|
|
60
|
-
if (typeof expectedValue ===
|
|
61
|
-
const refElementSelector = expectedValue.split(
|
|
81
|
+
const checkId = check[ID];
|
|
82
|
+
const conditionalCheck = check[WHEN];
|
|
83
|
+
const attribute = check[ATTRIBUTE];
|
|
84
|
+
let expectedValue = check[VALUE];
|
|
85
|
+
if (typeof expectedValue === STRING && expectedValue.includes(EMPTY)) {
|
|
86
|
+
const refElementSelector = expectedValue.split(EMPTY)[0];
|
|
87
|
+
const refElementAttribute = expectedValue.split(EMPTY)[1];
|
|
62
88
|
if ((yield driver.findElements(selenium_webdriver_1.By.css(refElementSelector))).length > 0) {
|
|
63
|
-
expectedValue = yield (yield driver.
|
|
89
|
+
expectedValue = yield Promise.all((yield driver.findElements(selenium_webdriver_1.By.css(refElementSelector))).map((el) => __awaiter(this, void 0, void 0, function* () {
|
|
90
|
+
return yield el.getAttribute(refElementAttribute);
|
|
91
|
+
})));
|
|
64
92
|
}
|
|
65
93
|
else {
|
|
66
|
-
|
|
94
|
+
skipped.push(`[${checkId}]: Skip check for ${sel}, as no ${refElementSelector} was found.`);
|
|
67
95
|
continue;
|
|
68
96
|
}
|
|
69
97
|
}
|
|
70
98
|
if (conditionalCheck !== undefined) {
|
|
71
|
-
|
|
99
|
+
skipped.push(`[${checkId}]: Skip check for ${sel}, conditional checks not supported.`);
|
|
100
|
+
}
|
|
101
|
+
else if (excludeErrors.includes(checkId)) {
|
|
102
|
+
skipped.push(`[${checkId}]: Skip check for ${sel}, explicitly excluded.`);
|
|
72
103
|
}
|
|
73
104
|
else if (Array.isArray(attribute)) {
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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();
|
|
105
|
+
const elements = yield driver.findElements(selenium_webdriver_1.By.css(sel));
|
|
106
|
+
for (const el of elements) {
|
|
107
|
+
const pass = yield asyncSome(attribute, (attr) => __awaiter(this, void 0, void 0, function* () {
|
|
108
|
+
return yield iterateAttributeArray(driver, attr, expectedValue, el);
|
|
109
|
+
}));
|
|
110
|
+
if (pass) {
|
|
111
|
+
passed.push(`${sel} has ${attribute} attribute.`);
|
|
89
112
|
}
|
|
90
113
|
else {
|
|
91
|
-
|
|
114
|
+
errors.push(`[${checkId}]: ${sel} has no "${attribute}"`);
|
|
92
115
|
}
|
|
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
116
|
}
|
|
106
117
|
}
|
|
107
118
|
else {
|
|
108
|
-
const
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
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}".`);
|
|
119
|
+
const elements = yield driver.findElements(selenium_webdriver_1.By.css(sel));
|
|
120
|
+
for (const el of elements) {
|
|
121
|
+
const attributeValue = yield el.getAttribute(attribute);
|
|
122
|
+
const elType = yield el.getTagName();
|
|
123
|
+
if (attribute === TABINDEX && expectedValue === ZERO) {
|
|
124
|
+
if ((elType === INPUT || elType === BUTTON || elType === ANCHOR) &&
|
|
125
|
+
(attributeValue === ZERO || attributeValue === null)) {
|
|
126
|
+
passed.push(`${sel} has ${attribute} attribute with ${expectedValue} value.`);
|
|
127
|
+
}
|
|
128
|
+
else if (attributeValue === expectedValue) {
|
|
129
|
+
passed.push(`${sel} has ${attribute} attribute with ${expectedValue} value.`);
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
errors.push(`[${checkId}]: ${sel} does not have "${attribute}" attribute with "${expectedValue}" value.`);
|
|
133
|
+
}
|
|
128
134
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
135
|
+
else if (attribute === TABINDEX && expectedValue === '-1') {
|
|
136
|
+
if (elType !== INPUT && elType !== BUTTON && elType !== ANCHOR && attributeValue === null) {
|
|
137
|
+
passed.push(`${sel} has ${attribute} attribute with ${expectedValue} value.`);
|
|
138
|
+
}
|
|
139
|
+
else if (attributeValue === expectedValue) {
|
|
140
|
+
passed.push(`${sel} has ${attribute} attribute with ${expectedValue} value.`);
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
errors.push(`[${checkId}]: ${sel} does not have "${attribute}" attribute with "${expectedValue}" value.`);
|
|
144
|
+
}
|
|
133
145
|
}
|
|
134
|
-
else if (
|
|
135
|
-
|
|
146
|
+
else if (Array.isArray(expectedValue)) {
|
|
147
|
+
if (expectedValue.includes(attributeValue)) {
|
|
148
|
+
passed.push(`${sel} has ${attribute} attribute with ${expectedValue} value.`);
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
errors.push(`[${checkId}]: ${sel} has "${attribute}" which does not contain any of "${expectedValue}".`);
|
|
152
|
+
}
|
|
136
153
|
}
|
|
137
154
|
else {
|
|
138
|
-
|
|
155
|
+
if (expectedValue === undefined && !attributeValue) {
|
|
156
|
+
errors.push(`[${checkId}]: ${sel} does not have "${attribute}" attribute with value.`);
|
|
157
|
+
}
|
|
158
|
+
else if (attributeValue !== expectedValue && expectedValue !== undefined) {
|
|
159
|
+
errors.push(`[${checkId}]: ${sel} does not have "${attribute}" attribute with "${expectedValue}" value.`);
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
passed.push(`${sel} has ${attribute} attribute with ${expectedValue} value.`);
|
|
163
|
+
}
|
|
139
164
|
}
|
|
140
165
|
}
|
|
141
166
|
}
|
|
142
167
|
}
|
|
143
168
|
}
|
|
144
|
-
}
|
|
169
|
+
}
|
|
145
170
|
}
|
|
146
171
|
}
|
|
147
172
|
}
|
|
@@ -152,4 +177,46 @@ function getWCTSpecViolations(driver, spec, excludeErrors = []) {
|
|
|
152
177
|
});
|
|
153
178
|
}
|
|
154
179
|
exports.getWCTSpecViolations = getWCTSpecViolations;
|
|
180
|
+
function asyncSome(arr, predicate) {
|
|
181
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
182
|
+
for (const e of arr) {
|
|
183
|
+
if (yield predicate(e)) {
|
|
184
|
+
return true;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
return false;
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
function iterateAttributeArray(driver, attr, expectedValue, el) {
|
|
191
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
192
|
+
const ID = 'id';
|
|
193
|
+
const LABEL_FOR = 'label for';
|
|
194
|
+
const EQUALS = '=';
|
|
195
|
+
let attributeValue;
|
|
196
|
+
if (attr.indexOf(EQUALS) > -1) {
|
|
197
|
+
expectedValue = attr.split(EQUALS)[1];
|
|
198
|
+
attr = attr.split(EQUALS)[0];
|
|
199
|
+
}
|
|
200
|
+
if (attr === LABEL_FOR) {
|
|
201
|
+
attributeValue = yield el.getAttribute(ID);
|
|
202
|
+
if (attributeValue) {
|
|
203
|
+
if ((yield driver.findElements(selenium_webdriver_1.By.css('label[for=' + attributeValue + ']'))).length > 0) {
|
|
204
|
+
return true;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
else if (attr === 'nodeName') {
|
|
209
|
+
attributeValue = (yield el.getTagName()).toLowerCase();
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
attributeValue = yield el.getAttribute(attr);
|
|
213
|
+
}
|
|
214
|
+
if (expectedValue) {
|
|
215
|
+
return attributeValue === expectedValue;
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
return attributeValue !== null;
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
}
|
|
155
222
|
//# sourceMappingURL=a11y-wct-spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"a11y-wct-spec.js","sourceRoot":"","sources":["../../src/a11y/a11y-wct-spec.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uDAAuD;AACvD,
|
|
1
|
+
{"version":3,"file":"a11y-wct-spec.js","sourceRoot":"","sources":["../../src/a11y/a11y-wct-spec.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iDAAiD;AACjD,uDAAuD;AACvD,2DAAuE;AAQvE;;;;;;;;;GASG;AACH,SAAsB,oBAAoB,CAAC,MAAyB,EAAE,IAAS,EAAE,gBAA0B,EAAE;;QACzG,MAAM,MAAM,GAAa,EAAE,CAAC;QAC5B,MAAM,OAAO,GAAa,EAAE,CAAC;QAC7B,MAAM,MAAM,GAAa,EAAE,CAAC;QAC5B,MAAM,MAAM,GAAkB,EAAE,MAAM,EAAE,OAAO,EAAE,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AI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;SAChC;QAED,IAAI,IAAI,KAAK,SAAS,EAAE;YACpB,cAAc,GAAG,MAAM,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;YAC3C,IAAI,cAAc,EAAE;gBAChB,IAAI,CAAC,MAAM,MAAM,CAAC,YAAY,CAAC,uBAAE,CAAC,GAAG,CAAC,YAAY,GAAG,cAAc,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;oBACrF,OAAO,IAAI,CAAC;iBACf;aACJ;SACJ;aAAM,IAAI,IAAI,KAAK,UAAU,EAAE;YAC5B,cAAc,GAAG,CAAC,MAAM,EAAE,CAAC,UAAU,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;SAC1D;aAAM;YACH,cAAc,GAAG,MAAM,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;SAChD;QAED,IAAI,aAAa,EAAE;YACf,OAAO,cAAc,KAAK,aAAa,CAAC;SAC3C;aAAM;YACH,OAAO,cAAc,KAAK,IAAI,CAAC;SAClC;IACL,CAAC;CAAA"}
|
|
@@ -6,21 +6,21 @@ export declare class Grid extends UIComponent {
|
|
|
6
6
|
protected parentElement?: WebElement;
|
|
7
7
|
static get Selector(): string;
|
|
8
8
|
constructor(driver: ThenableWebDriver, locator?: By, parentElement?: WebElement);
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
pager(): Promise<Pager>;
|
|
10
|
+
dataRows(): Promise<WebElement[]>;
|
|
11
|
+
dataRowsCount(): Promise<number>;
|
|
12
|
+
isEmpty(): Promise<boolean>;
|
|
13
|
+
header(column: number): Promise<WebElement>;
|
|
14
|
+
headerFilter(column: number): Promise<WebElement>;
|
|
15
|
+
headerByText(text: string, exactMatch?: boolean): Promise<WebElement>;
|
|
16
|
+
headerSortType(text: string, exactMatch?: boolean): Promise<SortType>;
|
|
17
|
+
getSortOrder(text: string, exactMatch?: boolean): Promise<number>;
|
|
18
|
+
headerCell(column: number): Promise<WebElement>;
|
|
19
19
|
HeaderCellInput(column: number): Promise<WebElement>;
|
|
20
20
|
HeaderCellFilterDropDown(column: number): Promise<WebElement>;
|
|
21
21
|
HeaderCellCleanFilterButton(column: number): Promise<WebElement>;
|
|
22
22
|
Cell(row: number, column: number): Promise<WebElement>;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
private
|
|
23
|
+
cellInput(row: number, column: number): Promise<WebElement>;
|
|
24
|
+
cellsByColumn(column: number, limit?: number): Promise<WebElement[]>;
|
|
25
|
+
private getGridElement;
|
|
26
26
|
}
|
package/dist/components/grid.js
CHANGED
|
@@ -24,44 +24,44 @@ class Grid extends ui_component_1.UIComponent {
|
|
|
24
24
|
static get Selector() {
|
|
25
25
|
return ".k-grid";
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
pager() {
|
|
28
28
|
return __awaiter(this, void 0, void 0, function* () {
|
|
29
29
|
const rootElement = yield this.getRootElement();
|
|
30
30
|
return new pager_1.Pager(this.driver, selenium_webdriver_1.By.css(".k-grid-pager"), rootElement);
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
|
-
|
|
33
|
+
dataRows() {
|
|
34
34
|
return __awaiter(this, void 0, void 0, function* () {
|
|
35
35
|
const rootElement = yield this.getRootElement();
|
|
36
36
|
return yield rootElement.findElements(selenium_webdriver_1.By.css("tbody tr"));
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
dataRowsCount() {
|
|
40
40
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
-
return (yield this.
|
|
41
|
+
return (yield this.dataRows()).length;
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
|
-
|
|
44
|
+
isEmpty() {
|
|
45
45
|
return __awaiter(this, void 0, void 0, function* () {
|
|
46
46
|
const rootElement = yield this.getRootElement();
|
|
47
47
|
return (yield rootElement.findElements(selenium_webdriver_1.By.css(".k-grid-norecords"))).length === 1;
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
|
-
|
|
50
|
+
header(column) {
|
|
51
51
|
return __awaiter(this, void 0, void 0, function* () {
|
|
52
52
|
const locator = selenium_webdriver_1.By.css(`thead tr th:nth-of-type(${column})`);
|
|
53
|
-
return yield this.
|
|
53
|
+
return yield this.getGridElement(locator, `Failed to find header at column ${column}.`);
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
|
-
|
|
56
|
+
headerFilter(column) {
|
|
57
57
|
return __awaiter(this, void 0, void 0, function* () {
|
|
58
58
|
const defaultLocator = `thead tr th:nth-of-type(${column}) .k-grid-filter`;
|
|
59
59
|
const reactLocator = `thead tr th:nth-of-type(${column}) span.k-i-more-vertical`;
|
|
60
60
|
const errorMessage = `Failed to find filter menu inside header at column ${column}.`;
|
|
61
|
-
return yield this.
|
|
61
|
+
return yield this.getGridElement(selenium_webdriver_1.By.css(`${defaultLocator}, ${reactLocator}`), errorMessage);
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
|
-
|
|
64
|
+
headerByText(text, exactMatch = true) {
|
|
65
65
|
return __awaiter(this, void 0, void 0, function* () {
|
|
66
66
|
// Angular and Blazor: Header text is in span with class "k-column-title"
|
|
67
67
|
// jQuery, React and Vue: Header text is in span with class "k-link"
|
|
@@ -72,12 +72,12 @@ class Grid extends ui_component_1.UIComponent {
|
|
|
72
72
|
else {
|
|
73
73
|
locator = selenium_webdriver_1.By.xpath(`//thead//tr//th[.//*[(@class='k-column-title' or @class='k-link') and contains(.,'${text}')]]`);
|
|
74
74
|
}
|
|
75
|
-
return yield this.
|
|
75
|
+
return yield this.getGridElement(locator, `Failed to find header with "${text}" text.`);
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
|
-
|
|
78
|
+
headerSortType(text, exactMatch = true) {
|
|
79
79
|
return __awaiter(this, void 0, void 0, function* () {
|
|
80
|
-
const rootElement = yield this.
|
|
80
|
+
const rootElement = yield this.headerByText(text, exactMatch);
|
|
81
81
|
if ((yield rootElement.findElements(selenium_webdriver_1.By.css(".k-i-sort-asc-sm"))).length > 0) {
|
|
82
82
|
return enums_1.SortType.Asc;
|
|
83
83
|
}
|
|
@@ -89,10 +89,10 @@ class Grid extends ui_component_1.UIComponent {
|
|
|
89
89
|
}
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
|
-
|
|
92
|
+
getSortOrder(text, exactMatch = true) {
|
|
93
93
|
return __awaiter(this, void 0, void 0, function* () {
|
|
94
94
|
const locator = selenium_webdriver_1.By.css(".k-sort-order");
|
|
95
|
-
const rootElement = yield this.
|
|
95
|
+
const rootElement = yield this.headerByText(text, exactMatch);
|
|
96
96
|
if ((yield rootElement.findElements(locator)).length > 0) {
|
|
97
97
|
const element = yield rootElement.findElement(locator);
|
|
98
98
|
return +(yield element.getText());
|
|
@@ -102,12 +102,12 @@ class Grid extends ui_component_1.UIComponent {
|
|
|
102
102
|
}
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
|
-
|
|
105
|
+
headerCell(column) {
|
|
106
106
|
return __awaiter(this, void 0, void 0, function* () {
|
|
107
107
|
const defaultLocator = `thead tr td:nth-of-type(${column})`;
|
|
108
108
|
const reactLocator = `thead tr.k-filter-row th:nth-of-type(${column})`;
|
|
109
109
|
const errorMessage = `Failed to find header cell at column ${column}.`;
|
|
110
|
-
return yield this.
|
|
110
|
+
return yield this.getGridElement(selenium_webdriver_1.By.css(`${defaultLocator}, ${reactLocator}`), errorMessage);
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
113
|
HeaderCellInput(column) {
|
|
@@ -115,7 +115,7 @@ class Grid extends ui_component_1.UIComponent {
|
|
|
115
115
|
const defaultLocator = `thead tr td:nth-of-type(${column}) input`;
|
|
116
116
|
const reactLocator = `thead tr.k-filter-row th:nth-of-type(${column}) input`;
|
|
117
117
|
const errorMessage = `Failed to find input inside header cell at column ${column}.`;
|
|
118
|
-
return yield this.
|
|
118
|
+
return yield this.getGridElement(selenium_webdriver_1.By.css(`${defaultLocator}, ${reactLocator}`), errorMessage);
|
|
119
119
|
});
|
|
120
120
|
}
|
|
121
121
|
HeaderCellFilterDropDown(column) {
|
|
@@ -123,7 +123,7 @@ class Grid extends ui_component_1.UIComponent {
|
|
|
123
123
|
const defaultLocator = `thead tr td:nth-of-type(${column}) .k-dropdown`;
|
|
124
124
|
const reactLocator = `thead tr.k-filter-row th:nth-of-type(${column}) .k-dropdown`;
|
|
125
125
|
const errorMessage = `Failed to find filter dropdown inside header cell at column ${column}.`;
|
|
126
|
-
return yield this.
|
|
126
|
+
return yield this.getGridElement(selenium_webdriver_1.By.css(`${defaultLocator}, ${reactLocator}`), errorMessage);
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
129
|
HeaderCellCleanFilterButton(column) {
|
|
@@ -131,7 +131,7 @@ class Grid extends ui_component_1.UIComponent {
|
|
|
131
131
|
const defaultLocator = `thead tr td:nth-of-type(${column}) button[title='Clear']`;
|
|
132
132
|
const reactLocator = `thead tr.k-filter-row th:nth-of-type(${column}) button[title='Clear']`;
|
|
133
133
|
const errorMessage = `Failed to find clear filter button inside header cell at column ${column}.`;
|
|
134
|
-
return yield this.
|
|
134
|
+
return yield this.getGridElement(selenium_webdriver_1.By.css(`${defaultLocator}, ${reactLocator}`), errorMessage);
|
|
135
135
|
});
|
|
136
136
|
}
|
|
137
137
|
Cell(row, column) {
|
|
@@ -139,18 +139,18 @@ class Grid extends ui_component_1.UIComponent {
|
|
|
139
139
|
const defaultLocator = `tr:nth-of-type(${row}) td[role='gridcell']:nth-of-type(${column})`;
|
|
140
140
|
const vueLocator = `tr.k-master-row:nth-of-type(${row}) td:nth-of-type(${column})`;
|
|
141
141
|
const errorMessage = `Failed to find cell at {${row}, ${column}}.`;
|
|
142
|
-
return yield this.
|
|
142
|
+
return yield this.getGridElement(selenium_webdriver_1.By.css(`${defaultLocator}, ${vueLocator}`), errorMessage);
|
|
143
143
|
});
|
|
144
144
|
}
|
|
145
|
-
|
|
145
|
+
cellInput(row, column) {
|
|
146
146
|
return __awaiter(this, void 0, void 0, function* () {
|
|
147
147
|
const defaultLocator = `tr:nth-of-type(${row}) td[role='gridcell']:nth-of-type(${column}) input`;
|
|
148
148
|
const vueLocator = `tr.k-master-row:nth-of-type(${row}) td:nth-of-type(${column}) input`;
|
|
149
149
|
const errorMessage = `Failed to find input at cell {${row}, ${column}}.`;
|
|
150
|
-
return yield this.
|
|
150
|
+
return yield this.getGridElement(selenium_webdriver_1.By.css(`${defaultLocator}, ${vueLocator}`), errorMessage);
|
|
151
151
|
});
|
|
152
152
|
}
|
|
153
|
-
|
|
153
|
+
cellsByColumn(column, limit) {
|
|
154
154
|
return __awaiter(this, void 0, void 0, function* () {
|
|
155
155
|
const rootElement = yield this.getRootElement();
|
|
156
156
|
const cells = yield rootElement.findElements(selenium_webdriver_1.By.css(`tr td:nth-of-type(${column})`));
|
|
@@ -162,7 +162,7 @@ class Grid extends ui_component_1.UIComponent {
|
|
|
162
162
|
}
|
|
163
163
|
});
|
|
164
164
|
}
|
|
165
|
-
|
|
165
|
+
getGridElement(locator, error) {
|
|
166
166
|
return __awaiter(this, void 0, void 0, function* () {
|
|
167
167
|
const rootElement = yield this.getRootElement();
|
|
168
168
|
yield this.driver.wait(conditions_1.EC.hasChild(rootElement, locator), settings_1.Settings.timeout, error);
|
package/dist/selenium/web-app.js
CHANGED
|
@@ -44,8 +44,16 @@ class WebApp {
|
|
|
44
44
|
}
|
|
45
45
|
click(locator, timeout = 10000) {
|
|
46
46
|
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
try {
|
|
48
|
+
const element = yield this.find(locator, timeout);
|
|
49
|
+
yield element.click();
|
|
50
|
+
}
|
|
51
|
+
catch (_a) {
|
|
52
|
+
const element = yield this.find(locator, timeout);
|
|
53
|
+
yield this.wait(selenium_webdriver_1.until.elementIsVisible(element), timeout, `Element located by ${locator} is not visible.`);
|
|
54
|
+
yield this.wait(selenium_webdriver_1.until.elementIsEnabled(element), timeout, `Element located by ${locator} is not enabled.`);
|
|
55
|
+
yield element.click();
|
|
56
|
+
}
|
|
49
57
|
});
|
|
50
58
|
}
|
|
51
59
|
hover(locator, timeout = 10000) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-app.js","sourceRoot":"","sources":["../../src/selenium/web-app.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2DAAmG;AACnG,6CAAiD;AAEjD;;GAEG;AACH,MAAa,MAAM;IAGf,YAAY,MAAyB;QACjC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IAEY,IAAI,CAAC,OAAW,EAAE,OAAO,GAAG,KAAK;;YAC1C,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,0BAAK,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,qCAAqC,OAAO,GAAG,CAAC,CAAC;YAEhI,wBAAwB;YACxB,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC;YACzD,MAAM,WAAW,GAAG,YAAY,CAAC,cAAc,EAAE,CAAC,WAAW,EAAE,CAAC;YAChE,IAAI,WAAW,KAAK,QAAQ,EAAE;gBAC1B,MAAM,IAAI,CAAC,IAAI,CAAC,GAAS,EAAE,gDAAC,OAAA,CAAA,MAAM,OAAO,CAAC,OAAO,EAAE,MAAK,SAAS,CAAA,GAAA,CAAC,CAAC;aACtE;YAED,OAAO,OAAO,CAAC;QACnB,CAAC;KAAA;IAEY,OAAO,CAAC,OAAW;;YAC5B,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QACnD,CAAC;KAAA;IAEY,SAAS,CAAC,WAAuB,EAAE,OAAW,EAAE,OAAO,GAAG,KAAK;;YACxE,MAAM,I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,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAClD,MAAM,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,wFAAwF,EAAE,OAAO,CAAC,CAAC;QACvI,CAAC;KAAA;IAEY,cAAc,CAAC,OAAW,EAAE,OAAO,GAAG,KAAK;;YACpD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAClD,MAAM,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,wFAAwF,EAAE,OAAO,CAAC,CAAC;YACnI,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;QAC1B,CAAC;KAAA;CACJ;AAlJD,wBAkJC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-e2e",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Kendo UI end-to-end test utilities.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
"fallbackTags": {
|
|
28
28
|
"dev": "latest"
|
|
29
29
|
},
|
|
30
|
-
"analyzeCommits": "@
|
|
31
|
-
"generateNotes": "@
|
|
32
|
-
"getLastRelease": "@
|
|
33
|
-
"verifyConditions": "@
|
|
34
|
-
"verifyRelease": "@
|
|
30
|
+
"analyzeCommits": "@progress/semantic-prerelease/analyzeCommits",
|
|
31
|
+
"generateNotes": "@progress/semantic-prerelease/generateNotes",
|
|
32
|
+
"getLastRelease": "@progress/semantic-prerelease/getLastRelease",
|
|
33
|
+
"verifyConditions": "@progress/semantic-prerelease/verifyConditions",
|
|
34
|
+
"verifyRelease": "@progress/semantic-prerelease/verifyRelease"
|
|
35
35
|
},
|
|
36
36
|
"keywords": [
|
|
37
37
|
"a11y",
|
|
@@ -59,13 +59,13 @@
|
|
|
59
59
|
"jsdom": "^16.6.0",
|
|
60
60
|
"looks-same": "^7.3.0",
|
|
61
61
|
"pngjs": "^6.0.0",
|
|
62
|
-
"selenium-webdriver": "4.
|
|
62
|
+
"selenium-webdriver": "4.4.0"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@commitlint/cli": "^17.0.3",
|
|
66
66
|
"@commitlint/config-conventional": "^17.0.3",
|
|
67
67
|
"@progress/kendo-common-tasks": "^8.0.2",
|
|
68
|
-
"@
|
|
68
|
+
"@progress/semantic-prerelease": "^3.0.2",
|
|
69
69
|
"@types/jest": "^28.1.6",
|
|
70
70
|
"@types/node": "ts4.3",
|
|
71
71
|
"@typescript-eslint/eslint-plugin": "^5.31.0",
|
|
@@ -80,5 +80,9 @@
|
|
|
80
80
|
"ts-node": "^10.9.1",
|
|
81
81
|
"tslib": "^2.3.0",
|
|
82
82
|
"typescript": "~4.3.4"
|
|
83
|
+
},
|
|
84
|
+
"engines": {
|
|
85
|
+
"npm": ">=6.0.0",
|
|
86
|
+
"node": ">=14.0.0"
|
|
83
87
|
}
|
|
84
88
|
}
|