Skip to content
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

fix waitForElement not waiting enough #7

Merged
merged 8 commits into from
Aug 23, 2024

Conversation

vbfox
Copy link
Collaborator

@vbfox vbfox commented Aug 22, 2024

The code for waitForElement was depending on deprecated server behaviour (Responding with a 200 OK and an empty element when a search failed) and didn't work correctly against a conforming server failing with 404 "no such element".

Fix the code and add tests around this function.

The code for waitForElement was depending on depreacted server behaviour
(Responding with a 200 OK and an empty element when a search failed) and
didn't work correctly against a conforming server failing with 404 "no
such element".

Fix the code and add tests around this function.
Copy link

@VincentJaouen VincentJaouen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@edelans
Copy link

edelans commented Aug 22, 2024

@vbfox how is this deployed? do you have to manually push the new package to npm when you merge or is it done automatically ?

@vbfox
Copy link
Collaborator Author

vbfox commented Aug 22, 2024

I'll need to bump the version, and publish it to npm once it's merged

When an error of type 'no such element' is detected WebDriverIO has a
special handling for it and returns the error object instead of the
element reference.

With this fix we should handle both cases where this detection has
worked and cases where it hasn't but the W3C error is still 'no such
element'.
@vbfox
Copy link
Collaborator Author

vbfox commented Aug 22, 2024

Turns out that there are multiple way a findElement call can end when no element is found, the changes in 2de01aa now take into account all possibilities.

Some elements disappear briefly during animations, or the element that
was matched at the start disappear to be replaced by another that
happens to have the same text.
The resulting stability will be better and the API is supported contrary
to getElementLocation.
@vbfox vbfox merged commit f32646a into main Aug 23, 2024
6 checks passed
@vbfox vbfox deleted the vbfox/waitForElement_wait_enough branch August 23, 2024 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants