Course Demo
updated Aug. 2, 2021

Course Objective:

To provide an introduction to UI testing on android with Espresso, Mockk and some of the most useful test classes in androidx.test.


Target Audience:

Complete beginners when it comes to UI testing. There is no required knowledge.


What you'll learn:

  • Kotlin
  • Testing Activities in Isolation:
    1. ActivityScenario
    2. ActivityScenarioRule
  • Activity Navigation:
    1. Intents and startActivity
    2. Back navigation
  • Test Suites:
    1. Running multiple test classes in a suite
  • Firebase Test Lab:
    1. Run UI tests on hundreds of virtual devices using Firebase Test Lab
  • Testing Fragments in Isolation:
    1. FragmentScenario
    2. launchInContainer
    3. FragmentFactory
  • Fragment Navigation:
    1. Testing fragment transactions
    2. Fragment transactions with FragmentFactory
  • Mockk (Mockk.io):
    1. Mocking dependencies
    2. Constructor injection (no dagger)
  • Intents:
    1. IntentsTestRule
    2. Retrieving activity results
    3. Choosing image from gallery
    4. Capturing an image with camera
  • Dialogs:
    1. Material Dialogs (Library)
    2. Is dialog visible?
    3. Capturing input from user
  • Toasts:
    1. Is toast visible?
  • RecyclerView:
    1. Scrolling to list item
    2. Clicking list items
    3. List item verification
  • Espresso Idling Resource:
    1. Required for background work
  • Creating Custom Test Rules:
    1. TestRule
    2. TestWatcher

Github repo: Source code






Comments