w3c / webdriver-bidi

Bidirectional WebDriver protocol for browser automation
https://w3c.github.io/webdriver-bidi/
351 stars 38 forks source link

`BrowsingContext.reload` with `wait=None`: What `NavigateResult` to return? #532

Open thiagowfx opened 11 months ago

thiagowfx commented 11 months ago

This issue is a direct follow-up of: https://github.com/w3c/webdriver-bidi/issues/527.

browsingContext.reload was recently updated to return NavigateResult instead of EmptyResult.

There are two keys: 1) url and 2) navigation.

We need to consider all the following scenarios:

1) Should there be any special treatment for redirects upon reload? (originally brought up by @OrKoN)

2) What url should be set? The method returns without awaiting (unlike wait="interactive" and wait="complete"), therefore it's not possible to know the url at the time of the return. Some options:

3) What navigation should be set? As per the spec, it should be a new ID. But that ID may not be ready at the time of the return.

As per @juliandescottes:

However the HTML spec for navigate does not seem to accept a navigation id as optional parameter for navigate, and instead always generates one at step 6:

Let navigationId be the result of generating a random UUID. [WEBCRYPTO]

Do we need an update in the HTML spec to accept a navigation id from WebDriver ?

thiagowfx commented 11 months ago

cc @Lightning00Blade @whimboo @jgraham (Only CC'ed people previously involved with reload that weren't mentioned in the first comment)