This topic created in 4285 days ago, the information mentioned may be changed or developed.
目前team的UI test是用的KIF framework,想写以下的一个test不知道可行么
1. select一些tableview cell, swipe delete
2. call view controller, update一些data, 然后reload tableview
3. 继续其它的一些UI test
code大致如下:
-(void)testReloadTableView
{
//step1 UI tests.....
//step2 tests....
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
self.vc = [storyboard instantiateViewControllerWithIdentifier:@"tableviewController"];
[self.vc performSelectorOnMainThread:@selector(loadView) withObject:nil waitUntilDone:YES];
[self.vc addData] //a method to add some data
[self.vc.tableview reloadData];
//go on with step3 tests...
}
1,3都没有问题,现在卡在2,试了下都没有实现想要的效果(比如上面的code只是create了view controller的instance,并不是同在UI里正在run 的view controller)。
请问做过iOS测试的,有没有可能的实现方法? 还是这是一个bad test practise, 违背了test原则。