Skip to content

Commit

Permalink
Update to Browsertime 17.18.0 (#3988)
Browse files Browse the repository at this point in the history
  • Loading branch information
soulgalore authored Oct 23, 2023
1 parent b40007d commit 371c32a
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 25 deletions.
2 changes: 1 addition & 1 deletion docs/_includes/version/browsertime.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
17.17.0
17.18.0
2 changes: 2 additions & 0 deletions docs/documentation/browsertime/configuration/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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"]
Expand Down
16 changes: 8 additions & 8 deletions docs/documentation/sitespeed.io/developers/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -115,7 +115,7 @@ async function run() {
}
}

run();
await run();
~~~

## Developing sitespeed.io
Expand Down
30 changes: 15 additions & 15 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 371c32a

Please sign in to comment.