A lesson by Sam Edwards
In this lesson, we look at the problem of shared state between runs of Android tests. We explain why the “Launch and tear down settings” section of the
Espresso Test Recorder settings exist, and discuss strategies to combat them.
We also talk about what a hermetic test execution environment is, and how it combats the problem of shared state. “Hermetic” is defined as “A seal or closure that is airtight”. It is important to completely isolate each test execution so that the shared state of the Android app doesn’t leak into subsequent test runs.
- Espresso Test Recorder Documentation
- Android Developers Blog – Android Testing Support Library 1.0 is here!
Related Caster.IO Lessons:
Sign up for access to the source code.
Lessons in this course
- Espresso Test Recorder – Recording an Espresso Test
- Espresso Test Recorder – Analyzing the Generated Code
- Espresso Test Recorder – Tweaking Code Generation Settings for Matchers
- Espresso Test Recorder – Configuring Matching Options
- Espresso Test Recorder – Combating Shared State
- Espresso Test Recorder – Using “Test Fragment Recording” to Exclude Specific Actions