How to test for the visibility of text in Capybara based on whether it has overflowed

76 Views Asked by At

I am using Zurb Foundation and want to make a Cucumber/Capybara/Poltergeist test that the menu toggle works on mobile (it just broke and needed an undocumented fix). The technique Foundation uses is to alter the height of the vertical div with the menu in it so that the lower items are hidden. As they are still visible in CSS, all of the normal helpers like be_visible don't work and always return true. How can I test whether some text is in a div's overflow area or not?

0

There are 0 best solutions below