Is there a way to reliably wait for pages to load when using Behat with Mink using the Selenium2Driver?
I've inherited some legacy tests that wait like this:
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"
i.e. just this single test takes 1minute 30seconds.
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.
All of the suggestions I can see for waiting for page load, all refer to checking that a particular page element is loaded.
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.