Welcome to Espresso Kotlin Playground
What is this?
A mini series on the different strategies from playing around with Espresso and Kotlin to help accelerate the development of writing expressive tests.
How to read
The series of topics was intended to be read sequentially to continuously build off the topics being covered. So if you came in at a random place and don't understand what's going on, it might help to start from the beginning from the page object pattern.
What you will learn
- Page Object Pattern - abstract out the logic of interacting with a page in the UI from the test
- Espresso Extensions - a collection of Kotlin extension functions that help reduce some of the boiler plate in view matching/interactions and provide better code completion when building out page objects
- Navigation DSL - create a domain specific language for navigating between the different page objects in a test
- Mock Tests
- Mockk Test - write a test with a mocked dependency using Mockk
- Mock Ktor Test - write a mock network test using Ktor network client and Mock Engine. Also learn how to use Espresso idling resources to deal with code that runs on the IO thread and can cause flaky tests.
Onward
I hope you learn something from this series and please leave any comments about the series on my website. If there's any suggestions to improve anything, feel free to open up a issue on the project. Otherwise, enjoy!
Info
If you would like to follow along by coding, checkout the project and switch to 1-start branch. The project starts off from the Login Activity template in the setup wizard.
git clone https://github.com/plusmobileapps/espresso-kotlin-playground.git
git checkout 1-start