galenframework/galen

Generating Galen @objects with Javascript

riffdr opened this issue · 0 comments

My Team and I are working with Web Components and trying to think of a plausible way of testing them when they feature Shadow root. Since in Selenium the only way to do this is by generating Galen objects out of a JS selector (i.e: document.querySelector('a-web-component').shadowRoot.querySelector('div')) ,maybe there is a way we can inject js to generate the Galen object, being this the ideal scenario:

HTML
<a-web-component> #shadow-root (open) <div>Some text</div> </a-web-component>

GALEN.GSPEC
@objects web-component js document.querySelector('a-web-component').shadowRoot.querySelector('div')

Since this is not available now... is there any way of pushing elements into the @object Map by using a JS selector or through script injection?

Thank you in advance.