sebastianbergmann/phpunit-selenium — Issue #75: SeleniumTestCase serverRunning breaks the use of setHost etc.
Author: mstolt
Created: 2011-11-17 10:55:39+00:00
State: open

Hello,
the new "skip test if SeleniumServer is down" Feature breaks the use of setHost. In the documentation http://www.phpunit.de/manual/current/en/selenium.html you use setBrowser and setBrowserUrl in the setUp method. If one follows that pattern and uses setHost and setPort as well in the setUp methods to point to a different host than localhost the tests will be skipped, because of the "to early detection" of serverRunning in the getDriver method of the SeleniumTestCase. In that early point of time the setHost has not yet happend, so the detection code (line 604 to 608) will try to check against localhost and not the host configured with setHost() in the setUp method. In our case that will fail on the continuous build machine (Unix) which uses another machine for the selenium server (Windows).

The quick and dirty solution is to deactivate the detection code (commenting out line 604 to 608 and the use of the result 630 to 638.

The better solution is to move the detection into the Driver and do the detection just before 630. One can cache the detection result in the Driver class and mark it as dirty on setPort or setHost calls in the Driver class.

Thanks anyway for the great tool.