The new feature, Virtual Device Testing for Android is here!
It is currently in private-beta test phase, please ping us if you want to join! One test can be ran in one build at the moment, and robo test type has some limitations of watching the screenshots and the activity-map.
Letβs see an example flow for an espresso instruments test. Iβve used this sample project:
Add your app, let the scanner setup your workflow
It will create the default workflows, what we will need is the primary workflow. Originally this workflow will build a debug apk.
App settings
Turn on Virtual Device Testing on the appβs settings tab.
How to change your primary workflow
- Add an extra task assembleDebugAndroidTest in your gradle-runnerβs gradle task input, so it will be something like:
assembleDebug assembleDebugAndroidTest
. - Add Virtual Device testing for Android step after your gradle-runner step.
- As a minimum, in Virtual Device testing for Android step set Test APK path inputs to your built debug apk, in my case Test APK path will be:
./app/build/outputs/apk/app-debug-androidTest-unaligned.apk
Take care of configuring only one section of the step, which matches your desired test type!
(APK path is exported by gradle-runner step, and it is set as the default for the stepβs input, if you want to use different APK then donβt forget to change the stepβs input accordingly!)
If youβve done everything well, this is what youβll see in your log:
The available devices and its versions:
βββββββββββββββ¬βββββββββββ¬βββββββββββββββββββββ¬ββββββββββββββ¬βββββββββββββββββ¬
β MODEL_ID β MAKE β MODEL_NAME β RESOLUTION β OS_VERSION_IDS β
βββββββββββββββΌβββββββββββΌβββββββββββββββββββββΌββββββββββββββΌβββββββββββββββββΌ
β Nexus4 β LG β Nexus 4 β 1280 x 768 β 19,21,22 β
β Nexus10 β Samsung β Nexus 10 β 2560 x 1600 β 19,21,22 β
β Nexus5 β LG β Nexus 5 β 1920 x 1080 β 19,21,22,23 β
β Nexus5X β LG β Nexus 5X β 1920 x 1080 β 23,24,25,26 β
β Nexus6 β Motorola β Nexus 6 β 2560 x 1440 β 21,22,23,24,25 β
β Nexus6P β Google β Nexus 6P β 2560 x 1440 β 23,24,25,26 β
β Nexus7 β ASUS β Nexus 7 (2012) β 1280 x 800 β 19,21,22 β
β Nexus9 β HTC β Nexus 9 β 2048 x 1536 β 21,22,23,24,25 β
β NexusLowRes β Generic β Low-res MDPI phone β 640 x 360 β 23,24,25,26 β
βββββββββββββββ΄βββββββββββ΄βββββββββββββββββββββ΄ββββββββββββββ΄βββββββββββββββββ΄