-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a ChromoteSession$nagivate()
method?
#177
Comments
I think this would be very helpful! FWIW, if the page is making API calls, |
Great point @jonthegeek. I like what pupeteer does in taking a predefined lifecycle event. In R would be a
I also really like the
|
Oooh, I like waitForNetworkIdle()! I think for my specific use case I also want to wait for responses to sent events (with a timeout), but I think mixing in network idle would help deal with part of my "but is that everything?" problem. |
Oh, ha, I just saw |
Good to know! I hadn't included |
Yeah, definitely! I'd have to understand how it works a little better; what I do right now is log responses until a certain time has passed (simulating I very much doubt that my use case will fall neatly onto the standard path, but having the helpers would definitely make my code feel less hacky! |
As described in the README under Loading a page reliably, one cannot use the following pattern to reliably wait for the page to load.
Instead, we suggest an synchronous or asynchronous approach that involves correctly threading the
$Page$loadEventFired()
and$Page$navigate()
commands.In practice, however, most people just
sys.sleep()
for some reasonable or acceptable amount of time (#176).Considering that we have a few convenience methods already, e.g.
ChromoteSession$screenshot()
, I'd like to propose that we offer a similar convenience method,ChromoteSession$navigate()
, that automatically waits for the page load event and awaits the value (wait_ = TRUE
) or returns the promise (wait_ = FALSE
).In the base case, that would simplify the above example code to just these two lines:
The text was updated successfully, but these errors were encountered: