sebastianbergmann/phpunit-selenium — Issue #84: Tests have incorrect status.
Author: emaks
Created: 2012-01-24 11:33:52+00:00
State: open

Example:
class statusTest extends PHPUnit_Extensions_SeleniumTestCase
{

protected function setUp()
{
$this->setBrowser("*chrome");
$this->setBrowserUrl("http://www.google.com");
}

/**
* @test
*/
public function successStatus()
{
$this->open('/');
$this->assertSame('Google', $this->getTitle());
}

/**
* wrong locator for command 'type'
* @test
*/
public function errorStatus()
{
$this->open('/');
$this->type("id='wrong_id'", 'Search');
}

/**
* incorrect expected title
* @test
*/
public function failStatus()
{
$this->open('/');
$this->assertSame('page title', $this->getTitle());
}

}

Result:

For PHPUnit-3.6.9 and PHPUnit_Selenium-1.2.1

PHPUnit 3.6.9 by Sebastian Bergmann.

..E

Time: 01:50, Memory: 6.50Mb

There was 1 error:

1) statusTest::failStatus
Current URL: http://www.google.com.ua/

--- Expected
+++ Actual
@@ @@
-page title
+Google

...\php\php5.3.8\phpunit:46

FAILURES!
Tests: 3, Assertions: 2, Errors: 1.

For PHPUnit-3.5.15 and PHPUnit_Selenium-1.0.3

PHPUnit 3.5.15 by Sebastian Bergmann.

.EF

Time: 01:10, Memory: 7.00Mb

There was 1 error:

1) statusTest::errorStatus
PHPUnit_Framework_Exception: Response from Selenium RC server for testComplete().
ERROR: Element id='wrong_id' not found.

...\PhpProject1\test\statusTest.php:28
...\PhpProject1\test\statusTest.php:28
...php\php5.3.8\phpunit:46

--

There was 1 failure:

1) statusTest::failStatus
Current URL: http://www.google.com.ua/

--- Expected
+++ Actual
@@ @@
-page title
+Google

...\PhpProject1\test\statusTest.php:38
..\php\php5.3.8\phpunit:46

FAILURES!
Tests: 3, Assertions: 2, Failures: 1, Errors: 1.

also, error trace for PHPUnit_Selenium-1.2.1 is not full