giorgiosironi / phpunit-selenium

Selenium RC integration for PHPUnit
http://www.phpunit.de/
Other
600 stars 271 forks source link

markTestSkipped() & markTestIncomplete() #127

Open er2es opened 12 years ago

er2es commented 12 years ago

This functions not working properly......in some cases the return values ​​are incorrect.

if i use the capture screenshot function, then come this error


  protected $captureScreenshotOnFailure = TRUE;
  protected $screenshotPath = 'path/to/dir';
  protected $screenshotUrl = 'path/to/dir';

PHPUnit returns an Error (E), instead of being skipped (S) or Incomplemented (I) test marking, but if i give any error messages, eg.: markTestIncomplete ("Incomplete message"), it appears when returns E

_(PHPUnit 3.6.10 & PHPUnitSelenium 1.2.6 & PHP 5.4.1)

#Incomplete test case message# printed with $this->markTestIncomplete("#Incomplete test case message#");


PHPUnit 3.6.10 by Sebastian Bergmann.

Starting test 'CentralAdmin::testLogin_ with data set #0 ('szabo.jozsef@****.com', '*****')'.
.
Starting test 'CentralAdmin::testSellerSettings_ with data set #0 ('szabo.jozsef@****.com', ''*****')'.
E
Starting test 'CentralAdmin::testWeeklyChanges_ with data set #0 ('szabo.jozsef@****.com', '*****')'.
.
Starting test 'CentralAdmin::testCleanConfigCache_'.
.

Time: 42 seconds, Memory: 4.25Mb

There was 1 error:

1) CentralAdmin::testSellerSettings_ with data set #0 ('szabo.jozsef@*****.com', '******')
Current URL: http://*******.com/admin/SellerSettings
Screenshot: /home/szaboj/*****/UnitTest/*******/screenShots/65af1278282d2205490ff36339887008.png

#Incomplete test case message#
giorgiosironi commented 12 years ago

This is a recurring problem with screenshots: to include the screenshot path in the exception, we have to throw a new one, which is generically chosen as an error. If you want to propose a fix, the problem is in SeleniumTestCase::onNotSuccessfulTest().