flow
flow copied to clipboard
create an espresso companion library
Publish a companion library to help with testing apps that use Flow.
There are a number of ViewMatchers and an IdlingResource (at least) that should be collected into a small but powerful library.
Some sketches:
/** Matches the first view (DFS) with the given Flow key in its Context. */
ViewMatcher <T> withKey(Matcher<? super T> key);
/** Matches the first view (DFS) with the given Flow service in its Context. */
ViewMatcher <T> withService(String serviceName, Matcher<? super T> service);
/** Convenience for matches(withKey(key)) */
ViewAssertion <T> hasKey(Matcher<? super T> key);
/** Pauses state changes. */
void pauseFlow();
/** Pauses state changes when the top of the history matches the given key. */
void <T> pauseOnKey(Matcher<? super T> key);
/** Unpauses. */
void resumeFlow();
/** Waits until there are no queued state changes. */
void waitUntilFlowIdle();
/** Resumes immediately, pauses when the top of the history matches the given key. */
void <T> waitForKey(Matcher<? super T> key);