-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
webdriver: Enable implicit wait on error #40836
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
Conversation
a2ee51f to
8f0e926
Compare
Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
8f0e926 to
a594322
Compare
85e0d06 to
4a1ac11
Compare
|
I did it here. |
Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
|
🤖 Opened new upstream WPT pull request (web-platform-tests/wpt#56292) with upstreamable changes. |
f522bec to
8b780e4
Compare
|
✍ Updated existing upstream WPT pull request (web-platform-tests/wpt#56292) title and body. |
|
📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#56292). |
Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
|
📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#56292). |
|
✍ Updated existing upstream WPT pull request (web-platform-tests/wpt#56292) title and body. |
|
We can also add tests for plural command (Elements) if really want.. But I'm exhausted. |
|
Ugh. The GitHub UI jumped around and now I accidentally clicked update... |
|
📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#56292). |
Somehow upstream export got closed after it. I will repush this. Thanks for the review! |
bd8420b to
416bccc
Compare
|
🤖 Opened new upstream WPT pull request (web-platform-tests/wpt#56324) with upstreamable changes. |
| }, 300); | ||
| </script> | ||
| """) | ||
| session.timeouts.implicit = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI. The timeout should be reset to its default value at the end of the test. I'm going to do that once the patch landed in our Firefox repository. I've filed https://bugzilla.mozilla.org/show_bug.cgi?id=2002826 for it.
For the future feel free to ask for review for tests as well. I'm happy to give feedback for changes or additions to webdriver tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for reaching out!
But it seems the harness already automatically reset timeout everytime, when starting a new subtest? Is this really necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| _current_session.timeouts.implicit = IMPLICIT_WAIT_TIMEOUT * multiplier |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also see other tests that sets the implicit wait, without resetting them.
servo/tests/wpt/tests/webdriver/tests/classic/switch_to_frame/switch.py
Lines 111 to 112 in 4f02ee5
| def test_find_element_while_frame_is_still_loading(session, url): | |
| session.timeouts.implicit = 5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only end and start a new session when the capabilities have changed. So normally it won't happen for all the tests that are part of a file. Thanks for finding this additional test. I'll take a look for that as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And following two.
servo/tests/wpt/tests/webdriver/tests/classic/get_timeouts/get.py
Lines 26 to 29 in b00a764
| def test_get_new_timeouts(session): | |
| session.timeouts.script = 60 | |
| session.timeouts.implicit = 1 | |
| session.timeouts.page_load = 200 |
servo/tests/wpt/tests/webdriver/tests/classic/set_timeouts/set.py
Lines 81 to 82 in b00a764
| def test_set_all_fields(session): | |
| timeouts = {"implicit": 10, "pageLoad": 20, "script": 30} |
... and reduce code duplication in element retrieval. Note that we are not using the functionality of "wait on error" yet.
Testing: We added WPT tests for "Find element", "Find element from element", "Find element from shadow root" for both successful implicit wait and timeout case.