Skip Navigation

Add automated testing to your 
BlackBerry Dynamics

  1. Add the 
     Testing Support Library and the 
    BlackBerry Dynamics
     ATSL to your project. Your project must have a compile SDK level of 23 or higher. You can add the following to the build.gradle file to add both libraries:
    // Dependencies on the modules of the Android Testing Support Library. androidTestImplementation 'com.blackberry.blackberrydynamics:atsl:' implementation('') { exclude module: 'support-annotations' } androidTestImplementation '' androidTestImplementation '' androidTestImplementation '' androidTestImplementation '' // Include tests in androidTest target androidTest { manifest.srcFile 'tests/AndroidManifest.xml' java.srcDirs = ['tests'] assets.srcDirs = ['tests/assets'] } // Following configuration is required to set the download location of // dependent projects. allprojects { repositories { mavenCentral() ..... maven { url '../../../m2repository' } } }
  2. Define AndroidJUnitRunner as the runner for test instrumentation. Add the following to the build.gradle file:
    android { ..... defaultConfig { ..... testInstrumentationRunner "" } }
  3. Add or write code for your app tests. Use the helper functions in the ATSL in your test code.
You can use the code for the app tests in any of the sample apps as a starting point. For example, in the SecureSQL sample app, the first app test, 
, executes 
BlackBerry Dynamics
 activation and unlock as an automated test. Put the code in one of the source directories specified in the 
 target. In the above example, only the 
 sub-directory is specified.