2013-06-10 9 views

답변

0

당신은, phpunit을가 --repeat 옵션이 있습니다, 정말 테스트가 처음으로 실패 이유를 찾을 필요가 있지만, 첫째 ... 당신이 기술적으로 가능하다 다음 테스트를 실행 phpunit을를 사용하는

를 추정

또는 둘째로 ... 테스트 케이스에

, 당신은 사용할 수 있습니다 -> onNotSuccessfulTest()를 호출하기 -> runBare()이 같은 테스트, 뭔가 다시 실행합니다 :

class yourTestCase extends \PHPUnit_Extensions_Selenium2TestCase 
{ 
    // ... 

    static public $retryCount = 0; 

    public function onNotSuccessfulTest(\Exception $e) 
    { 

     // Rethrow tests which failed due to being marked as skipped or incomplete 
     if ($e instanceof /* Put skipped or Incomplete classes here */) { 
      throw $e; 
     } 

     if (self::$retryCount < 3) { 
      self::$retryCount++; 
      return $this->runBare(); 
     } else { 
      self::$retryCount = 0; 
      throw $e; 
     } 
    } 
    //... 
} 

다시 한 번, 테스트가 실패한 이유를 조사하고 싶지만 요청한 것은 가능합니다!