From 5c4bc1dcda1bd1b5dd3903581f08b3a0cacb2e1d Mon Sep 17 00:00:00 2001 From: soulgalore Date: Wed, 11 Oct 2023 14:36:41 +0200 Subject: [PATCH 1/6] changelog: new release --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ec6b31c164..47d706c47a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Browsertime changelog (we do [semantic versioning](https://semver.org)) +## 17.17.0 - 2022-10-11 +### Added +* Firefox 118, Edge 117 and Chrome/Chromedriver 118 in the Docker container [#1996](https://github.com/sitespeedio/browsertime/pull/1996). +* Expose trace start/stop for Chrome in scripting (the same way as for Firefox). Thank you [KS](https://github.com/92kns) for [#1988](https://github.com/sitespeedio/browsertime/pull/1988). Documentation is coming when the functionality is rolled out in sitespeed.io. + ## 17.16.0 - 2022-09-04 ### Added * Firefox 117 and Edge 116 in the Docker container. From a0962f0c95ba0ab2d1713f172b7496d742c0123a Mon Sep 17 00:00:00 2001 From: soulgalore Date: Wed, 11 Oct 2023 14:37:38 +0200 Subject: [PATCH 2/6] 17.17.0 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index f24874c424..290d800221 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "browsertime", - "version": "17.16.0", + "version": "17.17.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "browsertime", - "version": "17.16.0", + "version": "17.17.0", "license": "MIT", "dependencies": { "@cypress/xvfb": "1.2.4", diff --git a/package.json b/package.json index 05642293bf..555aeed1ee 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "browsertime", "description": "Get performance metrics from your web page using Browsertime.", - "version": "17.16.0", + "version": "17.17.0", "bin": "./bin/browsertime.js", "type": "module", "dependencies": { From 99c1c3b0ad6e4a9e700d5908c1b04a563e5a34f6 Mon Sep 17 00:00:00 2001 From: soulgalore Date: Wed, 11 Oct 2023 14:39:11 +0200 Subject: [PATCH 3/6] Add missing selenium upgrade --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 47d706c47a..35430f2baf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ * Firefox 118, Edge 117 and Chrome/Chromedriver 118 in the Docker container [#1996](https://github.com/sitespeedio/browsertime/pull/1996). * Expose trace start/stop for Chrome in scripting (the same way as for Firefox). Thank you [KS](https://github.com/92kns) for [#1988](https://github.com/sitespeedio/browsertime/pull/1988). Documentation is coming when the functionality is rolled out in sitespeed.io. +### Updated +* Updated to Selenium 4.12 + ## 17.16.0 - 2022-09-04 ### Added * Firefox 117 and Edge 116 in the Docker container. From e3e5a46f6c9070c0ab66e543b85e60d021edc848 Mon Sep 17 00:00:00 2001 From: Peter Hedenskog Date: Thu, 12 Oct 2023 16:32:55 +0200 Subject: [PATCH 4/6] Collect number of assets served from browser cache (#1998) --- browserscripts/pageinfo/resources.js | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/browserscripts/pageinfo/resources.js b/browserscripts/pageinfo/resources.js index f495b7fe48..195b33f3ae 100644 --- a/browserscripts/pageinfo/resources.js +++ b/browserscripts/pageinfo/resources.js @@ -1,14 +1,27 @@ -(function() { +(function () { const resources = window.performance.getEntriesByType('resource'); let resourceDuration = 0; + let servedFromCache = 0; + let servedFromCacheSupported = false; for (let i = 0; i < resources.length; i++) { resourceDuration += resources[i].duration; + if (resources[i].deliveryType !== undefined) { + servedFromCacheSupported = true; + if (resources[i].deliveryType === 'cache') { + servedFromCache++; + } + } } - return { + const info = { count: Number(resources.length), - duration: Number(resourceDuration) + duration: Number(resourceDuration), + }; + + if (servedFromCacheSupported === true) { + info.servedFromCache = Number(servedFromCache); } -})(); + return info; +})(); \ No newline at end of file From 1b6d75acf72dfd90165248a0bebebe6cedc45e34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Naz=C4=B1m=20Can=20Alt=C4=B1nova?= Date: Fri, 13 Oct 2023 15:31:58 +0200 Subject: [PATCH 5/6] Get the url from the `result` array in GeckoProfiler.stop (#1999) Previously for gecko profiler commands we were getting the test url by running a script that returns `document.documentURI`. This was working fine for most cases. But when one of our tests actually navigates to a different page from the starting page, it gets the destination url instead of the initial url. Since we need the initial url, it's better not to get the url like this, and get it directly from the `result` array. Note that chrome trace command does something similar [here](https://github.com/sitespeedio/browsertime/blob/e3e5a46f6c9070c0ab66e543b85e60d021edc848/lib/core/engine/command/chromeTrace.js#L42). --- lib/core/engine/command/geckoProfiler.js | 9 +++------ lib/core/engine/iteration.js | 3 ++- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/core/engine/command/geckoProfiler.js b/lib/core/engine/command/geckoProfiler.js index 79eba9b64b..b10ad03e12 100644 --- a/lib/core/engine/command/geckoProfiler.js +++ b/lib/core/engine/command/geckoProfiler.js @@ -1,11 +1,12 @@ import intel from 'intel'; const log = intel.getLogger('browsertime.command.geckoprofiler'); export class GeckoProfiler { - constructor(GeckoProfiler, browser, index, options) { + constructor(GeckoProfiler, browser, index, options, result) { this.GeckoProfiler = GeckoProfiler; this.browser = browser; this.index = index; this.options = options; + this.result = result; } async start() { @@ -25,11 +26,7 @@ export class GeckoProfiler { async stop() { if (this.options.browser === 'firefox') { if (this.options.firefox.geckoProfilerRecordingType === 'custom') { - const url = await this.browser - .getDriver() - .executeScript('return document.documentURI;'); - - return this.GeckoProfiler.stop(this.index, url); + return this.GeckoProfiler.stop(this.index, this.result[0].url); } } else { throw new Error('Geckoprofiler only works in Firefox'); diff --git a/lib/core/engine/iteration.js b/lib/core/engine/iteration.js index 72dc50222d..6aed77ad79 100644 --- a/lib/core/engine/iteration.js +++ b/lib/core/engine/iteration.js @@ -159,7 +159,8 @@ export class Iteration { browserProfiler, browser, index, - this.options + this.options, + result ); const cdp = new ChromeDevelopmentToolsProtocol( engineDelegate, From 315974141eb4beab73e8a03cdf94b11e8ae2d226 Mon Sep 17 00:00:00 2001 From: Peter Hedenskog Date: Fri, 20 Oct 2023 15:19:26 +0200 Subject: [PATCH 6/6] Chromedriver 119 (#2003) --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 290d800221..9e6a0249f0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@cypress/xvfb": "1.2.4", "@devicefarmer/adbkit": "2.11.3", - "@sitespeed.io/chromedriver": "118.0.5993-70", + "@sitespeed.io/chromedriver": "119.0.6045-21", "@sitespeed.io/edgedriver": "115.0.1901-183", "@sitespeed.io/geckodriver": "0.33.0", "@sitespeed.io/throttle": "5.0.0", @@ -791,9 +791,9 @@ } }, "node_modules/@sitespeed.io/chromedriver": { - "version": "118.0.5993-70", - "resolved": "https://registry.npmjs.org/@sitespeed.io/chromedriver/-/chromedriver-118.0.5993-70.tgz", - "integrity": "sha512-D9lmJRRbed721FlCbKTfZULd7N1pbSCms/ymhbNobteo+SIrNDuiqIKKJLFq4H91LA21nwT+YMDghMiccWbOlw==", + "version": "119.0.6045-21", + "resolved": "https://registry.npmjs.org/@sitespeed.io/chromedriver/-/chromedriver-119.0.6045-21.tgz", + "integrity": "sha512-vYKf9wMxSdqa/nwIKmf3fMMCbVaTn8mgHtmrg1pNPZnaJJtnBZxiPaVeT8Kv+2/jZEmBlGYZmxT3X0qDaw7GnQ==", "hasInstallScript": true, "dependencies": { "node-downloader-helper": "2.1.9", @@ -6678,9 +6678,9 @@ } }, "@sitespeed.io/chromedriver": { - "version": "118.0.5993-70", - "resolved": "https://registry.npmjs.org/@sitespeed.io/chromedriver/-/chromedriver-118.0.5993-70.tgz", - "integrity": "sha512-D9lmJRRbed721FlCbKTfZULd7N1pbSCms/ymhbNobteo+SIrNDuiqIKKJLFq4H91LA21nwT+YMDghMiccWbOlw==", + "version": "119.0.6045-21", + "resolved": "https://registry.npmjs.org/@sitespeed.io/chromedriver/-/chromedriver-119.0.6045-21.tgz", + "integrity": "sha512-vYKf9wMxSdqa/nwIKmf3fMMCbVaTn8mgHtmrg1pNPZnaJJtnBZxiPaVeT8Kv+2/jZEmBlGYZmxT3X0qDaw7GnQ==", "requires": { "node-downloader-helper": "2.1.9", "node-stream-zip": "1.15.0" diff --git a/package.json b/package.json index 555aeed1ee..bf4cda51d0 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "dependencies": { "@cypress/xvfb": "1.2.4", "@devicefarmer/adbkit": "2.11.3", - "@sitespeed.io/chromedriver": "118.0.5993-70", + "@sitespeed.io/chromedriver": "119.0.6045-21", "@sitespeed.io/edgedriver": "115.0.1901-183", "@sitespeed.io/geckodriver": "0.33.0", "@sitespeed.io/throttle": "5.0.0",