TypifiedElement implementing WebElement?
ham1 opened this issue · 1 comments
Is there a reason that TypifiedElement
doesn't implement WebElement
?
The main reason for asking is to simplify use of ExpectedConditions
, especially when using a list of them e.g. List<CheckBox> checkboxes
.
I'd like to do: wait.until(ExpectedConditions.visibilityOfAllElements(checkboxes))
but because visibilityOfAllElements only accepts List<WebElement>
this doesn't work, equally for visibilityOf
having to add .getWrappedElement()
isn't ideal.
Also, as the PageFactory replaces them with lazy proxies if trying to convert that into a list of WebElements to wait for, I'm not sure the following would work?
checkboxes.stream()
.map(WrappedElement::getWrappedElement)
.collect(toList());
Or is there something I've missed?
I've created a PR which solved the visibilityOf(checkBox)
problem from an interface point of view.
However List
s are more complex. When doing
// wait has timeout of 10s
wait.until(visibilityOfAllElements(checkBoxes.stream()
.map(te -> (WebElement) te)
// same behaviour with
//.map(TypifiedElement::getWrappedElement)
.collect(toList())))
It fails after 5s (the implicit wait as mentioned in #111) - is there a way, without using the @Timeout
everywhere, to utilise the explicit wait for lists?