I'm doing UI testing with XCode7 and need a way to reset my app to some initial state. I have a method to do so in one of my .m files that are part of the main target.
How can I make classes from the main target to be available from within a UITestCase?
I tried regular import, but get a linker error:
#import <XCTest/XCTest.h>
#import "CertificateManager.h"
@interface UITests : XCTestCase
@end
-(void)testWelcomeScreen
{
//put the app into initial state
[[CertificateManager sharedInstance] resetApplication];
//... proceed with test
}
Error:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_CertificateManager", referenced from:
objc-class-ref in UITests.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have compared this to the Unit test target, but cant see differences beyond that the unit test target has "Allow testing host application APIs" checked, while UITest target does not have this option at all.