-
-
Notifications
You must be signed in to change notification settings - Fork 426
Elements shifted off the page with negative locations are considered visible #951
Comments
Here's what we currently do for a click test: https://github.com/thoughtbot/capybara-webkit/blob/master/src/WebPage.cpp#L286 We could additionally check to see that the coordinates we're trying to click are on the screen (or can be scrolled to). |
We also check that the node is visible in this code: capybara-webkit/src/capybara.js Lines 251 to 260 in 464da69
Capybara.clickPosition .
|
@jferris Yes - it currently errors correctly if one tries to click the element - the issue (if there is an issue) is that if #visible? is called on the element it returns true. I'm not sure whether or not that should be the case since the user can't usually scroll to negative positions to see the element. |
Note: this only came up because of the :allow_label_click option for checkboxes/radio buttons in Capybara 2.8+ which capybara-webkit doesn't yet support, and I'm working around it for a 2.9.1 release, but it would be nice to have a consensus on what the result of #visible? should be for these elements. |
@mhoran if we used |
Yeah, I think so. Though something may be visible, but underneath another element, in which case |
Hmm, actually, that's interesting: if something is obscured behind a modal dialog or something, is it visible? |
I believe selenium considers something visible if the user can scroll it into a position where it can be seen, so behind a modal could still be considered visible, of course that may be changing as selenium moves towards only supporting browsers through vendor provided drivers, and the webdriver spec solidifies. |
@jferris I was also thinking something along the lines of an overlaying semi-transparent (or completely transparent div), that allows the underling content to be visible, but not clickable. |
When using capybara-webkit (and poltergeist)
is considered a visible element, although it cannot be seen or interacted with (clicked, etc). Current selenium-webdriver (2.53.4) reports it as non-visible, although the 3.0.0.beta3.1 version reports it as visible but throws an ElementNotVisible error if you try to click it. Not really sure what the current outcome here is, although I lean towards that it should be non-visible.
The text was updated successfully, but these errors were encountered: