Reputation: 6854
I am developing an Android app in Android Studio. I have unit tests and instrumented tests.
I want to run them all to see if I broke something.
Right now my workflow is:
${app}/src/androidTest/java/
Run 'All Tests'
then
${app}/src/androidTest/java/${package}
Run 'Tests in ${package}'
What I am really looking for is a big green button that runs all of the tests and reports back the result of OK/FAILED for both unit and instrumented tests together. How can I do that?
Upvotes: 19
Views: 6712
Reputation: 714
Here's how to make 1 button that runs both all unit tests and instrumentation/UI tests:
Gradle
> Named: Unit Tests
Android Instrumentation Tests
> Named Unit + UI Tests
Unit + UI Tests
configuration > Before Launch
Option > Add Run Another Configuration
> Unit Tests
Unit + UI Tests
configuration. Your Unit tests and UI Tests will both run but they will be in separate tabs, since each tab has specific tooling options.Gradle
> Named: Unit Tests
Android Instrumentation Tests
> Named Unit + UI Tests
Unit + UI Tests
configuration > Before Launch
Option > Add Run Another Configuration
> Select the newly created Unit Tests
configurationUnit + UI Tests
. Your Unit tests and UI Tests will both run but they will be in separate tabs, since each tab has specific tooling options.Upvotes: 0
Reputation: 12222
Use this way for all modules in a project.
1.Select Edit Configurations from Android Stduio
2.Add Gradle task
3. Set this config
cleanTestDebugUnitTest testDebugUnitTest
--tests "*"
Upvotes: 2
Reputation: 689
You cannot start both tests at the same time...
But you can create two big green buttons.
Upvotes: 7