Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Launch Espresso tests on several emulators

We want to test that an Android library works on all emulators from Android 9 to 25. To do it, we downloaded emulators from 9 to 25, created them one by one, and went within the loop of starting an emulator, passing the tests on its version and closing the emulator when the tests are green.

If one of my colleagues wants to do the same than me, he has to repeat all the manual process: download them all, create an emulator of every version, start it, launch the tests manually, stop it and go for the next emulator.

There's any way of automating the process? I know that the tests will last for several time, but we expect our best of the library we're going to release :·)

like image 942
Roc Boronat Avatar asked Mar 10 '23 04:03

Roc Boronat


2 Answers

One approach is to use Fastlane and in particular the automated_test_emulator_run plugin (https://github.com/AzimoLabs/fastlane-plugin-automated-test-emulator-run)

For example:

  lane :Automation_EmulatorRun_Gradle do
      automated_test_emulator_run(
        AVD_setup_path: "~/<path to your avd setup>/AVD_setup.json",
        gradle_task:"<your test task>"
      )
   end
like image 60
John O'Reilly Avatar answered Mar 21 '23 02:03

John O'Reilly


you could try also spoon by square that launch the instrumentation test to all devices visibles via adb devices

like image 26
ffgiraldez Avatar answered Mar 21 '23 03:03

ffgiraldez