title: Behat + selenium 2 wait for page to load
body: <p>Is there a way to reliably wait for pages to load when using Behat with Mink using the Selenium2Driver?</p>
  
  <p>I've inherited some legacy tests that wait like this:</p>
  
  <pre><code>Background:
    Given I am on "http://test.example.com"
    And I wait for "20000"
    Given I click on the element with css selector ".button1"
    And I wait for "30000"
    Given I click on the element with css selector ".button2"
    And I wait for "30000"
    Given I click on the element with css selector ".button1"
    And I wait for "10000"
  </code></pre>
  
  <p>i.e. just this single test takes 1minute 30seconds.</p>
  
  <p>What I'd like to do is have a generic way of waiting for the previous click to result in a page load, without having to wait a large fixed amount of time each time.</p>
  
  <p>All of the suggestions I can see for waiting for page load, all refer to checking that a particular page element is loaded.</p>
  
  <p>However these tests run against a variety of legacy websites, where there isn't always a standard element that can be checked to be present, so I'm hoping to use a more generic method.</p>