无论我如何编写 KIFTestScenario 或 KIFTestStep 运行我的 KIF 目标时,它们都会返回以下错误:
12:20:58.434 - Test that a user can successfully dismiss the welcome screens
12:24:53.208 - FAIL (209.11s): Tap screen at point "{10, 10}"
12:24:53.209 - FAILING ERROR: Error Domain=KIFTest Code=0 "Step threw exception:
*** -[__NSArrayM insertObject:atIndex:]:
object cannot be nil" UserInfo=0x842c1e0 {NSLocalizedDescription=Step threw exception: *** -[__NSArrayM insertObject:atIndex:]:
object cannot be nil}
12:24:53.210 - END OF SCENARIO (duration 223.62s)
正如建议的那样,我已经包含了我正在使用的代码:
TestController.m
#import "TestController.h"
#import "KIFTestScenario+Additions.h"
@implementation TestController
- (void)initializeScenarios;
{
[self addScenario:[KIFTestScenario scenarioToLogIn]];
}
@end
KIFTestScenario+Additions.m
#import "KIFTestScenario+Additions.h"
@implementation KIFTestScenario (Additions)
+ (id)scenarioToLogIn
{
KIFTestScenario *scenario = [KIFTestScenario scenarioWithDescription:@"Test that a user can successfully dismiss the welcome screens"];
KIFTestStep *step = [KIFTestStep stepToTapScreenAtPoint:CGPointMake(10.0f, 10.0f)];
[scenario addStep:step];
return scenario;
}
@end
我已经浏览了调试器,我添加到场景中的 KIFTestStep 不是 nil 并且是有效的 KIFTestStep。
有没有人遇到过这个问题或对修复有任何想法?