@enact/ui-test-utils 2.0.0 → 3.0.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 +8 -0
- package/README.md +14 -14
- package/config/wdio.conf.js +4 -6
- package/eslint.config.js +3 -3
- package/npm-shrinkwrap.json +3132 -2427
- package/package.json +22 -13
- package/screenshot/index.js +1 -1
- package/screenshot/package.json +2 -1
- package/screenshot/utils/confHelpers.js +6 -7
- package/screenshot/utils/headerTemplate.js +2 -2
- package/screenshot/wdio.conf.js +6 -3
- package/screenshot/wdio.docker.conf.js +7 -5
- package/screenshot/wdio.tv.conf.js +9 -7
- package/src/build-apps.js +11 -6
- package/start-tests.js +1 -1
- package/ui/package.json +2 -1
- package/ui/wdio.conf.js +7 -4
- package/ui/wdio.docker.conf.js +7 -5
- package/ui/wdio.tv.conf.js +8 -6
- package/utils/Page.js +2 -8
- package/utils/generateTestData.js +1 -5
- package/utils/index.js +7 -7
- package/utils/ipAddress.js +2 -2
- package/utils/qs.js +3 -8
- package/utils/runTest.js +3 -8
- package/utils/selector.js +2 -4
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -9,29 +9,29 @@ and must be configured as a `devDependency` of the UI library.
|
|
|
9
9
|
1. Add `@enact/ui-test-utils` as a devDependency: `npm i --save-dev @enact/ui-test-utils`
|
|
10
10
|
2. Create the `tests/ui` folder structure within the UI library
|
|
11
11
|
3. Add `apps` and `specs` folders to `tests/ui`
|
|
12
|
-
4. Add local WebDriver configuration files within `tests/ui`
|
|
12
|
+
4. Add local WebDriver configuration files within `tests/ui/config`
|
|
13
13
|
|
|
14
|
-
* `wdio.conf.js` containing `
|
|
15
|
-
* `wdio.docker.conf.js` containing `
|
|
16
|
-
* `wdio.tv.conf.js` containing `
|
|
14
|
+
* `wdio.conf.js` containing `import config from '@enact/ui-test-utils/ui/wdio.conf.js'; export default uiConfig;`
|
|
15
|
+
* `wdio.docker.conf.js` containing `import {uiDockerConfig} from '@enact/ui-test-utils/ui/wdio.docker.conf.js'; export default config;`
|
|
16
|
+
* `wdio.tv.conf.js` containing `import {uiTVConfig} from '@enact/ui-test-utils/ui/wdio.tv.conf.js'; export default config;`
|
|
17
17
|
|
|
18
|
-
* and `tests/screenshot`
|
|
18
|
+
* and `tests/screenshot/config`
|
|
19
19
|
|
|
20
|
-
* `wdio.conf.js` containing `
|
|
21
|
-
* `wdio.docker.conf.js` containing `
|
|
22
|
-
* `wdio.tv.conf.js` containing `
|
|
20
|
+
* `wdio.conf.js` containing `import config from '@enact/ui-test-utils/screenshot/wdio.conf.js'; export default ssConfig;`
|
|
21
|
+
* `wdio.docker.conf.js` containing `import {ssDockerConfig} from '@enact/ui-test-utils/screenshot/wdio.docker.conf.js'; export default config;`
|
|
22
|
+
* `wdio.tv.conf.js` containing `import {ssTVConfig} from '@enact/ui-test-utils/screenshot/wdio.tv.conf.js'; export default config;`
|
|
23
23
|
|
|
24
24
|
5. Add npm scripts for each of the above configuration files. There are likely other scripts already
|
|
25
25
|
defined so these will be added to the existing scripts.
|
|
26
26
|
|
|
27
27
|
```json
|
|
28
28
|
"scripts": {
|
|
29
|
-
"test-ui": "start-tests tests/ui/wdio.conf.js",
|
|
30
|
-
"test-ui-docker": "start-tests tests/ui/wdio.docker.conf.js",
|
|
31
|
-
"test-ui-tv": "start-tests tests/ui/wdio.tv.conf.js",
|
|
32
|
-
"test-ss": "start-tests tests/screenshot/wdio.conf.js",
|
|
33
|
-
"test-ss-docker": "start-tests tests/screenshot/wdio.docker.conf.js",
|
|
34
|
-
"test-ss-tv": "start-tests tests/screenshot/wdio.tv.conf.js",
|
|
29
|
+
"test-ui": "start-tests tests/ui/config/wdio.conf.js",
|
|
30
|
+
"test-ui-docker": "start-tests tests/ui/config/wdio.docker.conf.js",
|
|
31
|
+
"test-ui-tv": "start-tests tests/ui/config/wdio.tv.conf.js",
|
|
32
|
+
"test-ss": "start-tests tests/screenshot/config/wdio.conf.js",
|
|
33
|
+
"test-ss-docker": "start-tests tests/screenshot/config/wdio.docker.conf.js",
|
|
34
|
+
"test-ss-tv": "start-tests tests/screenshot/config/wdio.tv.conf.js",
|
|
35
35
|
}
|
|
36
36
|
```
|
|
37
37
|
|
package/config/wdio.conf.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import parseArgs from 'minimist';
|
|
2
|
+
import {execSync} from 'child_process';
|
|
3
3
|
|
|
4
4
|
const args = parseArgs(process.argv);
|
|
5
5
|
|
|
@@ -7,7 +7,7 @@ const visibleBrowser = !!args.visible,
|
|
|
7
7
|
maxInstances = args.instances || 5,
|
|
8
8
|
offline = args.offline;
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
export const configure = (options) => {
|
|
11
11
|
const {base, services} = options;
|
|
12
12
|
const opts = Object.assign({}, options);
|
|
13
13
|
|
|
@@ -83,7 +83,7 @@ module.exports.configure = (options) => {
|
|
|
83
83
|
// the config file unless it's absolute.
|
|
84
84
|
//
|
|
85
85
|
specs: [
|
|
86
|
-
'
|
|
86
|
+
'../../../tests/' + base + '/specs/**/*-specs.js'
|
|
87
87
|
],
|
|
88
88
|
// Patterns to exclude.
|
|
89
89
|
exclude: [
|
|
@@ -220,8 +220,6 @@ module.exports.configure = (options) => {
|
|
|
220
220
|
* variables like `browser`. It is the perfect place to define custom commands.
|
|
221
221
|
*/
|
|
222
222
|
before: function () {
|
|
223
|
-
require('expect-webdriverio');
|
|
224
|
-
|
|
225
223
|
global.wdioExpect = global.expect;
|
|
226
224
|
|
|
227
225
|
if (options.before) {
|
package/eslint.config.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import enactStrict from 'eslint-config-enact/strict.js';
|
|
2
|
+
import globals from 'globals';
|
|
3
3
|
|
|
4
4
|
const customGlobals = {
|
|
5
5
|
'browser': true,
|
|
@@ -8,7 +8,7 @@ const customGlobals = {
|
|
|
8
8
|
'$$': true
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
export default [
|
|
12
12
|
...enactStrict,
|
|
13
13
|
{
|
|
14
14
|
languageOptions: {
|