browsertime 22.10.0 → 22.10.2

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,14 @@
1
1
  # Browsertime changelog (we do [semantic versioning](https://semver.org))
2
2
 
3
+ ## 22.10.2 - 2024-09-13
4
+ ### Fixed
5
+ * Fix for wait.byIdAndVisible command [#2179](https://github.com/sitespeedio/browsertime/pull/2179).
6
+
7
+ ## 22.10.1 - 2024-09-04
8
+ ### Fixed
9
+ * Upgraded Bidi HAR to 0.0.14 that filters out data:text URLs thar is picked up in Firefox 130 [#2177](https://github.com/sitespeedio/browsertime/pull/2177).
10
+ * Call stopSampling on browser stop during android power testing [#2176](https://github.com/sitespeedio/browsertime/pull/2176).
11
+
3
12
  ## 22.10.0 - 2024-09-03
4
13
  ### Added
5
14
  * Chromedriver 128 [#2175](https://github.com/sitespeedio/browsertime/pull/2175)
@@ -489,8 +489,12 @@ export class Chromium {
489
489
  await unlink(netlog);
490
490
  }
491
491
 
492
- if (this.android && this.options.androidPower) {
493
- await this.android.stopPowerTesting();
492
+ if (this.android) {
493
+ if (this.options.androidPower) {
494
+ await this.android.stopPowerTesting();
495
+ } else if (this.options.androidUsbPower) {
496
+ await usbPowerProfiler.stopSampling();
497
+ }
494
498
  }
495
499
 
496
500
  if (this.cdpClient) {
@@ -55,12 +55,15 @@ export class Wait {
55
55
  * @returns {Promise<void>} A promise that resolves when the element is found or the time times out.
56
56
  * @throws {Error} Throws an error if the element is not found within the specified time.
57
57
  */
58
- async byIdAndVisible(id, maxTime) {
58
+ async byIdAndVisible(id, maxTime = 6000) {
59
59
  const driver = this.browser.getDriver();
60
60
  await this.byId(id, maxTime);
61
61
  try {
62
+ driver.findElement;
62
63
  await driver.wait(
63
- webdriver.until.elementIsVisible(webdriver.By.id(id)),
64
+ webdriver.until.elementIsVisible(
65
+ driver.findElement(webdriver.By.id(id))
66
+ ),
64
67
  maxTime
65
68
  );
66
69
  } catch (error) {
@@ -397,8 +397,12 @@ export class Firefox {
397
397
  * Before the browser is stopped/closed.
398
398
  */
399
399
  async beforeBrowserStop() {
400
- if (isAndroidConfigured(this.options) && this.options.androidPower) {
401
- await this.android.stopPowerTesting();
400
+ if (isAndroidConfigured(this.options)) {
401
+ if (this.options.androidPower) {
402
+ await this.android.stopPowerTesting();
403
+ } else if (this.options.androidUsbPower) {
404
+ await usbPowerProfiler.stopSampling();
405
+ }
402
406
  }
403
407
  }
404
408
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "browsertime",
3
3
  "description": "Get performance metrics from your web page using Browsertime.",
4
- "version": "22.10.0",
4
+ "version": "22.10.2",
5
5
  "bin": "./bin/browsertime.js",
6
6
  "type": "module",
7
7
  "types": "./types/scripting.d.ts",
@@ -19,7 +19,7 @@
19
19
  "dayjs": "1.11.13",
20
20
  "execa": "9.3.1",
21
21
  "fast-stats": "0.0.7",
22
- "ff-test-bidi-har-export": "0.0.13",
22
+ "ff-test-bidi-har-export": "0.0.14",
23
23
  "find-up": "7.0.0",
24
24
  "get-port": "7.1.0",
25
25
  "hasbin": "1.2.3",
@@ -33,7 +33,7 @@ export class Wait {
33
33
  * @returns {Promise<void>} A promise that resolves when the element is found or the time times out.
34
34
  * @throws {Error} Throws an error if the element is not found within the specified time.
35
35
  */
36
- byIdAndVisible(id: string, maxTime: number): Promise<void>;
36
+ byIdAndVisible(id: string, maxTime?: number): Promise<void>;
37
37
  /**
38
38
  * Waits for an element located by XPath to appear within a maximum time.
39
39
  *
@@ -1 +1 @@
1
- {"version":3,"file":"wait.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/wait.js"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH;IACE,kDASC;IARC;;OAEG;IACH,gBAAsB;IACtB;;OAEG;IACH,0BAA0C;IAG5C;;;;;;;;OAQG;IACH,SALW,MAAM,WACN,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CAiBzB;IAED;;;;;;;;OAQG;IACH,mBALW,MAAM,WACN,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CAgBzB;IAED;;;;;;;;OAQG;IACH,eALW,MAAM,WACN,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CAmBzB;IAED;;;;;;;;OAQG;IACH,qBALW,MAAM,WACN,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CAuBzB;IAED;;;;;;;OAOG;IACH,WAHW,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CAIzB;IAED;;;;;OAKG;IACH,oBAFa,OAAO,CAAC,IAAI,CAAC,CAIzB;IAED;;;;;;;;OAQG;IACH,0BALW,MAAM,WACN,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CAiBzB;CACF"}
1
+ {"version":3,"file":"wait.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/wait.js"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH;IACE,kDASC;IARC;;OAEG;IACH,gBAAsB;IACtB;;OAEG;IACH,0BAA0C;IAG5C;;;;;;;;OAQG;IACH,SALW,MAAM,WACN,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CAiBzB;IAED;;;;;;;;OAQG;IACH,mBALW,MAAM,YACN,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CAmBzB;IAED;;;;;;;;OAQG;IACH,eALW,MAAM,WACN,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CAmBzB;IAED;;;;;;;;OAQG;IACH,qBALW,MAAM,WACN,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CAuBzB;IAED;;;;;;;OAOG;IACH,WAHW,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CAIzB;IAED;;;;;OAKG;IACH,oBAFa,OAAO,CAAC,IAAI,CAAC,CAIzB;IAED;;;;;;;;OAQG;IACH,0BALW,MAAM,WACN,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CAiBzB;CACF"}