@enact/ui-test-utils 1.0.0 → 1.0.2
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/.travis.yml +2 -2
- package/CHANGELOG.md +9 -0
- package/npm-shrinkwrap.json +4279 -3598
- package/package.json +27 -26
- package/utils/Page.js +17 -12
- package/utils/runTest.js +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enact/ui-test-utils",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "UI Testing for the Enact framework",
|
|
5
|
+
"repository": "https://github.com/enactjs/ui-test-utils",
|
|
5
6
|
"main": "index.js",
|
|
6
7
|
"bin": {
|
|
7
8
|
"start-tests": "./start-tests.js"
|
|
@@ -16,38 +17,38 @@
|
|
|
16
17
|
"access": "public"
|
|
17
18
|
},
|
|
18
19
|
"dependencies": {
|
|
19
|
-
"@wdio/cli": "^7.
|
|
20
|
-
"@wdio/dot-reporter": "^7.
|
|
21
|
-
"@wdio/local-runner": "^7.
|
|
22
|
-
"@wdio/mocha-framework": "^7.
|
|
23
|
-
"@wdio/selenium-standalone-service": "^7.
|
|
24
|
-
"@wdio/spec-reporter": "^7.
|
|
25
|
-
"@wdio/static-server-service": "^7.
|
|
26
|
-
"chai": "4.3.
|
|
20
|
+
"@wdio/cli": "^7.27.0",
|
|
21
|
+
"@wdio/dot-reporter": "^7.26.0",
|
|
22
|
+
"@wdio/local-runner": "^7.27.0",
|
|
23
|
+
"@wdio/mocha-framework": "^7.26.0",
|
|
24
|
+
"@wdio/selenium-standalone-service": "^7.26.0",
|
|
25
|
+
"@wdio/spec-reporter": "^7.26.0",
|
|
26
|
+
"@wdio/static-server-service": "^7.26.0",
|
|
27
|
+
"chai": "4.3.7",
|
|
27
28
|
"chalk": "^4.1.2",
|
|
28
29
|
"cross-spawn": "^7.0.3",
|
|
29
30
|
"dirty-chai": "2.0.1",
|
|
30
|
-
"expect-webdriverio": "^3.
|
|
31
|
-
"fs-extra": "^10.
|
|
32
|
-
"minimist": "^1.2.
|
|
33
|
-
"query-string": "^7.
|
|
34
|
-
"ramda": "^0.
|
|
31
|
+
"expect-webdriverio": "^3.5.3",
|
|
32
|
+
"fs-extra": "^10.1.0",
|
|
33
|
+
"minimist": "^1.2.7",
|
|
34
|
+
"query-string": "^7.1.1",
|
|
35
|
+
"ramda": "^0.28.0",
|
|
35
36
|
"readdirp": "^3.6.0",
|
|
36
|
-
"wdio-docker-service": "^3.1
|
|
37
|
-
"wdio-image-comparison-service": "^
|
|
38
|
-
"webdriverio": "^7.
|
|
37
|
+
"wdio-docker-service": "^3.2.1",
|
|
38
|
+
"wdio-image-comparison-service": "^5.0.2",
|
|
39
|
+
"webdriverio": "^7.27.0"
|
|
39
40
|
},
|
|
40
41
|
"devDependencies": {
|
|
41
|
-
"@babel/eslint-plugin": "^7.
|
|
42
|
-
"eslint": "^8.
|
|
43
|
-
"eslint-config-enact": "^4.1.
|
|
42
|
+
"@babel/eslint-plugin": "^7.19.1",
|
|
43
|
+
"eslint": "^8.28.0",
|
|
44
|
+
"eslint-config-enact": "^4.1.2",
|
|
44
45
|
"eslint-config-prettier": "^8.5.0",
|
|
45
46
|
"eslint-plugin-enact": "^1.0.1",
|
|
46
|
-
"eslint-plugin-import": "^2.
|
|
47
|
-
"eslint-plugin-jest": "^
|
|
48
|
-
"eslint-plugin-jsx-a11y": "^6.
|
|
49
|
-
"eslint-plugin-prettier": "^4.
|
|
50
|
-
"eslint-plugin-react": "^7.
|
|
51
|
-
"eslint-plugin-react-hooks": "^4.
|
|
47
|
+
"eslint-plugin-import": "^2.26.0",
|
|
48
|
+
"eslint-plugin-jest": "^27.1.6",
|
|
49
|
+
"eslint-plugin-jsx-a11y": "^6.6.1",
|
|
50
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
51
|
+
"eslint-plugin-react": "^7.31.11",
|
|
52
|
+
"eslint-plugin-react-hooks": "^4.6.0"
|
|
52
53
|
}
|
|
53
54
|
}
|
package/utils/Page.js
CHANGED
|
@@ -13,6 +13,10 @@ class Page {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
async open (appPath, urlExtra = '?locale=en-US') {
|
|
16
|
+
await browser.execute(function () {
|
|
17
|
+
document.body.innerHTML = '';
|
|
18
|
+
});
|
|
19
|
+
|
|
16
20
|
this._url = `/${appPath}/${urlExtra}`;
|
|
17
21
|
// Can't resize browser window when connected to remote debugger!
|
|
18
22
|
if (!browser._options || !browser._options.remote) {
|
|
@@ -22,7 +26,9 @@ class Page {
|
|
|
22
26
|
await browser.url(this.url);
|
|
23
27
|
|
|
24
28
|
const body = await $('body');
|
|
25
|
-
await body.
|
|
29
|
+
await body.waitForDisplayed({timeout: 5000});
|
|
30
|
+
|
|
31
|
+
await this.delay(200);
|
|
26
32
|
}
|
|
27
33
|
|
|
28
34
|
serializeParams (params) {
|
|
@@ -69,7 +75,7 @@ class Page {
|
|
|
69
75
|
|
|
70
76
|
// For testing "pointer off" by timeout.
|
|
71
77
|
async hidePointerByKeycode () {
|
|
72
|
-
browser.execute(function () {
|
|
78
|
+
await browser.execute(function () {
|
|
73
79
|
const event = document.createEvent('Events');
|
|
74
80
|
event.initEvent('keydown', true, true);
|
|
75
81
|
event.keyCode = 1537;
|
|
@@ -136,11 +142,11 @@ class Page {
|
|
|
136
142
|
await browser.waitUntil(() => target.isExisting() && target.isFocused(), {timeout, timeoutMsg, interval});
|
|
137
143
|
}
|
|
138
144
|
|
|
139
|
-
async waitTransitionEnd (
|
|
145
|
+
async waitTransitionEnd (timeout = 3000, timeoutMsg = 'timed out waiting for transitionend', callback, ignore = ['opacity', 'filter']) {
|
|
140
146
|
await browser.execute(
|
|
141
147
|
// eslint-disable-next-line no-shadow
|
|
142
|
-
function (ignore) {
|
|
143
|
-
window.ontransitionend = function (evt) {
|
|
148
|
+
async function (ignore) {
|
|
149
|
+
window.ontransitionend = await function (evt) {
|
|
144
150
|
if (!ignore || ignore.indexOf(evt.propertyName) === -1) {
|
|
145
151
|
window.__transition = true;
|
|
146
152
|
}
|
|
@@ -150,18 +156,17 @@ class Page {
|
|
|
150
156
|
ignore
|
|
151
157
|
);
|
|
152
158
|
if (callback) {
|
|
153
|
-
callback();
|
|
159
|
+
await callback();
|
|
154
160
|
}
|
|
155
161
|
await browser.waitUntil(
|
|
156
|
-
function () {
|
|
157
|
-
return browser.execute(
|
|
158
|
-
function () {
|
|
159
|
-
return window.__transition;
|
|
162
|
+
async function () {
|
|
163
|
+
return await browser.execute(
|
|
164
|
+
async function () {
|
|
165
|
+
return await window.__transition;
|
|
160
166
|
}
|
|
161
167
|
);
|
|
162
168
|
},
|
|
163
|
-
|
|
164
|
-
msg
|
|
169
|
+
{timeout, timeoutMsg}
|
|
165
170
|
);
|
|
166
171
|
}
|
|
167
172
|
}
|
package/utils/runTest.js
CHANGED
|
@@ -19,7 +19,7 @@ const runTest = ({concurrency, filter, Page, testName, ...rest}) => {
|
|
|
19
19
|
await Page.open('?request');
|
|
20
20
|
|
|
21
21
|
let testCases = await browser.execute(async function () {
|
|
22
|
-
return await window.__TEST_DATA;
|
|
22
|
+
return await window.__TEST_DATA;
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
await expect(testCases).to.be.an('object', 'Test data failed to load');
|