question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Replace findInShadowRoot() calls with TestBench Element Queries

See original GitHub issue

Flow’s own implementation in TestBenchHelpers for finding elements inside shadow dom does not work for polyfilled browsers, because of https://github.com/SeleniumHQ/selenium/issues/5470

With TestBench 6 queries we don’t need that helper method anymore, as the queries also find elements inside shadow dom:

LabelElement labelInShadow = $(DivElement.class)
        .id("element-with-shadow").$(LabelElement.class)
        .id("label-in-shadow");

and it should avoid the issue with polyfills (need to check if it fixes some IE11 tests)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
denis-anisimovcommented, Jun 18, 2018

Splited out:

getInShadowRoot():

java/com/vaadin/flow/uitest/ui/template/RouterLinksIT.java com/vaadin/flow/uitest/ui/template/collections/ClearListIT.java java/com/vaadin/flow/uitest/ui/template/collections/ListBindingIT.java com/vaadin/flow/uitest/ui/template/collections/ListInsideListBindingIT.java com/vaadin/flow/uitest/ui/template/imports/LazyWidgetIT.java java/com/vaadin/flow/uitest/ui/template/UpgradeElementIT.java com/vaadin/flow/uitest/ui/template/UpdatableModelPropertiesIT.java com/vaadin/flow/uitest/ui/template/TwoWayPolymerBindingIT.java com/vaadin/flow/uitest/ui/template/TemplatesVisibilityIT.java com/vaadin/flow/uitest/ui/template/TemplateInTemplateWithIdIT.java com/vaadin/flow/uitest/ui/template/TemplateInTemplateIT.java vaadin/flow/uitest/ui/template/TemplateHasInjectedSubTemplateIT.java java/com/vaadin/flow/uitest/ui/template/SubPropertyModelIT.java com/vaadin/flow/uitest/ui/template/RestoreViewWithAttachedByIdIT.java com/vaadin/flow/uitest/ui/template/PropertiesUpdatedBeforeChangeEventsIT.java com/vaadin/flow/uitest/ui/template/PolymerPropertyMutationInObserverIT.java com/vaadin/flow/uitest/ui/template/PolymerPropertyChangeEventIT.java com/vaadin/flow/uitest/ui/template/PolymerPropertiesIT.java com/vaadin/flow/uitest/ui/template/PolymerModelPropertiesIT.java com/vaadin/flow/uitest/ui/template/PolymerDefaultPropertyValueIT.java

findInShadowRoot():

com.vaadin.flow.uitest.ui.frontend.FrontendProtocolIT com/vaadin/flow/uitest/ui/template/collections/TwoWayListBindingIT.java com/vaadin/flow/uitest/ui/template/collections/ModelListIT.java com/vaadin/flow/uitest/ui/template/collections/ListInsideListBindingIT.java com/vaadin/flow/uitest/ui/template/collections/ListBindingIT.java com/vaadin/flow/uitest/ui/template/collections/ClearListIT.java com/vaadin/flow/uitest/ui/template/TemplateWithConnectedCallbacksIT.java com/vaadin/flow/uitest/ui/template/TemplateMappingDetectorIT.java com/vaadin/flow/uitest/ui/template/InjectScriptTagIT.java com/vaadin/flow/uitest/ui/template/ClearNodeChildrenIT.java com/vaadin/flow/uitest/ui/template/ChildOrderIT.java com/vaadin/flow/uitest/ui/template/BeanInListingIT.java com/vaadin/flow/uitest/ui/template/BasicTypeInListIT.java

Those can be taken by someone else.

0reactions
ZheSun88commented, Jun 18, 2018
Read more comments on GitHub >

github_iconTop Results From Across the Web

Querying Elements | Creating Tests | TestBench | Vaadin 7 Docs
The query returns a list of HTML elements of all the Button components in the UI. Every Vaadin component has its corresponding element...
Read more >
java - How to wait for an element to appear or disappear using ...
first().click();. My question is how to wait until 'OpenProcessedDocument' button is displayed using vaadin testbench element query API.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found