I'm adding testing to a large project that I'm working on, but it's been 5-6 years since I last work...
e
I'm adding testing to a large project that I'm working on, but it's been 5-6 years since I last worked with Android test frameworks. The project is 100% kotlin w/ coroutines. From my research it looks like I should be using Espresso for automation testing, and junit for unit testing (with Robolectric as sparingly as possible for unit tests that require interaction with Android). Anyone have any suggestions for patterns, libraries, or docs/blogs that would help get started with this?
😶 1
I'm asking in the context of a Kotlin and coroutines project
c
I'd say that you want to keep as much of your tests as just plain old unit tests by keeping your activity/fragment as thin as possible. Once you get to the point of testing your activity or fragment you can decide to run on device with espresso or with robolectric. to write unit tests with kotlin and coroutines there are some patterns you can use for that, and I would ask in #coroutines
e
My main goal with automation testing is to use Espresso to run through various scenarios that our QA team will create. I assumed this channel would be better than #coroutines for specifics about Espresso and coroutines. Other than that I'm planning on using regular unit tests with junit, as most of our code is abstracted away from Android/activities/fragments.
a
MockK and Mockito