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

Store the WebDriver error "data" property #48866

Merged

Conversation

gsnedders
Copy link
Member

It's unclear to me why this wasn't here before; it's been in the spec longer than we've stored anything on WebDriverException (specifically w3c/webdriver@33b1404 predates 726d661).

Copy link
Contributor

@whimboo whimboo left a comment

Choose a reason for hiding this comment

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

I'm totally up for this but please note that there is as well w3c/webdriver#1615 for discussion. We should get to a consensus first if we want that property or not.

tools/webdriver/webdriver/error.py Show resolved Hide resolved
@gsnedders
Copy link
Member Author

I'm totally up for this but please note that there is as well w3c/webdriver#1615 for discussion. We should get to a consensus first if we want that property or not.

I don't think anyone is suggesting removing it — that issue seems to be about whether "execute script" (and presumably "execute async script") set the data property? It already exists in general for errors.

@@ -213,6 +221,8 @@ def from_response(response):
code = value["error"]
message = value["message"]
stack = value["stacktrace"] or None
# data is optional, and could even be an empty dict
data = value.get("data") or None

cls = get(code)
return cls(response.status, code, message, stacktrace=stack)
Copy link
Contributor

Choose a reason for hiding this comment

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

Without that we won't set the data property:

Suggested change
return cls(response.status, code, message, stacktrace=stack)
return cls(response.status, code, message, stacktrace=stack, data=data)

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed!

tools/webdriver/webdriver/error.py Show resolved Hide resolved
@whimboo
Copy link
Contributor

whimboo commented Dec 2, 2024

@gsnedders do you have an update for this PR?

@whimboo
Copy link
Contributor

whimboo commented Jan 14, 2025

ping @gsnedders

@gsnedders
Copy link
Member Author

ping @gsnedders

I've updated this now!

@whimboo whimboo closed this Jan 14, 2025
@whimboo whimboo reopened this Jan 14, 2025
Copy link
Contributor

@whimboo whimboo left a comment

Choose a reason for hiding this comment

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

LGTM but there is still a broken test. I've retriggered, so lets see if it is passing now.

@gsnedders gsnedders merged commit 06be9fb into web-platform-tests:master Jan 14, 2025
36 checks passed
@gsnedders gsnedders deleted the store-webdrivererror-data branch January 14, 2025 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants