In order to perform tests on your native, UIKit-based application, first download Test Studio for iOS on your device from the App Store. The next steps involve configuring the application to support being tested by Test Studio.
- Using Finder, browse to the folder containing Test Studio iOS.
- In the TestStudioExtension\iOS folder, you will see static libraries named libTestStudioCommon.a and libTestStudioExtension.a. Note the location of these files for an upcoming step.
- Load a UIKit-based iOS project in Xcode. This guide uses the open source application Wikipedia as an example.
- Once the project loads, select the project file in Xcode in order to view the list of Targets.
List of Targets
- Right click the target you would like to test and select Duplicate from the menu to make a copy of it.
Creating the Duplicate Target
- Rename this target to something along the lines of ApplicationNameQA. This will signify that the target is a QA-only build, and should not be used as a release.
- Since Xcode does not take care of it automatically, you will need to manually go through the target’s associated files, settings, and schemes to update them to reflect the new target name.
Note: Ensure to update the build settings to properly reference any property list files you rename.
The Renamed Target
The following table contains a list of the various project settings and items you need to update when a target is duplicated:
|What do I need to rename/update when I duplicate a target? |
|Target ||ApplicationName copy > ApplicationNameQA |
|Target .plist file ||ApplicationName copy-Info.plist > ApplicationNameQA.plist |
|Target > Build Settings > Packaging > Info.plist File ||ApplicationName copy-Info.plist > ApplicationNameQA.plist |
|Target > Build Settings > Packaging > Product Name ||ApplicationName copy > ApplicationNameQA |
|Scheme > Manage Schemes ||ApplicationName copy > ApplicationNameQA |
- If you're using the Wikipedia app as an example and intend to deploy it to your device, modify the following setting to build it with your own credentials: Target > Summary > iOS Application Target > Bundle Identifier.
The Modified Bundle Identifier
- In the Scheme drop-down, select the newly created target as the scheme you would like to build.
- Drag the libTestStudioCommon.a and libTestStudioExtension.a static libraries from Finder into your Projects file listing.
Dragging the Static Libraries
- In the Choose options for adding these files dialog, select Create folder references for any added folders, then select to add this file to your newly created QA target, and click Finish.
Linking the Static Libraries
In doing so, this will automatically add a reference to the static library in the Build Phases > Link Binary With Libraries section of your project.
The Successfully Linked Static Libraries
- Under Build Settings > Linking, add the following flag to Other Linker Flags. Doing so will ensure all symbols from the static libraries compile correctly into the target application.
Other Linker Flags
Under the Info tab of the QA Targets settings, click the plus (+) icon to add a new Document Type. The information for the Document Type is:
- Name: tstest
- Types: com.telerik.tstest
Adding the Document Type
Note: The tstest Document Type is what dictates which applications show up in the testable app list within Test Studio.
Under the Info tab of the QA Targets settings, click the plus (+) icon to add a new URL Type. The information for the URL Type is the following, where APPLICATION_NAME is the name of your application:
- Identifier: com.telerik.automation
- URL Schemes: tsAPPLICATION_NAME
- Role: Editor
Adding the URL Type
Note: The URL Schemes should not contain any spaces. The APPLICATION_NAME portion need not match your duplicate Target name exactly, however we recommend consistency as a best practice. The only requirement is that APPLICATION_NAME is unique so it does not conflict with other testable applications.
Click the Run button to deploy your application using the newly configured target. After the Build Succeeded message, you may have to wait up to 10 seconds for the application to deploy. The device's screen will be black in the meantime. You can click the Stop button once the application loads, as you won’t need an attached debugger during testing. If you’d like to have the debugger attached to see why a test is failing, however, this is certainly possible.
Note: You may need to close your application (and Test Studio) on the device before deploying.
Note: If you receive a build error, ensure Build Settings > Architectures > Architectures is set to Standard (armv7).