【发布时间】:2014-12-20 15:27:32
【问题描述】:
我有一种情况,我想等待视图出现,但如果它没有出现,我只想记录它,而不会出现 KIF 超时并引发异常。我尝试使用@try/@catch 块,但它似乎没有抓住它。研究表明这可能是 KIF 的一个限制,但只是想验证一下。我不想只针对这种情况修改failWithException,因为每隔一段时间我都希望测试失败。
我尝试过的示例:
@try {
[tester waitForViewWithAccessibilityLabel:@"Foo"];
}
@catch (NSException *exception) {
[TestLogger logTestMethodFailed:[NSString stringWithFormat:@"%@ on %@", self.currentTest, [[UIDevice currentDevice] name]] withExceptionMessage:@"LOGOUT FAILED! Didn't find 'foo' element. This may be acceptable if the test does not need to log out."];
}
【问题讨论】:
标签: kif-framework kif