|
IOSMakeAnAppTestable
How to configure your build to enable testing your app with iOS NativeDriver.
Featured Making An iOS App Testable with NativeDriverTo drive your iOS application, you should link NativeDriver library into your application. NativeDriver will listen port 3001 in your application and respond to WebDriver requests. You can make your application testable with following steps. 1. Import iPhoneNativeDriver project into your projectFirst of all, you should import NativeDriver project into your project so that you can set target dependency and linkage settings. 1.1. Open your project in Xcode. Select your project and click "Add Files to ..." in the context menu.
1.2. Select "NativeDriver.xcodeproj" and click "Add" button.
2. Add header search pathWe will call NativeDriver from your main.m to start server. NDNativeDriver.h should be in header search paths. 2.1. Select target in your project. You can create new target to run NativeDriver automation. 2.2. Open "Build Settings" tab for the target. 2.3. Add path to nativedriver/iphone/Classes to "Header Search Paths".
3. Add linker flagsNativeDriver library uses Objective-C categories feature. To prevent linker to removing necessary object, you should add some linker flags. 3.1. Add "-ObjC" and "-all_load" to "Other Linker Flags".
4. Add target dependenciesAdd target dependency so that NativeDriver will be built before building your app. 4.1. Open Build Phases tab.
4.2. Add "NativeDriver" to "Target Dependencies".
5. Add frameworks to link withYou should link NativeDriver and related frameworks into your project. 5.1. Add "libNativeDriver.a", "libCocoaHTTPServer.a", "CFNetwork.framework", and "libstdc++.dylib" to "Link Binary With Libraries".
6. Add codes to start NativeDriverNativeDriver will start with [NativeDriver start] message. You can add this message in main.m. NativeDriver works only in testing purpose. You can define "Preprocessor Macros" in the build settings. 6.1. import "NDNativeDriver.h" and call [NDNativeDriver start]; in main.m.
|
In addition to these steps you also have to define the symbols "NATIVEDRIVER" and "DEBUG" in order to include the
line and inside that .h file DEBUG has to be defined in order to get NDNativeDriver defined.Hi Martin... I am new to native driver...Can you please explain in detail like how i can define "NATIVEDRIVER" and "DEBUG" and where to define.
Under "Preprocesor Macros" in the "Build Settings" for your "Automation" target find Debug and add: NATIVEDRIVER DEBUG