-
Building Test FAKES for any class
- Do not mistake this for mocks. That is something different.
- Custom AndroidJUnitTestRunner
- ActivityScenario
- ActivityScenarioRule
- Types of Mocking and test fakes:
- Dagger Components
- Dagger Modules
- Application class
- Fragment Factory
- Glide ImageLoader
- Retrofit network requests
- Navigation Components:
- Testing navigation (both fragments in isolation and end to end testing)
- Navigation Testing Artifact
- Glide (Setting images in test)
- RecyclerView Testing:
- Scrolling and list item verification
- Clicking items to trigger event
- Stubbing a Test Data Source (Network)
- End-to-end tests with ActivityScenario
- Isolation tests with FragmentScenario
- Configuration changes (activity/fragment recreation)
- Test assets for providing fake network data
- Test Orchestrator:
- Each test runs in its own Instrumentation instance (no/minimal shared state!)
Watch the video course here: UI Testing with Jetpack and AndroidX.