Skip to content

Commit

Permalink
Group page load cli (#2035)
Browse files Browse the repository at this point in the history
  • Loading branch information
soulgalore authored Dec 18, 2023
1 parent 0067956 commit f3809e2
Showing 1 changed file with 26 additions and 13 deletions.
39 changes: 26 additions & 13 deletions lib/support/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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',
Expand Down

0 comments on commit f3809e2

Please sign in to comment.