title: How to detect element is present within viewport? (Capybara, ruby)
body: <p>I have a step that checks for the footer visibility here</p>
  
  <pre><code>And (/^the footer appears$/) do
     within("div.footer") do
        assert_selector "a", :text=&gt; "About"
        ...
     end
  end
  </code></pre>
  
  <p>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.</p>
  
  <p>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?</p>