So one possibility is to use Selenium2TestCase as your base class for you test...
I've been using Selenium Standalone Server 3.3 (looks like 3.4 just released)
http://www.seleniumhq.org/download/
So its a little different that SeleniumTestCase, because Selenium 2 uses the WebDriver, and support for firefox may require you install the third party gecko drivers, there's a chrome driver there too that works really well.
So I have a test class that extends Selenium2TestCase , and added this helper function:
/**
* Utility function to wait for an element to be displayed
*
* @param $elementCssPath
* @param $timeout
* @return \PHPUnit_Extensions_Selenium2TestCase_Element
* @throws Exception
*/
public function findElementWaitUntilDisplay($elementCssPath, $timeout){
$this->waitUntil(function() use($elementCssPath){
if ($element = $this->byCssSelector($elementCssPath)) {
if($element->displayed()) {
return true;
}
else {
return null;
}
}
return null;
}, $timeout);
try{
$element = $this->byCssSelector($elementCssPath);
return $element;
}
catch(Exception $e){
throw $e;
}
}
So then you may have a test use it like so:
testStatusMessageDisplayed() {
$status_message_element = $this->findElementWaitUntilDisplay('whatever-your-css-selector-is', 5000); //wait 5s for status message to appear
$this->assertEquals('expected text', $status_message_element->text());
}
This helper function has been coming in handy, whether I am waiting for a page to load, or an ajax request, or some javascript rewrite the dom.