Join Chiu-Ki Chan for an in-depth discussion in this video Incoming intents: Activity rule, part of Advanced Android Espresso Testing.
- [Instructor] We want to launch ideas activity…with an intent carrying the theme as an extra.…To do that, we need to give two more parameters…to the constructor of the activityRule.…Go to line 17.…At the end, we would like to add some parameters.…The first one to add is initial touch mode…which determines if our test should be placed…into touch mode when started.…
Give it true.…Next, we want to give it to parameter false…for launch activity.…This determines…if the rule will automatically launch the activity…at the start of the test method.…It is set to true when we use the one parameter version…of the activity test rule.…But now we want to set it to false…so that we can pass in an intent.…With this change, we need to call launch activity…on the ActivityTestRule ourselves.…
If we don't,…the test method is run without launching the activity.…Let's try that.…Press the green triangle to run our test.…Our test failed.…Look at the lower left corner.…Click on no theme…and you can see the error message.…No activities found.…
- Incoming and outgoing intents
- How intents are used
- Dependency injection
- Why extract dependencies?
- Mockito and Dagger
Skill Level Advanced
Android App Development: Data Persistence Librarieswith Annyce Davis4h 52m Intermediate
Effective Android Testing for Mobile Developerswith Chiu-Ki Chan2h 56m Intermediate
2. Hermetic Test Environment
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.