Skip Navigation

Preparing for automated testing

You must activate a new installation of a 
BlackBerry Dynamics
 app before you can run automated tests. This requires a user identifier (typically an email address), an access key, and a password. The ATSL can read activation credentials from any file in JSON format with the .json extension in the application resource bundle. Each sample app in the SDK includes a file named credentials.json in the test target.
For more information about the required content of the credentials file, see the 
BBDAutomatedTestSupport
 class in the reference documentation of the 
fetchCredentialsFromFileAtPath:
 method.
 There are different options to prepare the file:
  • Manually generate an access key for a user in the 
    UEM
     or standalone 
    Good Control
     management console, then manually edit the file.
  • Manually generate and store a number of access keys in advance, then automatically edit the file and consume a key from the store.
  • Automatically generate an access key, and optionally a user, with the BlackBerry Web Services APIs, then automatically edit the file. 
Use the option that best suits your needs, based on your access to the management console and administrator level permissions, your familiarity with the BlackBerry Web Services APIs, and your preference for using a new activation for every test or running subsequent tests on the same app as an upgrade.
Please note the following:
  • In the JSON file, the access key and unlock key have to be 15 characters and cannot have dashes.
  • Automated testing works in Enterprise Simulation mode, but will have the same restrictions (for example, the app cannot connect to any back-end servers).
  • There is currently an 
    iOS
     known issue where automated tests can fail because the keyboard disappears occasionally in the simulator.
  • In 
    Xcode
     8.3 and later, the XCTests framework executes tests in a random order, as a best practice. Tests should be self-contained and independent.
  • Every 
    BlackBerry Dynamics
     app needs a one-time initialization to complete activation. To ensure that this is executed first, define a dedicated test method that executes 
    BlackBerry Dynamics
     activation and have that activation test executed in isolation.
  • The source code is provided in Objective-C. If any of the app or test code is written in 
    Swift
    , you must configure the code according to 
    Apple
     standards for mixing 
    Swift
     and Objective-C.