High Level talk about testing effectively in Android, how best to architect your code for it, and how to make use of Google Cloud Test Labs.
https://www.youtube.com/watch?v=mB99GYu9fRQ
• Runs on the JVM • Try not to use the Android Framework • Fast! • Location of Instrumentation tests • Espresso • Runs on a device, emulator, or cloud • Uses the Android Framework! • Consider a “mock” flavor so you don’t hit your API every time. DIP • Watch out for Idling Resources • Slowish… (Turn off hardware animations to speed things up)
• The view handles the display of data (ie. the model). User actions are forwarded to the presenter. • The presenter sits between the model and view; it coordinates the UI with the data, ensuring they are in sync.
variety of devices and device configurations • Logs, videos, and screenshots • Exercise your app automatically, looking for crashes • Web, Android Studio, Command Line (“gcloud” CLI)
https://groups.google.com/forum/#!forum/omaha-android- dev-meetup-01-16 • Get the sample code: git clone https://github.com/googlesamples/android-testing.git
• In the BasicSample project main directory, run the following commands to build the app binaries and tests • The binaries are now available at: “$ ls app/build/outputs/apk/ • The app binary is called: app-debug-unaligned.apk • The test binary is called: app-debug-androidTest-unaligned.apk
Test Lab URL to run your first test: https://console. developers.google.com/testlab/mobile/run?project=omaha-android-dev-meetup • Run an Instrumentation Test • On the following page, upload your app and the test APKs obtained from the previous step, configure your test matrix, and then start the test
a new studio.vmoptions file (or edit an existing one): http://tools.android.com/tech-docs/configuration • Add the following to the file: -Denable.google.cloud.testing.plugin=true
provide a different “Matrix configuration” by clicking on the “more” icon and creating a different configuration. • Click “Apply” and close the window. • Now you can run the test by clicking the Run configuration icon in Android Studio.
Depth First Search traversal of screens. • Navigate to: https://console.developers.google.com/testlab/mobile/run/robo? project=omaha-android-dev-meetup • Upload your App’s APK only, configure the test matrix and start the test