AzimoLabs / fastlane-plugin-automated-test-emulator-run

Plugin dedicated for Android platform. Wraps gradle task/shell command used for launching instrumented tests. Provides start of as many AVDs with various configs as needed before test run, waits for boot, kills emulators and deletes them from hdd after tests are finished or disturbed.
MIT License
113 stars 48 forks source link
hacktoberfest

automated_test_emulator_run plugin

fastlane Plugin Badge

(article is deprecated - covered plugin version < 1.3.2 which doesn't support Build-Tools ver. >= 25.0.2)
See blog post related to this plugin. You can learn there how to create basic setup for this plugin step by step.

About automated_test_emulator_run

Starts any number of AVDs. AVDs are created and configured automatically according to user liking before instrumentation test process starts (started either via shell command or from gradle) and killed/deleted after test process finishes.

Getting Started

This project is a fastlane plugin.

  1. To get started with fastlane-plugin-automated_test_emulator_run, add it to your project by running:

    fastlane add_plugin automated_test_emulator_run
  2. Create your *.JSON config file to create AVD launch plan according to schema below/provided example.

  3. Wrap your test launch command with plugin and provide link to *.JSON config.

Example of Fastfile

Check out the example Fastfile to see how to use this plugin. Try it by cloning the repo, running fastlane install_plugins and bundle exec fastlane test.

JSON config

What is JSON config?

It is a core of this plugin. User can specify any number of AVD devices in JSON file. Each AVD can be configured separately. Plugin will read JSON file and create fresh, new, untouched AVDs on host - use them in tests - and then delete them after test process finishes.

JSON file scheme:

{
    "avd_list":
    [
        {
          "avd_name": "",

          "create_avd_package": "",
          "create_avd_device": "",
          "create_avd_tag": "",
          "create_avd_abi": "",
          "create_avd_additional_options": "",
          "create_avd_hardware_config_filepath": "",

          "launch_avd_port": "",
          "launch_avd_snapshot_filepath": "",
          "launch_avd_launch_binary_name": "",
          "launch_avd_additional_options": ""
        }
    ]
}

Parameters:
For official help refer to avdmanager binary file: <sdk_root>/tools/bin/avdmanager create avd

Note:

Hints:

Example:

Example of complete JSON file can be found here.

Issues and Feedback

For any other issues and feedback about this plugin, please submit it to this repository.

Troubleshooting

If you have trouble using plugins, check out the Plugins Troubleshooting doc in the main fastlane repo.

Using fastlane Plugins

For more information about how the fastlane plugin system works, check out the Plugins documentation.

About fastlane

fastlane is the easiest way to automate building and releasing your iOS and Android apps. To learn more, check out fastlane.tools.

Towards financial services available to all

We’re working throughout the company to create faster, cheaper, and more available financial services all over the world, and here are some of the techniques that we’re utilizing. There’s still a long way ahead of us, and if you’d like to be part of that journey, check out our careers page.