Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypifiedElement implementing WebElement? #120

Closed
ham1 opened this issue Jun 4, 2016 · 1 comment
Closed

TypifiedElement implementing WebElement? #120

ham1 opened this issue Jun 4, 2016 · 1 comment

Comments

@ham1
Copy link
Contributor

ham1 commented Jun 4, 2016

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?

@ham1
Copy link
Contributor Author

ham1 commented Jun 4, 2016

I've created a PR which solved the visibilityOf(checkBox) problem from an interface point of view.

However Lists 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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant