browsertime 16.15.1 → 16.17.0

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,18 @@
1
1
  # Browsertime changelog (we do [semantic versioning](https://semver.org))
2
2
 
3
+ ## 16.17.0 - 2022-09-27
4
+ ### Added
5
+ * Add ability to ignore shutdown failures on android, thank you [Gregory Mierzwinski](https://github.com/gmierz) for PR [#1850](https://github.com/sitespeedio/browsertime/pull/1850).
6
+ * Updated to Firefox 105 and Edge 105 in the Docker container.
7
+
8
+ ### Fixed
9
+ * Fix so we collect battery temperature statistics on Android (again) [#1851](https://github.com/sitespeedio/browsertime/pull/1851).
10
+
11
+ ## 16.16.0 - 2022-09-20
12
+ ### Added
13
+ * Chrome 105, Firefox 104 and Chromedriver 105 [#1843](https://github.com/sitespeedio/browsertime/pull/1843).
14
+ * Before you start a test on Android you can push the home button using `--androidPretestPressHomeButton` [#1844](https://github.com/sitespeedio/browsertime/pull/1844).
15
+
3
16
  ## 16.15.1 - 2022-08-30
4
17
  ### Fixed
5
18
  * Make sure long tasks are collected direct after a test ends. On a slow device it sometimes happened that long tasks was browsertime running scripts to collect metrics [#1841](https://github.com/sitespeedio/browsertime/pull/1841).
@@ -249,6 +249,10 @@ class Android {
249
249
  }
250
250
  }
251
251
 
252
+ async pressHomeButton() {
253
+ return this._runCommand('input keyevent KEYCODE_HOME');
254
+ }
255
+
252
256
  async stopVideo() {
253
257
  return this._runCommand(
254
258
  'command -v pkill >/dev/null && pkill -l SIGINT screenrecord || kill -2 $(ps screenrecord | grep -Eo [0-9]+ | grep -m 1 -Eo [0-9]+)'
@@ -184,6 +184,9 @@ class Collector {
184
184
 
185
185
  if (allData.batteryTemperature) {
186
186
  results.android.batteryTemperature.push(allData.batteryTemperature);
187
+ statistics.addDeep({
188
+ android: { batteryTemperature: allData.batteryTemperature }
189
+ });
187
190
  }
188
191
 
189
192
  if (allData.markedAsFailure) {
@@ -101,6 +101,10 @@ class Engine {
101
101
  await android.clickPowerButton();
102
102
  }
103
103
 
104
+ if (options.androidPretestPressHomeButton) {
105
+ await android.pressHomeButton();
106
+ }
107
+
104
108
  if (options.androidVerifyNetwork) {
105
109
  const pingAddress = get(options, 'androidPingAddress', '8.8.8.8');
106
110
  const connection = await android.ping(pingAddress);
@@ -259,7 +259,17 @@ class Iteration {
259
259
  if (options.browser === 'firefox' && options.debug) {
260
260
  log.info('Firefox is kept open in debug mode');
261
261
  } else {
262
- await browser.stop();
262
+ if (isAndroidConfigured(options) && options.ignoreShutdownFailures) {
263
+ try {
264
+ log.info('Ignoring shutdown failures on android...');
265
+ await browser.stop();
266
+ } catch (e) {
267
+ // Ignore shutdown failures on android
268
+ log.info('Shutdown problem hit, ignoring...');
269
+ }
270
+ } else {
271
+ await browser.stop();
272
+ }
263
273
  }
264
274
  // Give the browsers some time to stop
265
275
  await delay(2000);
@@ -682,6 +682,11 @@ module.exports.parseCommandLine = function parseCommandLine() {
682
682
  describe:
683
683
  'Specify browser. Safari only works on OS X/iOS. Edge only work on OS that supports Edge.'
684
684
  })
685
+ .option('ignoreShutdownFailures', {
686
+ type: 'boolean',
687
+ default: false,
688
+ describe: 'If set, shutdown failures will be ignored on Android.'
689
+ })
685
690
  .option('android', {
686
691
  type: 'boolean',
687
692
  default: false,
@@ -716,6 +721,11 @@ module.exports.parseCommandLine = function parseCommandLine() {
716
721
  default: false,
717
722
  describe: 'Press the power button on the phone before a test starts.'
718
723
  })
724
+ .option('androidPretestPressHomeButton', {
725
+ type: 'boolean',
726
+ default: false,
727
+ describe: 'Press the home button on the phone before a test starts.'
728
+ })
719
729
  .option('androidVerifyNetwork', {
720
730
  type: 'boolean',
721
731
  default: false,
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "description": "Browsertime",
3
- "version": "16.15.1",
3
+ "version": "16.17.0",
4
4
  "bin": "./bin/browsertime.js",
5
5
  "dependencies": {
6
6
  "@cypress/xvfb": "1.2.4",
7
7
  "@devicefarmer/adbkit": "2.11.3",
8
- "@sitespeed.io/chromedriver": "104.0.5112-29",
8
+ "@sitespeed.io/chromedriver": "105.0.5195-19",
9
9
  "@sitespeed.io/edgedriver": "104.0.1293-47",
10
10
  "@sitespeed.io/geckodriver": "0.31.0-c",
11
11
  "@sitespeed.io/throttle": "5.0.0",