0

i have a Gradle Task that executes a monkeyrunner script for me. I need to add this task to the normal build process for testing. Inside the script i grant some permissions that are mandatory for testing and the testing output. I can't figure out yet how i can integrate or get the Gradle Task running before the Android Tests are starting. Is this possible? Can someone help me how i can do this? All those solution inside SO Threads didn't help me yet!

Thanks for help!

Lars
  • 794
  • 7
  • 21

1 Answers1

1

You insert tasks into the task graph via Task.dependsOn(). The user manual has some examples. That chapter also explains how to control the order that tasks are executed in.

The following is pseudo script because I don't know the names of the tasks in your build, but the solution should look something like:

check.dependsOn monkeyRunnerTests
androidTests.mustRunAfter monkeyRunnerTests

Note that this sample does not cause the monkeyrunner tests to execute when you run the Android tests. It only makes sure that if both sets of tests are due to run, then the monkeyrunner tests will come before the Android tests.

The sample also makes sure that when you run the check lifecycle task, the monkeyrunner tests execute.

Peter Ledbrook
  • 4,302
  • 1
  • 21
  • 18