Commit Graph

8 Commits

Author SHA1 Message Date
Euclid Ye
34c644d5b8 webdriver: Wait indefinitely with None timeout (#42184)
So far for `None`
[timeout](https://w3c.github.io/webdriver/#dfn-timeouts-configuration),
we've treated it effectively as no wait which is wrong:
https://github.com/web-platform-tests/wpt/pull/57332#issuecomment-3804242966.

This PR makes all `None` timeouts wait indefinitely. The funny part is,
we somehow have only done it correctly for `pageload`:
https://w3c.github.io/webdriver/#dfn-timeouts-configuration

Testing: We add test for script execution with `None` script timeout.

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2026-01-30 09:54:07 +00:00
Euclid Ye
0022d971d0 webdriver: Fix outdated timeouts test and remove redundant check (#41631)
Initially the attempt is to validate params according to spec. But it
turns out validation is already done at [webdriver
crate](https://hg-edge.mozilla.org/mozilla-central/file/tip/testing/webdriver/src/capabilities.rs#l368)
so I reverted the change.

But Chrome/Firefox are not compliant with spec:
https://wpt.fyi/results/webdriver/tests/classic/new_session/timeouts.py?label=experimental&label=master&aligned.
They only allow `script timeouts` to be `None` but not `pageLoad` and
`implicit`, which is how the test is currently written.

Testing: Updated the test to be compliant with spec. New failures are
because it is validated at [webdriver
crate](https://hg-edge.mozilla.org/mozilla-central/file/tip/testing/webdriver/src/capabilities.rs#l377).

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2026-01-05 11:49:39 +00:00
Martin Robinson
9aa86938a7 webdriver: Add a 10 second timeout for screenshots (#40290)
This change adds a 10 second timeout for screenshots. Without this
timeout, tests that fail take a screenshot in a reasonable amount of
time cause the the WebDriver driver to kill the process leading to a
CRASH test result. This causes the results to differ and to obscure what
is really a TIMEOUT.

This behavior is unspecified, but it's still an improvement, as it
properly classifies failures when the WPT is run with WebDriver.

Testing: This causes some WPT tests run with WebDriver to have
their expected result.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-10-30 16:50:49 +00:00
Euclid Ye
6247060ad6 webdriver: Reduce visibilty of some structures and functions (#39825)
Work on some chore before further improving script execution.

Testing: No behaviour change.

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-10-13 10:35:43 +00:00
Martin Robinson
4b990c1dcc webdriver: Apply script timeout to related IPC messaging as well (#39682)
In some cases scripts never call their `setTimeout` guard. In that case
also
timeout if we never hear a reply from the script thread. In general, the
script timeout is applied to all synchronous IPC waiting for script
replies.

In addition, rework timeout setting a bit to be more similar to the
specifciation.

Testing: This causes some tests run with the WebDriver test runner to
fail with
TIMEOUT rather than CRASH, accurately reflecting their reason for
failing.

---------

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
Co-authored-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-10-06 15:25:23 +00:00
Euclid Ye
cd4a72379b webdriver: Implement implicit wait for "Element retrieval" (#39620)
Implicit wait is specified in [WebDriver
spec](https://w3c.github.io/webdriver/#dfn-find), which is used to keep
retrieving elements until found or timeout. This is really convenient
for automation with real websites.

Testing: Manually tested with
[Selenium](https://www.selenium.dev/documentation/webdriver/waits/#implicit-waits).

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2025-10-06 13:29:14 +00:00
batu_hoang
929fd0aa3c webdriver: improve session commands (#38397)
Add timeout and strictFileInteractability capabilities to response of
new session command.
Allow delete session command to run without a session.

Testing: Clear some unexpected results of session tests in webdriver CI
and
`tests/wpt/meta/webdriver/tests/classic/delete_session/delete.py.ini`

---------

Signed-off-by: batu_hoang <hoang.binh.trong@huawei.com>
Signed-off-by: batu_hoang <longvatrong111@gmail.com>
2025-08-01 06:39:03 +00:00
batu_hoang
f5ee72f89a Rework webdriver session (#38225)
Reimplement webdriver session for better match to spec:

- Add `create_session`:
[spec](https://www.w3.org/TR/webdriver2/#dfn-create-a-session)
- Refactor `handle_new_session`
- Replace `PageLoadStrategy` string by enum

---------

Signed-off-by: batu_hoang <hoang.binh.trong@huawei.com>
2025-07-28 10:14:14 +00:00