@enact/ui-test-utils 1.0.10 → 2.0.0-alpha.1
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 +1 -1
- package/CHANGELOG.md +5 -0
- package/README.md +10 -1
- package/config/wdio.conf.js +2 -4
- package/eslint.config.js +34 -0
- package/npm-shrinkwrap.json +4749 -9329
- package/package.json +7 -7
- package/screenshot/utils/confHelpers.js +1 -1
- package/screenshot/wdio.tv.conf.js +0 -2
- package/src/build-apps.js +2 -1
- package/ui/wdio.conf.js +5 -3
- package/utils/runTest.js +1 -1
- package/.eslintrc.js +0 -25
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enact/ui-test-utils",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-alpha.1",
|
|
4
4
|
"description": "UI Testing for the Enact framework",
|
|
5
5
|
"repository": "https://github.com/enactjs/ui-test-utils",
|
|
6
6
|
"main": "index.js",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"author": "Roy Sutton <roy.sutton@lge.com>",
|
|
15
15
|
"license": "Apache-2.0",
|
|
16
16
|
"engines": {
|
|
17
|
-
"node": ">=
|
|
17
|
+
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
|
18
18
|
},
|
|
19
19
|
"publishConfig": {
|
|
20
20
|
"access": "public"
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@wdio/spec-reporter": "^7.33.0",
|
|
29
29
|
"@wdio/static-server-service": "^7.33.0",
|
|
30
30
|
"chalk": "^5.3.0",
|
|
31
|
-
"cross-spawn": "^7.0.
|
|
31
|
+
"cross-spawn": "^7.0.6",
|
|
32
32
|
"expect-webdriverio": "^3.6.0",
|
|
33
33
|
"fs-extra": "^11.2.0",
|
|
34
34
|
"minimist": "^1.2.8",
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
"webdriverio": "^7.36.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"eslint": "^
|
|
44
|
-
"eslint-config-enact": "^
|
|
45
|
-
"
|
|
46
|
-
"eslint-plugin-import": "^2.30.0"
|
|
43
|
+
"eslint": "^9.20.0",
|
|
44
|
+
"eslint-config-enact": "^5.0.0-alpha.5",
|
|
45
|
+
"globals": "^15.14.0"
|
|
47
46
|
},
|
|
48
47
|
"overrides": {
|
|
48
|
+
"cross-spawn": "$cross-spawn",
|
|
49
49
|
"ws": "^8.18.0"
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -20,7 +20,7 @@ function getScreenshotName (basePath) {
|
|
|
20
20
|
// Replace problematic filenames. Windows is much more restrictive.
|
|
21
21
|
testName = testName.replace(/[/\\:?*"|<>]/g, '_');
|
|
22
22
|
|
|
23
|
-
// shorten the name with a
|
|
23
|
+
// shorten the name with a bit of leading context to help find the file manually if necessary
|
|
24
24
|
testName = testName.substring(0, 128) + '-' + cryptoModule.createHash('md5').update(testName).digest('hex');
|
|
25
25
|
let screenshotFileName = path.join(basePath, ...testNameParts, `${testName}.png`);
|
|
26
26
|
return screenshotFileName.replace(/ /g, '_');
|
|
@@ -47,8 +47,6 @@ exports.config = Object.assign(
|
|
|
47
47
|
/**
|
|
48
48
|
* Gets executed before test execution begins. At this point you can access to all global
|
|
49
49
|
* variables like `browser`. It is the perfect place to define custom commands.
|
|
50
|
-
* @param {Array.<Object>} capabilities list of capabilities details
|
|
51
|
-
* @param {Array.<String>} specs List of spec file paths that are to be run
|
|
52
50
|
*/
|
|
53
51
|
before: function () {
|
|
54
52
|
if (config.before) {
|
package/src/build-apps.js
CHANGED
package/ui/wdio.conf.js
CHANGED
|
@@ -19,15 +19,17 @@ exports.config = configure({
|
|
|
19
19
|
// resolved to continue.
|
|
20
20
|
/**
|
|
21
21
|
* Gets executed once before all workers get launched.
|
|
22
|
-
* @param {Object} config wdio configuration object
|
|
23
|
-
* @param {Array.<Object>} capabilities list of capabilities details
|
|
24
22
|
*/
|
|
25
23
|
onPrepare: function () {
|
|
26
24
|
return buildApps('ui');
|
|
27
25
|
},
|
|
28
26
|
/**
|
|
29
27
|
* Function to be executed after a test (in Mocha/Jasmine) or a step (in Cucumber) starts.
|
|
30
|
-
* @param {Object}
|
|
28
|
+
* @param {Object} testCase test details
|
|
29
|
+
* @param {Object} _context scope object the test was executed with (unused)
|
|
30
|
+
* @param {Object} result test result
|
|
31
|
+
* @param {Number} result.duration duration of test
|
|
32
|
+
* @param {Boolean} result.passed true if test has passed, otherwise false
|
|
31
33
|
*/
|
|
32
34
|
afterTest: function (testCase, _context, {duration, passed}) {
|
|
33
35
|
if (duration > 2000) {
|
package/utils/runTest.js
CHANGED
|
@@ -54,7 +54,7 @@ const runTest = ({concurrency, filter, Page, testName, ...rest}) => {
|
|
|
54
54
|
let testCaseName = testNameParts.pop();
|
|
55
55
|
// Replace problematic filenames. Windows is much more restrictive.
|
|
56
56
|
testCaseName = testCaseName.replace(/[/\\:?*"|<>]/g, '_');
|
|
57
|
-
// shorten the name with a
|
|
57
|
+
// shorten the name with a bit of leading context to help find the file manually if necessary
|
|
58
58
|
testCaseName = testCaseName.substring(0, 128) + '-' + cryptoModule.createHash('md5').update(testCaseName).digest('hex');
|
|
59
59
|
const screenshotFileName = (component + '/' + testName + '/' + testCaseName);
|
|
60
60
|
|
package/.eslintrc.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
globals: {
|
|
3
|
-
'browser': true,
|
|
4
|
-
'expect': true,
|
|
5
|
-
'$': true,
|
|
6
|
-
'$$': true
|
|
7
|
-
},
|
|
8
|
-
env: {
|
|
9
|
-
mocha: true,
|
|
10
|
-
node: true
|
|
11
|
-
},
|
|
12
|
-
extends: 'enact/strict',
|
|
13
|
-
parserOptions: {
|
|
14
|
-
ecmaFeatures: {
|
|
15
|
-
jsx: true
|
|
16
|
-
},
|
|
17
|
-
ecmaVersion: 'latest',
|
|
18
|
-
sourceType: 'module'
|
|
19
|
-
},
|
|
20
|
-
rules: {
|
|
21
|
-
'max-nested-callbacks': 'off',
|
|
22
|
-
'no-console': 'off',
|
|
23
|
-
'react/forbid-foreign-prop-types': 'off' // proptypes not removed in storybook config
|
|
24
|
-
}
|
|
25
|
-
};
|