Closed jordan-angold-sophos closed 8 months ago
Hi @jordan-angold-sophos maybe that isn't implemented when you run your own script (only if you feen in URLs). In your case it seems simple workaround for now would be to add a wait before you run your page complete check.
I'm not sure I understand your comment. There is currently no way to configure commands.wait.byPageToComplete()
to wait for less than 5 seconds before first trying a page-complete check. But there are plenty of cases where an SPA will respond much faster than 5 seconds.
This makes it impossible to write a script for an SPA that waits for the page to be complete at each step before proceeding to the next without adding a minimum of 5s per step.
The workaround you suggest increases the amount of unnecessary waiting, which makes the problem worse.
Ah so you don't want to wait any time at all? I think it depends on how you define when your page has finished loading, can you share a concrete example so I can see how it works?
I can't share the whole concrete example, but the example script I gave should show the problem pretty clearly. Every time you call await commands.wait.byPageToComplete()
, the script will pause for a minimum of 5 seconds, even if the page is already completely loaded and no background activity is occurring.
Ideally, await commands.wait.byPageToComplete()
would terminate instantly if the page is already complete, but I can understand that being difficult or impossible to achieve. So I was hoping to set a lower initial delay and re-test delay (say 100ms for each) so that a sequence of short-lived actions could be reasonably accurately measured.
@soulgalore I would like to provide PRs for this issue and #1983 , but when I push, I get ERROR: Permission to sitespeedio/browsertime.git denied to jordan-angold-sophos
. Is this a repository setting you can change, or am I doing something wrong?
Hi @jordan-angold-sophos you need to:
GitHub has documentation here.
Nothing more happened here so closing.
Have you read the documentation?
URL
https://sitespeed.io
What are you trying to accomplish
I'm trying to use the
--pageCompleteCheckStartWait
parameter to control the delay before the first check of the page-complete condition (in an SPA).Browsertime ignores this setting, probably because https://github.com/sitespeedio/browsertime/blob/main/lib/core/seleniumRunner.js#L134 refers incorrectly to
this.options.beforePageCompleteWaitTime
, which isn't actually an option and is therefore always undefined and therefore replaced with the default of 5000ms.What browser did you use?
Chrome
How to reproduce
Log output