natritmeyer/site_prism — pull request #18 by nestd (2013-03-10 13:37:21+00:00)
Title: 2 fixes regarding waiters for an element to become invisible

Hello,

I am working on a project where I have a lot of JavaScript and a lot of interactions with DOM. While writing tests I've encountered a few issues:

1) SitePrism raises SitePrism::TimeOutWaitingForElementInvisibility if wait for an element which doesn't exist on the page. It happens, because Capybara tries to find an element before checking its visibility. Eventually, Capybara is stuck while waiting for an nonexistent element therefore a timeout error occurs. If there is no element, then there is nothing to wait for.

2) Ruby raises NoMethodError if a section where an element is embedded into is removed. I guess this fix makes sense, because if a parent section is removed, then an element becomes invisible. This fix has helped me a lot. I have a very deep tree of sections/elements, therefore, it is not easy to observe all changes in DOM.