-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Add JSON serialization for ShadowRoot #13680
Add JSON serialization for ShadowRoot #13680
Conversation
PR Description updated to latest commit (7bcf22a)
|
PR Review
✨ Review tool usage guide:Overview:
With a configuration file, use the following template:
See the review usage page for a comprehensive guide on using this tool. |
PR Code Suggestions
✨ Improve tool usage guide:Overview:
With a configuration file, use the following template:
See the improve usage page for a more comprehensive guide on using this tool. |
57ef477
to
4d4740a
Compare
@sbabcoc i had a short look, why has the |
@joerg1985 I had to move WebElementToJsonConverter because it needs access to ShadowRoot, which is package private. It's a bit odd that WebElementToJsonConverter was in the "internal" package in the first place, because the companion JsonToWebElementConverter is not - probably because it also requires access to ShadowRoot. |
31de941
to
64c21d0
Compare
81932fd
to
7862009
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## trunk #13680 +/- ##
=======================================
Coverage 58.48% 58.48%
=======================================
Files 86 86
Lines 5270 5270
Branches 220 220
=======================================
Hits 3082 3082
Misses 1968 1968
Partials 220 220 ☔ View full report in Codecov by Sentry. |
e748f40
to
421154c
Compare
java/src/org/openqa/selenium/remote/internal/WebElementToJsonConverter.java
Outdated
Show resolved
Hide resolved
5ef6dc6
to
5e03d14
Compare
c0b3c38
to
61df1d4
Compare
61df1d4
to
6866131
Compare
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.
Thank you, @sbabcoc!
@sbabcoc was there an issue attached to this PR? |
@diemol I haven't written one up. The issue is clearly an inconsistency in the handling of ShadowDom contexts, though, and the failure occurs in 100% of cases. |
Not needed, I just thought I missed it. |
User description
Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.
Currently, attempts to specify ShadowRoot objects as arguments for JavaScript fragments via the
executeScript()
function fail with this exception:Examination of the
apply()
function confirms that no support is provided for ShadowRoot.Description
This PR adds support for specifying ShadowRoot objects as script arguments in
executeScript()
calls.Motivation and Context
It's currently impossible to provide a ShadowRoot search context as an argument to a JavaScript fragment.
Types of changes
Checklist
Type
bug_fix, enhancement
Description
ShadowRoot
objects in Selenium, allowing them to be used as arguments inexecuteScript()
calls.WebElementToJsonConverter
class to handle JSON serialization ofRemoteWebElement
andShadowRoot
.WebElementToJsonConverter
class and updated references across the project to use the new class.WebElementToJsonConverter
usage.Changes walkthrough
RemoteWebDriver.java
Remove Deprecated Import in RemoteWebDriver
java/src/org/openqa/selenium/remote/RemoteWebDriver.java
WebElementToJsonConverter
fromorg.openqa.selenium.remote.internal
.W3CHttpCommandCodec.java
Update Import to New WebElementToJsonConverter
java/src/org/openqa/selenium/remote/codec/w3c/W3CHttpCommandCodec.java
WebElementToJsonConverter
fromorg.openqa.selenium.remote
.WebElementToJsonConverter.java
Add JSON Serialization Support for ShadowRoot
java/src/org/openqa/selenium/remote/WebElementToJsonConverter.java
WebElementToJsonConverter
class supporting JSONserialization for
RemoteWebElement
andShadowRoot
.collections, maps, and specifically
ShadowRoot
.WebElementToJsonConverter.java
Deprecate Old WebElementToJsonConverter
java/src/org/openqa/selenium/remote/internal/WebElementToJsonConverter.java
WebElementToJsonConverter
class.WebElementToJsonConverter
location.WebElementToJsonConverterTest.java
Update Tests for New WebElementToJsonConverter
java/test/org/openqa/selenium/remote/internal/WebElementToJsonConverterTest.java
WebElementToJsonConverter
.UsingPageFactoryTest.java
Update PageFactory Test Imports
java/test/org/openqa/selenium/support/pagefactory/UsingPageFactoryTest.java
WebElementToJsonConverter
.