Closed Bug 2008345 Opened 4 months ago Closed 3 months ago

Allow configuration of "implicit" and "pageLoad" timeouts to accept "null" values

Categories

(Remote Protocol :: Agent, defect, P3)

Firefox 147
defect
Points:
3

Tracking

(firefox149 fixed)

RESOLVED FIXED
149 Branch
Tracking Status
firefox149 --- fixed

People

(Reporter: yezhizhenjiakang, Assigned: whimboo, Mentored)

References

(Blocks 1 open bug)

Details

(Whiteboard: [webdriver:m19], [wptsync upstream][webdriver:relnote])

Attachments

(5 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:147.0) Gecko/20100101 Firefox/147.0

Steps to reproduce:

I ran wpt tests and look at the code base.

Actual results:

https://hg-edge.mozilla.org/mozilla-central/file/tip/testing/webdriver/src/capabilities.rs#l377

We currently only allow script timeout to be None.

Expected results:

Spec allows implicit wait timeout and page load timeout to be None:
https://w3c.github.io/webdriver/#dfn-deserialize-as-timeouts-configuration

cc @whimbo

This should be very easy to fix by: x @ "script" | x @ "pageLoad" | x @ "implicit" if value.is_null() => {}
https://hg-edge.mozilla.org/mozilla-central/file/tip/testing/webdriver/src/capabilities.rs#l377

I don't have proper environment to do this tho.

See WPT updates:
https://github.com/web-platform-tests/wpt/pull/56959

The Bugbug bot thinks this bug should belong to the 'Core::DOM: Core & HTML' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → DOM: Core & HTML
Product: Firefox → Core

Thank you for letting us know. Interesting that this hasn't been noticed yet. It would be good to wait until the upstream PR has merged and downstream synced via bug 2008343.

Status: UNCONFIRMED → NEW
Component: DOM: Core & HTML → Agent
Depends on: 2008343
Ever confirmed: true
Product: Core → Remote Protocol
Summary: webdriver: Allow implicit wait timeout and page load timeout to be None → Allow configuration of "implicit" and "pageLoad" timeouts to accept "null" values
Component: Agent → geckodriver
Product: Remote Protocol → Testing
Duplicate of this bug: 2008539
Mentor: hskupin
Priority: -- → P3
Whiteboard: [lang=js]

I tried that little fix but it turned out that the tests are still not working as expected. Fixing those turned out issues with the webdriver client as well when using the Set Timeout command. As such I put together a patch including the fixes and adding more tests to ensure that null actually doesn't break any other command (navigate, refresh, back, forward, and all the variants of find element(s)) as well.

Here a try build: https://treeherder.mozilla.org/jobs?repo=try&landoCommitID=172018

We probably need to change following struct as well:

https://hg-edge.mozilla.org/mozilla-central/file/tip/testing/webdriver/src/response.rs#l103

They should all be Option<u64>.

Also following to Option<Option<u64>>:
https://hg-edge.mozilla.org/mozilla-central/file/tip/testing/webdriver/src/command.rs#l772

I'm not familiar with the interface here. How can I see your @whimbo proposed PR?

In my last try build there was still a bug in our wait for navigation completed logic where we tried to use a TimedPromise even when the pageLoad timeout is set to null. Here a new try build with the fix:

https://treeherder.mozilla.org/jobs?repo=try&landoCommitID=172034

(In reply to Euclid Ye from comment #8)

I'm not familiar with the interface here. How can I see your @whimbo proposed PR?

Open that try URL and on the left side you can see the individual commits that I pushed. It's covering Marionette, Remote Agent, geckodriver, webdriver, wpt's webdriver client and wdspec tests.

Assignee: nobody → hskupin
Status: NEW → ASSIGNED
Component: geckodriver → Agent
Product: Testing → Remote Protocol
Points: --- → 3
Whiteboard: [lang=js] → [webdriver:m19]
Pushed by hskupin@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/6c232d4bd431 https://hg.mozilla.org/integration/autoland/rev/41a0e5b4cf8d [remote] Allow "null" for "implicit" and "pageLoad" timeouts. r=jdescottes https://github.com/mozilla-firefox/firefox/commit/43e61790716f https://hg.mozilla.org/integration/autoland/rev/d9b4b9a79e8e [marionette] Don't use TimedPromise if pageload timeout is "null". r=jdescottes https://github.com/mozilla-firefox/firefox/commit/3c8816932cb0 https://hg.mozilla.org/integration/autoland/rev/5c847856a5ef [geckodriver] Allow "null" for "implicit" and "pageLoad" timeouts. r=geckodriver-reviewers,jdescottes,jgraham https://github.com/mozilla-firefox/firefox/commit/77e77081f54b https://hg.mozilla.org/integration/autoland/rev/a8f759981834 [webdriver-client] Support "null" value when setting timeouts. r=jdescottes https://github.com/mozilla-firefox/firefox/commit/c85534cff4bd https://hg.mozilla.org/integration/autoland/rev/a98e106b55b0 [wdspec] Improve tests when "implicit" and "pageLoad" timeouts are set to "null". r=jdescottes
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/57151 for changes under testing/web-platform/tests
Whiteboard: [webdriver:m19] → [webdriver:m19], [wptsync upstream]
Pushed by agoloman@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/f6a8991120af https://hg.mozilla.org/integration/autoland/rev/fdb7dd7448fc Revert "Bug 2008345 - [wdspec] Improve tests when "implicit" and "pageLoad" timeouts are set to "null". r=jdescottes" for causing build bustages @rust.mk.

Backed out for causing build bustages @rust.mk.

Flags: needinfo?(hskupin)

There are additional tests under testing/geckodriver/marioneette which were not executed when I run the tests locally with cargo test under testing/geckodriver. :( It's annoying that you have to be in each crate's folder. I fixed those tests and to be fully sure now I have pushed to try:

https://treeherder.mozilla.org/jobs?repo=try&revision=87208943144aaee2b249d53bdd1d491ecb3d982c

If it's all fine I'll reland the patches.

Flags: needinfo?(hskupin)
Pushed by hskupin@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/2119d14e6a1e https://hg.mozilla.org/integration/autoland/rev/6e5cba21e444 [remote] Allow "null" for "implicit" and "pageLoad" timeouts. r=jdescottes https://github.com/mozilla-firefox/firefox/commit/f34cfc5f6729 https://hg.mozilla.org/integration/autoland/rev/009c9e0c717b [marionette] Don't use TimedPromise if pageload timeout is "null". r=jdescottes https://github.com/mozilla-firefox/firefox/commit/511b64fa8fc6 https://hg.mozilla.org/integration/autoland/rev/e27a9a0758d6 [geckodriver] Allow "null" for "implicit" and "pageLoad" timeouts. r=geckodriver-reviewers,jdescottes,jgraham https://github.com/mozilla-firefox/firefox/commit/61ad2a2ac48c https://hg.mozilla.org/integration/autoland/rev/8e1f4ed0592e [webdriver-client] Support "null" value when setting timeouts. r=jdescottes https://github.com/mozilla-firefox/firefox/commit/1e0b69eb6b19 https://hg.mozilla.org/integration/autoland/rev/ebfab89fc1d5 [wdspec] Improve tests when "implicit" and "pageLoad" timeouts are set to "null". r=jdescottes
Upstream PR merged by moz-wptsync-bot
Blocks: 1938333
Severity: -- → S3
Blocks: 2003125
Blocks: 2011157
Whiteboard: [webdriver:m19], [wptsync upstream] → [webdriver:m19], [wptsync upstream][webdriver:relnote]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: