@enact/ui-test-utils 1.0.8 → 1.0.10
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 +8 -0
- package/README.md +14 -24
- package/config/wdio.conf.js +8 -2
- package/npm-shrinkwrap.json +1242 -15766
- package/package.json +6 -3
package/.travis.yml
CHANGED
package/CHANGELOG.md
CHANGED
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');`
|
|
@@ -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 '
|
|
63
|
+
Example 1 - will execute tests for 'Button'
|
|
64
64
|
|
|
65
65
|
```bash
|
|
66
|
-
npm run test-ui -- --spec
|
|
66
|
+
npm run test-ui -- --spec Button
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
-
Example 2 - will execute tests for '
|
|
69
|
+
Example 2 - will execute tests for 'InputField' component
|
|
70
70
|
|
|
71
71
|
```bash
|
|
72
|
-
npm run test-ui -- --spec /
|
|
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
|
|
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
|
|
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
|
|
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
|
|
@@ -230,7 +220,7 @@ npm run test-ui -- --visible --spec /Input
|
|
|
230
220
|
|
|
231
221
|
### Loading sample apps in a browser
|
|
232
222
|
|
|
233
|
-
This requires that a server be running on port
|
|
223
|
+
This requires that a server be running on port 3000. If you have globally installed the `serve`
|
|
234
224
|
command with `npm install -g serve` you can start the server like this:
|
|
235
225
|
|
|
236
226
|
```bash
|
|
@@ -241,27 +231,27 @@ To open a specific test app, open the URL path for the test. The path will matc
|
|
|
241
231
|
source file for the app. For example, to open the `VirtualList` test app, navigate to:
|
|
242
232
|
|
|
243
233
|
```none
|
|
244
|
-
http://localhost:
|
|
234
|
+
http://localhost:3000/VirtualList-View/
|
|
245
235
|
```
|
|
246
236
|
|
|
247
237
|
### Viewing screenshot tests in the browser
|
|
248
238
|
|
|
249
|
-
Navigate to a URL using the component name and test case number. Change '
|
|
239
|
+
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
240
|
|
|
251
241
|
An index page will be served when no component is specified. Select a test from the list to open it.
|
|
252
242
|
|
|
253
243
|
```none
|
|
254
|
-
localhost:
|
|
244
|
+
localhost:3000/Sandstone-View/
|
|
255
245
|
```
|
|
256
246
|
|
|
257
247
|
You can go directly to a test by specifying the component name and test ID number:
|
|
258
248
|
|
|
259
249
|
```none
|
|
260
|
-
localhost:
|
|
250
|
+
localhost:3000/Sandstone-View/?component=<component name>&testId=<number of the test>
|
|
261
251
|
```
|
|
262
252
|
|
|
263
253
|
Example:
|
|
264
254
|
|
|
265
255
|
```none
|
|
266
|
-
localhost:
|
|
256
|
+
localhost:3000/Sandstone-View/?component=RadioItem&testId=10
|
|
267
257
|
```
|
package/config/wdio.conf.js
CHANGED
|
@@ -33,7 +33,13 @@ module.exports.configure = (options) => {
|
|
|
33
33
|
const chromeVersion = /Chrome (\d+)/.exec(execSync('google-chrome -version'));
|
|
34
34
|
chromeVersionMajorNumber = (chromeVersion && chromeVersion[1]);
|
|
35
35
|
}
|
|
36
|
-
|
|
36
|
+
let chromeDriverVersion;
|
|
37
|
+
|
|
38
|
+
if (chromeVersionMajorNumber > 114) {
|
|
39
|
+
chromeDriverVersion = execSync('curl https://googlechromelabs.github.io/chrome-for-testing/LATEST_RELEASE' + (chromeVersionMajorNumber ? ('_' + chromeVersionMajorNumber) : ''));
|
|
40
|
+
} else {
|
|
41
|
+
chromeDriverVersion = execSync('curl https://chromedriver.storage.googleapis.com/LATEST_RELEASE' + (chromeVersionMajorNumber ? ('_' + chromeVersionMajorNumber) : ''));
|
|
42
|
+
}
|
|
37
43
|
|
|
38
44
|
if (chromeDriverVersion.includes('Error') || !/\d+.\d+.\d+.\d+/.exec(chromeDriverVersion)) {
|
|
39
45
|
throw new Error();
|
|
@@ -183,7 +189,7 @@ module.exports.configure = (options) => {
|
|
|
183
189
|
chrome : {
|
|
184
190
|
version : process.env.CHROME_DRIVER,
|
|
185
191
|
arch : process.arch,
|
|
186
|
-
baseURL : 'https://chromedriver.storage.googleapis.com'
|
|
192
|
+
baseURL : process.env.CHROME_DRIVER > 114 ? 'https://storage.googleapis.com' : 'https://chromedriver.storage.googleapis.com'
|
|
187
193
|
}
|
|
188
194
|
}
|
|
189
195
|
}
|