Automated testing with the BlackBerry
Dynamics sample apps
BlackBerry Dynamicssample apps
The sample apps included in the
BlackBerry Dynamics SDKhave been integrated with the
BlackBerry DynamicsAutomated Test Support Library (ATSL). Most Objective-C sample apps include test code that executes automated tests for provisioning and activation, and also demonstrate how to use the library to interact with generic UI components that are not related to
You can use the integration of the ATSL in any of the sample apps as a guide for integrating the library with your own
BlackBerry Dynamicsapps. Note the following details about ATSL integration:
Build target for testing
Each app has an
<AppName>UITestsbuild target that can be used by the XCTest framework.
For more information about how to configure and run user interface tests and view results, see Apple Documentation Archive: Running Tests and Viewing Results.
Code for XCUITest tests
The test code is located in the sub-directory
The code is based on the XCTests framework. Most of the classes relate to user interface testing as
Use of ATSL for interaction with
The test code uses helper functions in the ATSL. For example, the code calls the
loginOrProvisionBBDAppmethod of the
BBDAutomatedTestSupportclass, which executes the entire activation process.
You can validate ATSL helper function operations using XCTAssert macros. For example, this assertion will fail if activation fails:
XCTAssertTrue([ats loginOrProvisionBBDApp], @"Activation Failed!");
Use of ATSL for general interactions
The test code also uses helper functions in the ATSL for general interactions, such as checking that an item exists in the user interface and then interacting with that item. The ATSL functions handle this by using XCTestCase and XCUIElement classes.
These functions are defined in the category
XCTestCase+Expectationsand the group