I'm writing Cocos2d application and looking for a way to write functional tests.
What I really need, is to launch application on the simulator and check that my scene contains specific nodes. Something like this
@implementation MenuTest
- (void) setUp
{
// Launch app on the simulator
}
- (void) tearDown
{
// Shut simulator down
}
- (void) testMenuContainsExitItem
{
CCScene *scene = [[CCDirector sharedDirector] runningScene];
CCNode *exit = [scene getChildByTag:EXIT_ITEM];
STAssertNotNil(exit, @"No exit item found");
}
@end
So, is there a way to execute tests on a running app?