title: Proper way to wait for a second page to load with Capybara when the first has the same field as the second
body: <p>I'm having a problem with a spec that visits two forms with the same field (&quot;Email&quot;) on both forms. If I don't manually sleep, Capybara seems to be finding the &quot;Email&quot; field from the first visit in the second portion of the test.</p>
  <pre><code># visit the first form and fill out a subscription
  visit new_front_form_subscription_path(@web_form_1.id)
  fill_in &quot;Email&quot;, with: &quot;subscriber@example.com&quot;
  fill_in &quot;Field 1&quot;, with: &quot;my first data&quot;
  click_button &quot;Subscribe&quot;
  
  # visit the second form and fill out a subscription
  visit new_front_form_subscription_path(@web_form_2.id)
  sleep 1
  fill_in &quot;Email&quot;, with: &quot;subscriber@example.com&quot;
  fill_in &quot;Field 2&quot;, with: &quot;my second data&quot;
  click_button &quot;Subscribe&quot;
  </code></pre>
  <p>With the sleep in there, the spec passes with flying colors. Without the sleep, the second form submission gets a validation error -- blaming a blank &quot;Email&quot; value.</p>
  <p>Is there a proper way to handle this? I dislike introducing manual sleeps into the specs.</p>