Created
April 7, 2014 06:32
-
-
Save anonymous/10015665 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Actully I am using php with selenium using PHPUnit_Extensions_Selenium2TestCase class | |
I have PHPUnit_Extensions_Selenium2TestCase that is extending PHPUnit_Framework_TestCase. Now I added function runBare in this class as per below. | |
abstract class PHPUnit_Extensions_Selenium2TestCase extends PHPUnit_Framework_TestCase | |
{ | |
.............................. | |
............................. | |
public function runBare() { | |
$retryCount = 2; | |
for ($i = 0; $i < $retryCount; $i++) { | |
try { | |
parent::runBare(); | |
return; | |
} | |
catch (Exception $e) { | |
// last one thrown below | |
} | |
} | |
if ($e) { | |
throw $e; | |
} | |
} | |
} | |
But this not runs my failed test cases twice. | |
What i am missing here ? | |
Is there any change that i need to do in phpunit test case ? |
This will not work with a failed test case because the failure exits code before returning back to runBare , hence if the test fails you will not be able to rerun the test . Im still looking to see what is the workaround for it. Any chance you figured that out?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't see anything in
Selenium2TestCase
that should block this from working. Your best bet would be to set some breakpoints and debug the test.