Implement Shadow DOM support for actions
Categories
(Remote Protocol :: Marionette, task, P3)
Tracking
(Not tracked)
People
(Reporter: sefeng, Unassigned)
References
(Blocks 1 open bug)
Details
Doing an action like actions.pointerMove(1, 1, { origin: ShadowDOMElement })
would make the origin becomes <HTML>
. The cause is that we don't have Shadow DOM support for actions.
Recently we have the Shadow DOM spec added, so we should have it implemented! :)
Updated•4 years ago
|
Comment 1•4 years ago
|
||
Basic support for Shadow DOM will be implemented via bug 1686182. Once done we can see how it works for actions.
Comment 2•4 years ago
|
||
Lets wait until the basic commands have been implemented, and which is tracked via bug 1686180.
Comment 3•2 years ago
|
||
(In reply to Sean Feng [:sefeng] from comment #0)
Doing an action like
actions.pointerMove(1, 1, { origin: ShadowDOMElement })
would make the origin becomes<HTML>
. The cause is that we don't have Shadow DOM support for actions.
I just investigated remaining work that we have to do for ShadowDOM support in Marionette. And this bug is a bit unclear to me. What exactly are you trying to pass-in as origin? Should that be a ShadowRoot
or an Element
within a Shadow DOM? I assume it will be the latter? In such a case our actions implementation in Marionette works as is with these elements. Here a Marionette testcase:
def test_shadow_dom(self):
page = inline("""
<custom-input-element id="input"></custom-input-element>
<script>
customElements.define('custom-input-element',
class extends HTMLElement {
constructor() {
super();
this.attachShadow({mode: 'open'}).innerHTML = `
<div><input type="text"/></div>
`;
}
});
</script>""")
self.marionette.navigate(page)
container = self.marionette.find_element(By.ID, "input")
shadow = container.shadow_root
input = self.marionette.execute_script("""
const shadow_root = arguments[0];
const elem = shadow_root.querySelector("input");
return elem
""", script_args=(shadow,))
input.click()
sequence = ActionSequence(self.marionette, "key", "3")
sequence.key_down("a") \
.key_up("a") \
.perform()
self.assertEqual(input.get_property("value"), "a")
The only thing that is needed for the Marionette client specifically is bug 1806640. But I'm also not sure which client you were actually using here.
Sean, maybe you could give us some details in case you can still remember? Thanks a lot.
Reporter | ||
Comment 4•2 years ago
|
||
I honestly can't remember the detail...
I think we can just close this bug and I can reopen if I encounter this again in the future.
Comment 5•2 years ago
|
||
Sounds good. Note that in the next 3 months we will focus on getting proper Shadow DOM support into Marionette and WebDriver BiDi. So if something comes up during that time feel free to contact us as well on Element in the #webdriver channel.
Updated•2 years ago
|
Description
•