您可能知道,KIF测试可能不稳定。我尝试重新运行KIF测试,如果它失败了。不确定这是否是最佳路由,但我重写KIF failWithExceptions方法循环三次,并在第4次调用failWithException的超级并停止测试。我无法弄清楚如何再次启动测试。
这就是我现在所拥有的。下一步是testCase和testName,然后调用该测试。有什么想法吗?
由于
- (void)failWithException:(NSException *)exception stopTest:(BOOL)stop
{
NSLog(@"Test Failed, running again");
int testCount = 0;
for(int i = 1;i <= 3; i++)
{
[self afterEach]; //call the afterEach method to get test in known state
//this is where I want to re-run the test, maybe [XCtest ....] or
testCount += 1;
}
if(testCount==3)
{
[super failWithException:exception stopTest:stop];
}
}