Actions for KIF's System Test Actor to assist in functionally testing UIViewControllers.

KIFViewControllerActions is a small library of actions for KIF that provide support for functionally testing UIViewController objects. It is implemented as a category on the KIFSystemTestActor class.

These actions are designed to promote isolation between tests and enable the testing of view controllers that are not yet wired into the user interface. They are primarily of interest to those who use a test-driven development process and utilize KIF as a development tool rather than exclusively as an acceptance testing tool.

API Summary

There are only a handful of properties and methods in the library. Each action instantiates and presents a view controller by replacing the rootViewController on the keyWindow of the [UIApplication sharedApplication] shared instance. Support is provided for programmatic and Storyboard based view controllers.

  1. - (void)presentViewControllerWithClass:(Class)viewControllerClass withinNavigationControllerWithNavigationBarClass:(Class)navigationBarClass toolbarClass:(Class)toolbarClass configurationBlock:(void (^)(id viewController))configurationBlock - Instantiates and presents an instance of the specified UIViewController subclass within a UINavigationController instance with the specified UINavigationBar and UIToolbar subclasses, optionally yielding the instantiated controller to the block for configuration.
  2. - (void)presentViewControllerWithIdentifier:(NSString *)controllerIdentifier fromStoryboardWithName:(NSString *)storyboardName configurationBlock:(void (^)(UIViewController *viewController))configurationBlock - Instantiates and presents a view controller from the Storyboard with the given name, optionally yielding the instantiated controller to the block for configuration.
  3. - (void)presentModalViewControllerWithIdentifier:(NSString *)controllerIdentifier fromStoryboardWithName:(NSString *)storyboardName configurationBlock:(void (^)(UIViewController *viewController))configurationBlock - Instantiates and modally presents a view controller from the Storyboard with the given name, optionally yielding the instantiated controller to the block for configuration.
  4. defaultNavigationBarClass - Specifies a UINavigationBar subclass to be used when instantiating view controllers.
  5. defaultToolbarClass - Specifies a UIToolbar subclass to be used when instantiating view controllers.

Contact

Blake Watters

License

KIFViewControllerActions is available under the Apache 2 License. See the LICENSE file for more info.