I have a step that checks for the footer visibility here
And (/^the footer appears$/) do
within("div.footer") do
assert_selector "a", :text=> "About"
...
end
end
Basically I load the page and scroll to the bottom then do this check, but I also noticed that this steps works without me having to scroll to the bottom. I did some testing and found out this step only checks for visibility on the entire page. It doesn't check for visibility within the viewport.
I want to have a check that passes only when the element is within the viewport. Is this possible without Rspec and just capybara/ruby/js alone?