android-test
android-test copied to clipboard
Add LazyActivityScenarioRule that defers the launch of the Activity until needed
Overview
This change makes it possible to defer the launch of the Activity
under test until the first call to LazyActivityScenarioRule.getScenario()
, so that different setups/options can be initialized before the Activity
is launched.
Fixes #446.
Proposed Changes
- Add
LazyActivityScenarioRule
(similar toActivityScenarioRule
) that instead of launching theActivity
under test right away, defers this until the first call toLazyActivityScenarioRule.getScenario()
. This makes it possible to initialize different setups ie. populate an in-memory database, prepare test data, deactivate wifi etc. - Add the possibility to
disable()
the newRule
in tests that doesn't need anActivity
to run, ie. tests for:- internal utility-methods
- internal test data generators etc.
+1
+1
+1!!! Please merge this
+1 👌
+1
👍
+1 👍 @googlebot