browsertime 16.10.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 CHANGED
@@ -1,5 +1,21 @@
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).
6
+ ## 16.11.0 - 2022-06-28
7
+
8
+ ### Added
9
+ * Firefox 102 and Edge 103 in the Docker container.
10
+ * Use Edgedriver 103 [#1812](https://github.com/sitespeedio/browsertime/pull/1812)
11
+ ### Fixed
12
+ * Upgraded to Selenium 4.3.0 [#1813](https://github.com/sitespeedio/browsertime/pull/1813).
13
+
14
+ ## 16.10.1 - 2022-06-26
15
+
16
+ ### Fixed
17
+ * Verify that the CDP port is free before using it [1811](https://github.com/sitespeedio/browsertime/pull/1811).
18
+
3
19
  ## 16.10.0 - 2022-06-23
4
20
  ### Added
5
21
  * Upgraded the Docker container to use Chrome 103.
@@ -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
- let engine = new Engine({
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, {});
@@ -56,7 +56,7 @@ class ChromeDevtoolsProtocol {
56
56
  port: this.options.devToolsPort
57
57
  });
58
58
  } else {
59
- this.cdpClient = await CDP({});
59
+ this.cdpClient = await CDP({ port: this.options.devToolsPort });
60
60
  }
61
61
  // Enable what's needs to be enabled
62
62
  // Page is needed to inject JS to a page
@@ -24,6 +24,5 @@ module.exports = [
24
24
  '--disable-fetching-hints-at-navigation-start',
25
25
  '--disable-dev-shm-usage',
26
26
  '--disable-back-forward-cache',
27
- '--disable-site-isolation-trials',
28
- '--remote-debugging-port=9222'
27
+ '--disable-site-isolation-trials'
29
28
  ];
@@ -129,6 +129,9 @@ module.exports = function (seleniumOptions, browserOptions, options, baseDir) {
129
129
  } else {
130
130
  if (!browserOptions.noDefaultOptions) {
131
131
  seleniumOptions.addArguments(defaultChromeOptions);
132
+ seleniumOptions.addArguments(
133
+ '--remote-debugging-port=' + options.devToolsPort
134
+ );
132
135
  } else {
133
136
  log.info('Skip setting default options for Chrome');
134
137
  }
@@ -64,6 +64,10 @@ class Engine {
64
64
  host: '127.0.0.1'
65
65
  });
66
66
 
67
+ log.debug(
68
+ `Preparing port ${options.devToolsPort} for devtools on Chrome/Edge`
69
+ );
70
+
67
71
  options.safariDriverPort = await getPort({
68
72
  port: getPort.makeRange(1234, 2000),
69
73
  host: '127.0.0.1'
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "description": "Browsertime",
3
- "version": "16.10.0",
3
+ "version": "16.11.1",
4
4
  "bin": "./bin/browsertime.js",
5
5
  "dependencies": {
6
6
  "@cypress/xvfb": "1.2.4",
7
7
  "@devicefarmer/adbkit": "2.11.3",
8
8
  "@sitespeed.io/chromedriver": "103.0.5060-24",
9
- "@sitespeed.io/edgedriver": "101.0.1210-32",
9
+ "@sitespeed.io/edgedriver": "103.0.1264-37",
10
10
  "@sitespeed.io/geckodriver": "0.31.0",
11
11
  "@sitespeed.io/throttle": "4.0.1",
12
12
  "@sitespeed.io/tracium": "0.3.3",
@@ -26,7 +26,7 @@
26
26
  "lodash.merge": "4.6.2",
27
27
  "lodash.pick": "4.4.0",
28
28
  "lodash.set": "4.3.2",
29
- "selenium-webdriver": "4.2.0",
29
+ "selenium-webdriver": "4.3.0",
30
30
  "yargs": "17.4.1"
31
31
  },
32
32
  "optionalDependencies": {