galenframework / galen

Layout and functional testing framework for websites
http://galenframework.com
1.41k stars 161 forks source link

Generating Galen @objects with Javascript #632

Open riffdr opened 4 years ago

riffdr commented 4 years ago

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 `

shadow-root (open)

      <div>Some text</div>

`

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.