unic / ScalaWebTest

ScalaWebTest is a library for writing ScalaTest/Selenium based integration tests for web applications. It helps you with your basic setup and provides a new and very efficient approach to testing.
https://scalawebtest.org
Apache License 2.0
29 stars 9 forks source link

Implement currentPage.findFittingElement #107

Closed DaniRey closed 4 years ago

DaniRey commented 4 years ago

findFittingElement would work similar to currentPage.fits, but if succesfull it would return the element, so that it can then be used to interact with, i.e. click on it.

DaniRey commented 4 years ago

This cannot be implemented anymore. To make ScalaWebTest compatible with all implementations of Selenium WebDriver (#74), we had to switch to using JSoup to analyze the source, because the Selenium API doesn't expose the order of elements.

Therefore a Fit now contains a Node from the JSoup source. This source is detached from the pageContent of the browser.It is not possible to find the same node in the pageContent, following the rules from ScalaWebTest (i.e. order of element matters, but is not exposed). Also it is impossible to add a marker on that element, as the JSoup Tree and the currentPage are not connected in anyway.