Android Espresso - how to run setup only once for all tests

Viewed 2047

I am using Espresso/Kotlin to run tests for our Android Application and I want to run the setup once for all tests in the given test class.

I created a companion object to launch the application once (which it does), however it then closes and doesn't stay open while each test runs.

enter image description here

How can I have it launch the application, run all the tests in the test class, then close the application?

I also tried the following, but it still launches once then closes, then tries running the tests: enter image description here

1 Answers
Related