Get Element Property should JSON serialise its response value
Categories
(Remote Protocol :: Marionette, enhancement, P3)
Tracking
(Not tracked)
People
(Reporter: surkov, Assigned: whimboo)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 3 obsolete files)
all find_element strategies don't work on shadow DOM, marionette had some initial shadowDOM support [1] in design but it seems not implemented [2]. It appears current way to deal with shadow DOM testing is executing a script [3]. So it might be a good working alternative to extend find_element to specify a property to call.
[1] https://searchfox.org/mozilla-central/source/testing/marionette/element.js#279
[2] https://searchfox.org/mozilla-central/source/testing/marionette/driver.js#2009
[3] https://searchfox.org/mozilla-central/source/testing/marionette/harness/marionette_harness/tests/unit/test_shadow_dom.py
Reporter | ||
Comment 1•6 years ago
|
||
Reporter | ||
Comment 2•6 years ago
|
||
Updated•6 years ago
|
Comment 3•6 years ago
|
||
I looked into why evaluate.toJSON(els[name], seenEls)
in listener.js
didn’t work as asurkov reported in
https://phabricator.services.mozilla.com/D27918#816998, and my
suspicion was correct, that Get Element Property fails to operate
on the document as mutated by Execute Script. I’ve filed
https://bugzilla.mozilla.org/show_bug.cgi?id=1546319 to write some
more detailed tests for this.
Comment 4•6 years ago
|
||
A WPT tests that exemplifies the issue:
def test_element(session):
session.url = inline("""
<p>foo
<p>bar
<script>
const [foo, bar] = document.querySelectorAll("p");
foo.bar = bar;
</script>
""")
[foo, bar] = session.find.css("p")
response = get_element_property(session, foo.id, "bar")
value = assert_success(response)
assert_same_element(session, value, bar)
Here we would expect the returned value to be a web element equal to bar
.
Comment 5•6 years ago
|
||
hide |
Nothing remarkable in this patch.
Comment 6•6 years ago
|
||
hide |
There are approximately zero coverage for properties modified or set
by web content and through script evaluation. The only succcess
path test for Get Element Property is test_element, but it checks
an attribute already present in the prototype of the HTMLInputElement.
This patch adds tests where the property is defined through web
content. This uncovers a defect in Firefox, where Get Element
Property seemingly operates on the initial value of the attribute.
Updated•6 years ago
|
Updated•6 years ago
|
Comment 7•6 years ago
|
||
Comment 8•2 years ago
|
||
The following patch is waiting for review from an inactive reviewer:
ID | Title | Author | Reviewer Status |
---|---|---|---|
D27918 | Bug 1544906 - marionette get_property fails to return a DOM node | surkov | ato: Resigned from review |
:surkov, could you please find another reviewer or abandon the patch if it is no longer relevant?
For more information, please visit auto_nag documentation.
Assignee | ||
Comment 9•2 years ago
|
||
This is basically the same as bug 1398792. We will have to waive XRays to actually access the property which exists in the scope of the page.
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Description
•