browsertime 16.11.0 → 16.11.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/CHANGELOG.md +3 -0
- package/bin/browsertime.js +30 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# Browsertime changelog (we do [semantic versioning](https://semver.org))
|
|
2
2
|
|
|
3
|
+
## 16.11.1 - 2022-06-29
|
|
4
|
+
### Fixed
|
|
5
|
+
* Fixed `--preWarmServer` so it works with `--headless`, Docker and specific Android or iOS device [#1815](https://github.com/sitespeedio/browsertime/pull/1815).
|
|
3
6
|
## 16.11.0 - 2022-06-28
|
|
4
7
|
|
|
5
8
|
### Added
|
package/bin/browsertime.js
CHANGED
|
@@ -7,6 +7,8 @@ const logging = require('../').logging;
|
|
|
7
7
|
const cli = require('../lib/support/cli');
|
|
8
8
|
const StorageManager = require('../lib/support/storageManager');
|
|
9
9
|
const merge = require('lodash.merge');
|
|
10
|
+
const get = require('lodash.get');
|
|
11
|
+
const set = require('lodash.set');
|
|
10
12
|
const fs = require('fs');
|
|
11
13
|
const path = require('path');
|
|
12
14
|
const log = require('intel').getLogger('browsertime');
|
|
@@ -28,12 +30,37 @@ async function parseUserScripts(scripts) {
|
|
|
28
30
|
}
|
|
29
31
|
|
|
30
32
|
async function preWarmServer(urls, options) {
|
|
31
|
-
|
|
33
|
+
const preWarmOptions = {
|
|
32
34
|
browser: options.browser,
|
|
33
35
|
iterations: 1,
|
|
34
36
|
xvfb: options.xvfb,
|
|
35
|
-
android: options.android
|
|
36
|
-
|
|
37
|
+
android: options.android,
|
|
38
|
+
docker: options.docker,
|
|
39
|
+
headless: options.headless
|
|
40
|
+
};
|
|
41
|
+
const chromeDevice = get(options, 'chrome.android.deviceSerial');
|
|
42
|
+
const firefoxDevice = get(options, 'firefox.android.deviceSerial');
|
|
43
|
+
const safariIos = get(options, 'safari.ios');
|
|
44
|
+
const safariDeviceName = get(options, 'safari.deviceName');
|
|
45
|
+
const safariDeviceUDID = get(options, 'safari.deviceUDID ');
|
|
46
|
+
|
|
47
|
+
if (chromeDevice) {
|
|
48
|
+
set(options, 'chrome.android.deviceSerial', chromeDevice);
|
|
49
|
+
} else if (firefoxDevice) {
|
|
50
|
+
set(options, 'firefox.android.deviceSerial', firefoxDevice);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (safariIos) {
|
|
54
|
+
set(options, 'safari.ios', true);
|
|
55
|
+
if (safariDeviceName) {
|
|
56
|
+
set(options, 'safari.deviceName', safariDeviceName);
|
|
57
|
+
}
|
|
58
|
+
if (safariDeviceUDID) {
|
|
59
|
+
set(options, 'safari.deviceUDID', safariDeviceUDID);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
let engine = new Engine(preWarmOptions);
|
|
37
64
|
await engine.start();
|
|
38
65
|
log.info('Start pre-testing/warming');
|
|
39
66
|
await engine.runMultiple(urls, {});
|