diff --git a/docs/_includes/version/browsertime.txt b/docs/_includes/version/browsertime.txt index 4b233ffefa..b4f54fd6cd 100644 --- a/docs/_includes/version/browsertime.txt +++ b/docs/_includes/version/browsertime.txt @@ -1 +1 @@ -17.17.0 \ No newline at end of file +17.18.0 \ No newline at end of file diff --git a/docs/documentation/browsertime/configuration/config.md b/docs/documentation/browsertime/configuration/config.md index 3ccf8aa57c..acf94661fc 100644 --- a/docs/documentation/browsertime/configuration/config.md +++ b/docs/documentation/browsertime/configuration/config.md @@ -5,6 +5,7 @@ timeouts --timeouts.pageLoad Timeout when waiting for url to load, in milliseconds [number] [default: 300000] --timeouts.script Timeout when running browser scripts, in milliseconds [number] [default: 120000] --timeouts.pageCompleteCheck, --maxLoadTime Timeout when waiting for page to complete loading, in milliseconds [number] [default: 120000] + --timeouts.networkIdle Timeout when running pageCompleteCheckNetworkIdle, in milliseconds [number] [default: 5000] chrome --chrome.args Extra command line arguments to pass to the Chrome process (e.g. --no-sandbox). To add multiple arguments to Chrome, repeat --chrome.args once per argument. @@ -167,6 +168,7 @@ Options: --pageCompleteCheck Supply a JavaScript (inline or JavaScript file) that decides when the browser is finished loading the page and can start to collect metrics. The JavaScript snippet is repeatedly queried to see if page has completed loading (indicated by the script returning true). Use it to fetch timings happening after the loadEventEnd. By default the tests ends 2 seconds after loadEventEnd. Also checkout --pageCompleteCheckInactivity and --pageCompleteCheckPollTimeout --pageCompleteWaitTime How long time you want to wait for your pageComplteteCheck to finish, after it is signaled to closed. Extra parameter passed on to your pageCompleteCheck. [default: 8000] --pageCompleteCheckInactivity Alternative way to choose when to end your test. This will wait for 2 seconds of inactivity that happens after loadEventEnd. [boolean] [default: false] + --pageCompleteCheckNetworkIdle Alternative way to choose when to end your test that works in Chrome and Firefox. Uses CDP or WebDriver Bidi to look at network traffic instead of running JavaScript in the browser to know when to end the test. By default this will wait 5 seconds of inactivity in the network log (no requets/responses in 5 seconds). Use --timeouts.networkIdle to change the 5 seconds. The test will end after 2 minutes if there is still activity on the network. You can change that timout using --timeouts.pageCompleteCheck [boolean] [default: false] --pageCompleteCheckPollTimeout The time in ms to wait for running the page complete check the next time. [number] [default: 1500] --pageCompleteCheckStartWait The time in ms to wait for running the page complete check for the first time. Use this when you have a pageLoadStrategy set to none [number] [default: 5000] --pageLoadStrategy Set the strategy to waiting for document readiness after a navigation event. After the strategy is ready, your pageCompleteCheck will start runninhg. [string] [choices: "eager", "none", "normal"] [default: "none"] diff --git a/docs/documentation/sitespeed.io/developers/index.md b/docs/documentation/sitespeed.io/developers/index.md index 09b2916959..67d3ad2351 100644 --- a/docs/documentation/sitespeed.io/developers/index.md +++ b/docs/documentation/sitespeed.io/developers/index.md @@ -90,23 +90,23 @@ run(); In this example you run Browsertime directly from NodeJS, using the default JavaScripts to collect metrics. ~~~javascript -'use strict'; - -const browsertime = require('browsertime'); +import { BrowsertimeEngine, browserScripts } from 'browsertime'; // The setup is the same configuration as you use in the CLI const browsertimeSetupOptions = { iterations: 1, browser: 'chrome' }; -const engine = new browsertime.Engine(browsertimeSetupOptions); +const engine = new BrowsertimeEngine(browsertimeSetupOptions); // You can choose what JavaScript to run, in this example we use the default categories // and the default JavaScript -const scriptsCategories = await browsertime.browserScripts.allScriptCategories; -const scripts = await browsertime.browserScripts.getScriptsForCategories(scriptsCategories); +const scriptCategories = await browserScripts.allScriptCategories(); +let scriptsByCategory = await browserScripts.getScriptsForCategories( + scriptCategories +); async function run() { try { await engine.start(); // Get the result - const result = await engine.run('https://www.sitespeed.io/', scripts); + const result = await engine.run('https://www.sitespeed.io/', scriptsByCategory); console.log(result); } catch (e) { console.error(e); @@ -115,7 +115,7 @@ async function run() { } } -run(); +await run(); ~~~ ## Developing sitespeed.io diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 996e25d100..48dbaee33e 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -15,7 +15,7 @@ "@tgwf/co2": "0.13.6", "aws-sdk": "2.1327.0", "axe-core": "4.8.2", - "browsertime": "17.17.0", + "browsertime": "17.18.0", "cli-color": "2.0.3", "coach-core": "8.0.2", "concurrent-queue": "7.0.2", @@ -989,9 +989,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", @@ -1870,13 +1870,13 @@ } }, "node_modules/browsertime": { - "version": "17.17.0", - "resolved": "https://registry.npmjs.org/browsertime/-/browsertime-17.17.0.tgz", - "integrity": "sha512-miOqwezzxPHX3PnWko5Gw4LvI5k4ZxynlaemtteCOtDt/GimvO6/uLRm4cz73Cd5urruLMwPQOTVbVA+uFuHYw==", + "version": "17.18.0", + "resolved": "https://registry.npmjs.org/browsertime/-/browsertime-17.18.0.tgz", + "integrity": "sha512-cpivsTrTPMw71zqBSXI3SuI7wEv3jDLezNUQarLZbb94YDQDS7FCZwLVEm87L1CvnqcUtvWdcmlZ4A+1TPxI4w==", "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", @@ -10189,9 +10189,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" @@ -10852,13 +10852,13 @@ } }, "browsertime": { - "version": "17.17.0", - "resolved": "https://registry.npmjs.org/browsertime/-/browsertime-17.17.0.tgz", - "integrity": "sha512-miOqwezzxPHX3PnWko5Gw4LvI5k4ZxynlaemtteCOtDt/GimvO6/uLRm4cz73Cd5urruLMwPQOTVbVA+uFuHYw==", + "version": "17.18.0", + "resolved": "https://registry.npmjs.org/browsertime/-/browsertime-17.18.0.tgz", + "integrity": "sha512-cpivsTrTPMw71zqBSXI3SuI7wEv3jDLezNUQarLZbb94YDQDS7FCZwLVEm87L1CvnqcUtvWdcmlZ4A+1TPxI4w==", "requires": { "@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", diff --git a/package.json b/package.json index e436207061..cfea2113fd 100644 --- a/package.json +++ b/package.json @@ -83,7 +83,7 @@ "@tgwf/co2": "0.13.6", "aws-sdk": "2.1327.0", "axe-core": "4.8.2", - "browsertime": "17.17.0", + "browsertime": "17.18.0", "coach-core": "8.0.2", "cli-color": "2.0.3", "concurrent-queue": "7.0.2",