All of the view elements in the xib
will be available after the view is loaded. The issue is that you are never actually causing the view to be loaded.
You should call viewController.view
, which will cause the view to be loaded and all of the outlets to be connected up.
UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
ViewController *vc = (ViewController *)[sb instantiateViewControllerWithIdentifier:@"ViewController"];
__unused UIView *view = _vc.view; // cause the view to be loaded
XCTAssertNotNil(_vc.emailField, @"email field is nil!");