browsertime 21.7.0 → 21.7.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,10 @@
1
1
  # Browsertime changelog (we do [semantic versioning](https://semver.org))
2
2
 
3
+ ## 21.7.1 - 2024-04-03
4
+ ### Fixed
5
+ * Bug fix: If you test a URL that failed, we got an error that didn't produce the browsertime.json [#2120](https://github.com/sitespeedio/browsertime/pull/2120).
6
+ * Updated to Seleniuym webdriver 4.20.0 [#2121](https://github.com/sitespeedio/browsertime/pull/2121).
7
+
3
8
  ## 21.7.0 - 2024-04-03
4
9
  ### Added
5
10
  * Edge and Edgedriver 123 [#2116](https://github.com/sitespeedio/browsertime/pull/2116).
@@ -25,6 +25,7 @@ export class Debug {
25
25
  * Adds a breakpoint to the script. The browser will pause at the breakpoint, waiting for user input to continue.
26
26
  * This is useful for debugging and inspecting the browser state at a specific point in the script.
27
27
  *
28
+ * @example await commands.debug.breakpoint('break');
28
29
  * @async
29
30
  * @param {string} [name] - An optional name for the breakpoint for logging purposes.
30
31
  * @returns {Promise<void>} A promise that resolves when the user chooses to continue from the breakpoint.
@@ -24,6 +24,7 @@ export class Navigation {
24
24
  * Navigates backward in the browser's history.
25
25
  *
26
26
  * @async
27
+ * @example await commands.navigation.back();
27
28
  * @param {Object} [options] - Additional options for navigation. Set {wait:true} to wait for the page complete check to run.
28
29
  * @returns {Promise<void>} A promise that resolves when the navigation action is completed.
29
30
  * @throws {Error} Throws an error if navigation fails.
@@ -46,6 +47,7 @@ export class Navigation {
46
47
  * Navigates forward in the browser's history.
47
48
  *
48
49
  * @async
50
+ * @example await commands.navigation.forward();
49
51
  * @param {Object} [options] - Additional options for navigation. Set {wait:true} to wait for the page complete check to run.
50
52
  * @returns {Promise<void>} A promise that resolves when the navigation action is completed.
51
53
  * @throws {Error} Throws an error if navigation fails.
@@ -68,6 +70,7 @@ export class Navigation {
68
70
  * Refreshes the current page.
69
71
  *
70
72
  * @async
73
+ * @example await commands.navigation.refresh();
71
74
  * @param {Object} [options] - Additional options for refresh action. Set {wait:true} to wait for the page complete check to run.
72
75
  * @returns {Promise<void>} A promise that resolves when the page has been refreshed.
73
76
  * @throws {Error} Throws an error if refreshing the page fails.
@@ -335,11 +335,18 @@ export class Engine {
335
335
  const extras = await engineDelegate.getHARs();
336
336
 
337
337
  // Backfill the fully loaded data that we extract from the HAR
338
- if (!options.skipHar && extras.har) {
338
+ // Only do this if we actually had requests
339
+ if (
340
+ !options.skipHar &&
341
+ extras.har &&
342
+ extras.har.log &&
343
+ extras.har.log.entries.length > 0
344
+ ) {
339
345
  const fullyLoadedPerUrl = getFullyLoaded(extras.har);
340
346
  for (let data of fullyLoadedPerUrl) {
341
347
  collector.addFullyLoaded(data.url, data.fullyLoaded);
342
348
  }
349
+
343
350
  // Add the timings from the main document
344
351
  const timings = getMainDocumentTimings(extras.har);
345
352
  for (let timing of timings) {
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": "21.7.0",
4
+ "version": "21.7.1",
5
5
  "bin": "./bin/browsertime.js",
6
6
  "type": "module",
7
7
  "types": "./types/scripting.d.ts",
@@ -30,7 +30,7 @@
30
30
  "lodash.merge": "4.6.2",
31
31
  "lodash.pick": "4.4.0",
32
32
  "lodash.set": "4.3.2",
33
- "selenium-webdriver": "4.19.0",
33
+ "selenium-webdriver": "4.20.0",
34
34
  "yargs": "17.7.2"
35
35
  },
36
36
  "optionalDependencies": {
@@ -19,6 +19,7 @@ export class Debug {
19
19
  * Adds a breakpoint to the script. The browser will pause at the breakpoint, waiting for user input to continue.
20
20
  * This is useful for debugging and inspecting the browser state at a specific point in the script.
21
21
  *
22
+ * @example await commands.debug.breakpoint('break');
22
23
  * @async
23
24
  * @param {string} [name] - An optional name for the breakpoint for logging purposes.
24
25
  * @returns {Promise<void>} A promise that resolves when the user chooses to continue from the breakpoint.
@@ -1 +1 @@
1
- {"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/debug.js"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH;IACE,wCASC;IARC;;OAEG;IACH,gBAAsB;IACtB;;OAEG;IACH,gBAAsB;IAGxB;;;;;;;OAOG;IACH,kBAHW,MAAM,GACJ,QAAQ,IAAI,CAAC,CA+BzB;CACF"}
1
+ {"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/debug.js"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH;IACE,wCASC;IARC;;OAEG;IACH,gBAAsB;IACtB;;OAEG;IACH,gBAAsB;IAGxB;;;;;;;;OAQG;IACH,kBAHW,MAAM,GACJ,QAAQ,IAAI,CAAC,CA+BzB;CACF"}
@@ -18,6 +18,7 @@ export class Navigation {
18
18
  * Navigates backward in the browser's history.
19
19
  *
20
20
  * @async
21
+ * @example await commands.navigation.back();
21
22
  * @param {Object} [options] - Additional options for navigation. Set {wait:true} to wait for the page complete check to run.
22
23
  * @returns {Promise<void>} A promise that resolves when the navigation action is completed.
23
24
  * @throws {Error} Throws an error if navigation fails.
@@ -27,6 +28,7 @@ export class Navigation {
27
28
  * Navigates forward in the browser's history.
28
29
  *
29
30
  * @async
31
+ * @example await commands.navigation.forward();
30
32
  * @param {Object} [options] - Additional options for navigation. Set {wait:true} to wait for the page complete check to run.
31
33
  * @returns {Promise<void>} A promise that resolves when the navigation action is completed.
32
34
  * @throws {Error} Throws an error if navigation fails.
@@ -36,6 +38,7 @@ export class Navigation {
36
38
  * Refreshes the current page.
37
39
  *
38
40
  * @async
41
+ * @example await commands.navigation.refresh();
39
42
  * @param {Object} [options] - Additional options for refresh action. Set {wait:true} to wait for the page complete check to run.
40
43
  * @returns {Promise<void>} A promise that resolves when the page has been refreshed.
41
44
  * @throws {Error} Throws an error if refreshing the page fails.
@@ -1 +1 @@
1
- {"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/navigation.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AAEH;IACE,kDASC;IARC;;OAEG;IACH,gBAAsB;IACtB;;OAEG;IACH,0BAA0C;IAG5C;;;;;;;OAOG;IACH,qBAHa,QAAQ,IAAI,CAAC,CAezB;IAED;;;;;;;OAOG;IACH,wBAHa,QAAQ,IAAI,CAAC,CAezB;IAED;;;;;;;OAOG;IACH,wBAHa,QAAQ,IAAI,CAAC,CAezB;CACF"}
1
+ {"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/navigation.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AAEH;IACE,kDASC;IARC;;OAEG;IACH,gBAAsB;IACtB;;OAEG;IACH,0BAA0C;IAG5C;;;;;;;;OAQG;IACH,qBAHa,QAAQ,IAAI,CAAC,CAezB;IAED;;;;;;;;OAQG;IACH,wBAHa,QAAQ,IAAI,CAAC,CAezB;IAED;;;;;;;;OAQG;IACH,wBAHa,QAAQ,IAAI,CAAC,CAezB;CACF"}