@enact/ui-test-utils 1.0.9 → 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 CHANGED
@@ -1,7 +1,7 @@
1
- dist: focal
1
+ dist: jammy
2
2
  language: node_js
3
3
  node_js:
4
- - node
4
+ - 21
5
5
  before_install:
6
6
  - sudo apt-get update
7
7
  - sudo apt-get install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
package/CHANGELOG.md CHANGED
@@ -1,8 +1,17 @@
1
1
  # Change Log
2
2
 
3
+ ## [2.0.0-alpha.1] (February 26, 2025)
4
+
5
+ * Updated `eslint` to v9 and adopted flat config.
6
+ * Added `--no-animation` option for screenshot test.
7
+
8
+ ## [1.0.10] (October 31, 2024)
9
+
10
+ * Updated dependencies.
11
+
3
12
  ## [1.0.9] (July 22, 2024)
4
13
 
5
- * Updated Chrome driver url for version 114 or higher
14
+ * Updated Chrome driver url for version 114 or higher.
6
15
 
7
16
  ## [1.0.8] (June 11, 2024)
8
17
 
package/README.md CHANGED
@@ -15,7 +15,7 @@ and must be configured as a `devDependency` of the UI library.
15
15
  * `wdio.docker.conf.js` containing `module.exports = require('@enact/ui-test-utils/ui/wdio.docker.conf.js');`
16
16
  * `wdio.tv.conf.js` containing `module.exports = require('@enact/ui-test-utils/ui/wdio.tv.conf.js');`
17
17
 
18
- and `tests/screenshot`
18
+ * and `tests/screenshot`
19
19
 
20
20
  * `wdio.conf.js` containing `module.exports = require('@enact/ui-test-utils/screenshot/wdio.conf.js');`
21
21
  * `wdio.docker.conf.js` containing `module.exports = require('@enact/ui-test-utils/screenshot/wdio.docker.conf.js');`
@@ -35,7 +35,7 @@ and `tests/screenshot`
35
35
  }
36
36
  ```
37
37
 
38
- 6. Optionally configure different ESLint and git configuration rules using `.eslintrc.js` and
38
+ 6. Optionally configure different ESLint and git configuration rules using `eslint.config.js` and
39
39
  `.gitignore` files, respectively
40
40
 
41
41
  ## Creating tests
@@ -60,16 +60,16 @@ TV_IP=10.0.1.1 npm run test-ui-tv
60
60
  npm run test-ui -- --spec <pattern>
61
61
  ```
62
62
 
63
- Example 1 - will execute tests for 'ExpandableInput'
63
+ Example 1 - will execute tests for 'Button'
64
64
 
65
65
  ```bash
66
- npm run test-ui -- --spec ExpandableInput
66
+ npm run test-ui -- --spec Button
67
67
  ```
68
68
 
69
- Example 2 - will execute tests for 'Input' component
69
+ Example 2 - will execute tests for 'InputField' component
70
70
 
71
71
  ```bash
72
- npm run test-ui -- --spec /Input
72
+ npm run test-ui -- --spec /InputField
73
73
  ```
74
74
 
75
75
  Note: `<pattern>` can also be a regex and may need to be in quotes to prevent expansion on the command
@@ -98,13 +98,13 @@ npm run test-ss -- --component Button
98
98
  ### Filtering Screenshot by Theme
99
99
 
100
100
  ```bash
101
- npm run test-ss -- --spec MoonstoneLight-specs
101
+ npm run test-ss -- --spec Light-specs
102
102
  ```
103
103
 
104
104
  You can combine theme and component filtering for more precise runs:
105
105
 
106
106
  ```bash
107
- npm run test-ss -- --component CheckboxItem --spec Moonstone-specs
107
+ npm run test-ss -- --component CheckboxItem --spec Default-specs
108
108
  ```
109
109
 
110
110
  ### Filtering Screenshot by Title
@@ -165,7 +165,7 @@ open tests/screenshot/dist/failedTests.html
165
165
 
166
166
  Images can be navigated using the keyboard arrow keys. Click on an image to zoom in. Click out of the image to zoom out.
167
167
 
168
- In the output, the **test case** button opens the sample app with the parameters that produced the output. This requires that a server be running on port 5000. If you have globally installed the `serve` command with `npm install -g serve` you can start the server like this:
168
+ In the output, the **test case** button opens the sample app with the parameters that produced the output. This requires that a server be running on port 3000. If you have globally installed the `serve` command with `npm install -g serve` you can start the server like this:
169
169
 
170
170
  ```bash
171
171
  serve tests/screenshot/dist
@@ -182,16 +182,6 @@ the Enact version or test apps will not be picked up.
182
182
  npm run test-ui -- --spec /Input --skip-build
183
183
  ```
184
184
 
185
- ### Re-pack the apps without running the tests
186
-
187
- To re-pack just the tests, without rebuilding Enact or running the tests, use `--pack-tests`. This
188
- is primarily useful when using `serve dist` (See **Loading sample apps in a browser** below) to view
189
- test apps in the browser.
190
-
191
- ```bash
192
- npm run test-ui -- --pack-tests
193
- ```
194
-
195
185
  ## Advanced Usage
196
186
 
197
187
  ### Setting the Number of Concurrent Instances
@@ -228,9 +218,18 @@ For example, filtering for the component 'Input'.
228
218
  npm run test-ui -- --visible --spec /Input
229
219
  ```
230
220
 
221
+ ### Running without animation effects
222
+
223
+ The `--no-animation` option is used to pack Enact without animation.
224
+ You can use this option to test the apps without animation effects.
225
+
226
+ ```bash
227
+ npm run test-ss -- --no-animation
228
+ ```
229
+
231
230
  ### Loading sample apps in a browser
232
231
 
233
- This requires that a server be running on port 5000. If you have globally installed the `serve`
232
+ This requires that a server be running on port 3000. If you have globally installed the `serve`
234
233
  command with `npm install -g serve` you can start the server like this:
235
234
 
236
235
  ```bash
@@ -241,27 +240,27 @@ To open a specific test app, open the URL path for the test. The path will matc
241
240
  source file for the app. For example, to open the `VirtualList` test app, navigate to:
242
241
 
243
242
  ```none
244
- http://localhost:5000/VirtualList-View/
243
+ http://localhost:3000/VirtualList-View/
245
244
  ```
246
245
 
247
246
  ### Viewing screenshot tests in the browser
248
247
 
249
- Navigate to a URL using the component name and test case number. Change 'Moonstone-View' to the name of the view appropriate for your library.
248
+ Navigate to a URL using the component name and test case number. Change 'Sandstone-View' to the name of the view appropriate for your library.
250
249
 
251
250
  An index page will be served when no component is specified. Select a test from the list to open it.
252
251
 
253
252
  ```none
254
- localhost:5000/Moonstone-View/
253
+ localhost:3000/Sandstone-View/
255
254
  ```
256
255
 
257
256
  You can go directly to a test by specifying the component name and test ID number:
258
257
 
259
258
  ```none
260
- localhost:5000/Moonstone-View/?component=<component name>&testId=<number of the test>
259
+ localhost:3000/Sandstone-View/?component=<component name>&testId=<number of the test>
261
260
  ```
262
261
 
263
262
  Example:
264
263
 
265
264
  ```none
266
- localhost:5000/Moonstone-View/?component=RadioItem&testId=10
265
+ localhost:3000/Sandstone-View/?component=RadioItem&testId=10
267
266
  ```
@@ -47,7 +47,7 @@ module.exports.configure = (options) => {
47
47
  process.env.CHROME_DRIVER = chromeDriverVersion;
48
48
  }
49
49
  } catch (error) {
50
- console.log('ERROR: Cannnot find Chrome driver from Chrome ' + chromeVersionMajorNumber);
50
+ console.log('ERROR: Cannot find Chrome driver from Chrome ' + chromeVersionMajorNumber);
51
51
  process.env.CHROME_DRIVER = 2.44;
52
52
  }
53
53
  }
@@ -95,7 +95,7 @@ module.exports.configure = (options) => {
95
95
  // First, you can define how many instances should be started at the same time. Let's
96
96
  // say you have 3 different capabilities (Chrome, Firefox, and Safari) and you have
97
97
  // set maxInstances to 1; wdio will spawn 3 processes. Therefore, if you have 10 spec
98
- // files and you set maxInstances to 10, all spec files will get tested at the same time
98
+ // files, and you set maxInstances to 10, all spec files will get tested at the same time
99
99
  // and 30 processes will get spawned. The property handles how many capabilities
100
100
  // from the same test should run tests.
101
101
  //
@@ -224,8 +224,6 @@ module.exports.configure = (options) => {
224
224
  /**
225
225
  * Gets executed before test execution begins. At this point you can access to all global
226
226
  * variables like `browser`. It is the perfect place to define custom commands.
227
- * @param {Array.<Object>} capabilities list of capabilities details
228
- * @param {Array.<String>} specs List of spec file paths that are to be run
229
227
  */
230
228
  before: function () {
231
229
  require('expect-webdriverio');
@@ -0,0 +1,34 @@
1
+ const enactStrict = require('eslint-config-enact/strict');
2
+ const globals = require('globals');
3
+
4
+ const customGlobals = {
5
+ 'browser': true,
6
+ 'expect': true,
7
+ '$': true,
8
+ '$$': true
9
+ };
10
+
11
+ module.exports = [
12
+ ...enactStrict,
13
+ {
14
+ languageOptions: {
15
+ ecmaVersion: 'latest',
16
+ sourceType: 'module',
17
+ globals: {
18
+ ...globals.node,
19
+ ...globals.mocha,
20
+ ...customGlobals
21
+ },
22
+ parserOptions: {
23
+ ecmaFeatures: {
24
+ jsx: true
25
+ }
26
+ }
27
+ },
28
+ rules: {
29
+ 'max-nested-callbacks': 'off',
30
+ 'no-console': 'off',
31
+ 'react/forbid-foreign-prop-types': 'off' // proptypes not removed in storybook config
32
+ }
33
+ }
34
+ ];