testbench
testbench copied to clipboard
Safari 10: query search fails for elements in shadow root
Browser: Safari 10 I'm running tests via saucelabs.
Here is the test example: https://github.com/vaadin/platform/pull/479/files#diff-4efa8534f61bb6a93aa509df91600022R70
I'm trying to access the element with button
id within shadow root of a ButtonElement
:
ButtonElement button = $(ButtonElement.class).first();
TestBenchElement htmlButton = button.$(TestBenchElement.class)
.id("button");
This code throws.
Apparently test bench is not able to create an instance of the TestBenchElement
element which is the counterpart of the client side element.
The search on the client side works as expected. So getCommandExecutor().executeScript("arguments[0].shadowRoot.querySelector('#button').innerHTML")
works fine.
But if I call getCommandExecutor().executeScript("return arguments[0].shadowRoot.querySelector("#button");");
then it throws.