From the course: Advanced Android Espresso Testing
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Stubbing: Intending - Android Tutorial
From the course: Advanced Android Espresso Testing
Stubbing: Intending
- [Instructor] We have verified the incoming intent for IdeasActivity and the outgoing intent for MainActivity. Let's verify the activity result returning from IdeasActivity to MainActivity, namely the cat name. We will be using intending instead of intended to do that. Both intending and intended checks the outgoing intent of an activity. The difference is that intended just watches what happens. In other words, it launches the activity and records the intent passed to it. Intending, on the other hand, does not launch the activity. It intercepts and blocks the activity from launching. This is great if you want to stop out the activity result. To stop the activity result, we will call intending with the same intent matcher, and add respondsWith at the end to specify the activity result we want. Let's do that next.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
App: Cat Names1m 28s
-
How intents are used5m 6s
-
Incoming intents: Empty4m 20s
-
Incoming intents: Activity rule2m 45s
-
Incoming intents: Known theme2m 19s
-
Incoming intents: Loading string2m 25s
-
Incoming intents: Unknown theme4m 34s
-
Outgoing intents: Launch activity4m 14s
-
Outgoing intents: Verify intent5m 1s
-
Outgoing intents: How to match?5m 5s
-
Stubbing: Intending1m 16s
-
Stubbing: ActivityResult4m 52s
-
-
-
-