-
-
Notifications
You must be signed in to change notification settings - Fork 48
Android Tests
Type | Name |
---|---|
Android Instrument Test | AndroidXTest (Runner, JUnit, Rules) / Espresso (Core, Intents, Contrib) |
To really test the database of your application, you need to use instrumental tests to launch the application and create the database. Each test creates a database and deletes it at the end. It is easily implemented with Room.
👀 You can check a full example here: RepoDaoTest.kt
This architecture, in particular with MVI, makes it very easy to test your views. To do this, simply send a ViewModel to your view and check that the graphic elements (and only them) are clearly visible there with Espresso.
👀 You can check a full example here: RepoActivityTest.kt, RepoRobot.kt
After visually testing each screen you must test their sequence (use cases).
Just use the same Robot in each scene to trigger interactions and navigate from screen to screen.
👀 You can check a full example here: AppUseCaseTest.kt
I also invite you to watch and use function extensions of the example project to facilitate your UI tests with Expresso: EspressoExtension.kt
Find this project useful? Support it by joining stargazers for this repository ⭐️
And follow me for my next creations 👍
CleanRxArchitecture by Lopez Mikhael is licensed under a Apache License 2.0.