I've set up selenium, PHPUnit and xvfb on my ubuntu server. This is my TestCase:
class WebTest extends PHPUnit_Extensions_SeleniumTestCase {
public static $browsers = array(
array(
'name' => 'Firefox on Linux',
'browser' => '*firefox',
),
array(
'name' => 'Chrome',
'browser' => '*chrome',
),
);
protected function setUp() {
$this->setBrowserUrl("http://www.whatismybrowser.com/");
}
public function testTitle() {
$this->open("/");
try {
$this->assertTrue((bool) preg_match('/^Firefox[\s\S]*$/', $this->getText("css=div.detected.simple-browser-string")));
} catch (PHPUnit_Framework_AssertionFailedError $e) {
array_push($this->verificationErrors, $e->toString());
}
}
This test calls http://www.whatismybrowser.com/ and should fail if http://www.whatismybrowser.com/ determines anything besides a firefox browser. However it passes two times. In spite of 'browser' => '*chrome', firefox is always used.
Do you have any ideas how to change this behavior?