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
5ef6dc6 to
5e03d14
Compare
c0b3c38 to
61df1d4
Compare
61df1d4 to
6866131
Compare
|
@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
ShadowRootobjects in Selenium, allowing them to be used as arguments inexecuteScript()calls.WebElementToJsonConverterclass to handle JSON serialization ofRemoteWebElementandShadowRoot.WebElementToJsonConverterclass and updated references across the project to use the new class.WebElementToJsonConverterusage.Changes walkthrough
RemoteWebDriver.java
Remove Deprecated Import in RemoteWebDriverjava/src/org/openqa/selenium/remote/RemoteWebDriver.java
WebElementToJsonConverterfromorg.openqa.selenium.remote.internal.W3CHttpCommandCodec.java
Update Import to New WebElementToJsonConverterjava/src/org/openqa/selenium/remote/codec/w3c/W3CHttpCommandCodec.java
WebElementToJsonConverterfromorg.openqa.selenium.remote.WebElementToJsonConverter.java
Add JSON Serialization Support for ShadowRootjava/src/org/openqa/selenium/remote/WebElementToJsonConverter.java
WebElementToJsonConverterclass supporting JSONserialization for
RemoteWebElementandShadowRoot.collections, maps, and specifically
ShadowRoot.WebElementToJsonConverter.java
Deprecate Old WebElementToJsonConverterjava/src/org/openqa/selenium/remote/internal/WebElementToJsonConverter.java
WebElementToJsonConverterclass.WebElementToJsonConverterlocation.WebElementToJsonConverterTest.java
Update Tests for New WebElementToJsonConverterjava/test/org/openqa/selenium/remote/internal/WebElementToJsonConverterTest.java
WebElementToJsonConverter.UsingPageFactoryTest.java
Update PageFactory Test Importsjava/test/org/openqa/selenium/support/pagefactory/UsingPageFactoryTest.java
WebElementToJsonConverter.