From f3809e2b0d7ac7b2b29f73ad6fd72bc9df2ba3dd Mon Sep 17 00:00:00 2001 From: Peter Hedenskog Date: Mon, 18 Dec 2023 23:23:35 +0100 Subject: [PATCH] Group page load cli (#2035) --- lib/support/cli.js | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/lib/support/cli.js b/lib/support/cli.js index 49385da1e2..5f63dc1254 100644 --- a/lib/support/cli.js +++ b/lib/support/cli.js @@ -905,43 +905,50 @@ export function parseCommandLine() { }) .option('pageCompleteCheck', { describe: - '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' + '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', + group: 'PageLoad' }) .option('pageCompleteWaitTime', { describe: '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 + default: 8000, + group: 'PageLoad' }) .option('pageCompleteCheckInactivity', { describe: 'Alternative way to choose when to end your test. This will wait for 2 seconds of inactivity that happens after loadEventEnd.', type: 'boolean', - default: false + default: false, + group: 'PageLoad' }) .option('pageCompleteCheckNetworkIdle', { describe: '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 ', type: 'boolean', - default: false + default: false, + group: 'PageLoad' }) .option('pageCompleteCheckPollTimeout', { type: 'number', default: 1500, describe: - 'The time in ms to wait for running the page complete check the next time.' + 'The time in ms to wait for running the page complete check the next time.', + group: 'PageLoad' }) .option('pageCompleteCheckStartWait', { type: 'number', default: 5000, describe: - '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' + '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', + group: 'PageLoad' }) .option('pageLoadStrategy', { type: 'string', default: 'none', choices: ['eager', 'none', 'normal'], describe: - 'Set the strategy to waiting for document readiness after a navigation event. After the strategy is ready, your pageCompleteCheck will start runninhg.' + 'Set the strategy to waiting for document readiness after a navigation event. After the strategy is ready, your pageCompleteCheck will start running.', + group: 'PageLoad' }) .option('iterations', { alias: 'n', @@ -965,13 +972,15 @@ export function parseCommandLine() { type: 'number', default: 0, describe: - 'Extra time added for the browser to settle before starting to test a URL. This delay happens after the browser was opened and before the navigation to the URL' + 'Extra time added for the browser to settle before starting to test a URL. This delay happens after the browser was opened and before the navigation to the URL', + group: 'PageLoad' }) .option('webdriverPageload', { type: 'boolean', describe: 'Use webdriver.get to initialize the page load instead of window.location.', - default: false + default: false, + group: 'PageLoad' }) .option('proxy.pac', { type: 'string', @@ -1106,7 +1115,8 @@ export function parseCommandLine() { describe: 'Use internal browser functionality to clear browser cache between runs instead of only using Selenium.', type: 'boolean', - default: false + default: false, + group: 'PageLoad' }) .option('basicAuth', { describe: @@ -1233,7 +1243,8 @@ export function parseCommandLine() { type: 'boolean', default: false, describe: - 'Flush DNS between runs, works on Mac OS and Linux. Your user needs sudo rights to be able to flush the DNS.' + 'Flush DNS between runs, works on Mac OS and Linux. Your user needs sudo rights to be able to flush the DNS.', + group: 'PageLoad' }) .option('extension', { describe: @@ -1243,7 +1254,8 @@ export function parseCommandLine() { describe: 'Convenient parameter to use if you test a SPA application: will automatically wait for X seconds after last network activity and use hash in file names. Read more: https://www.sitespeed.io/documentation/sitespeed.io/spa/', type: 'boolean', - default: false + default: false, + group: 'PageLoad' }) .option('cjs', { describe: @@ -1255,7 +1267,8 @@ export function parseCommandLine() { type: 'number', default: 3, describe: - 'If the browser fails to start, you can retry to start it this amount of times.' + 'If the browser fails to start, you can retry to start it this amount of times.', + group: 'PageLoad' }) .option('preWarmServer', { type: 'boolean',