Join Chiu-Ki Chan for an in-depth discussion in this video Outgoing intents: Verify intent, part of Advanced Android Espresso Testing.
- [Instructor] To test the outgoing intent…from main activity,…we clicked on the button and let it launch ideas activity.…Another way to verify that ideas activity is launched…with a proper theme is to intercept the activity launch…and examine the intent.…To do that, we will use the espresso-intents library.…The espresso-intents library is an extension of espresso…for validating and stubbing intents.…
In the documentation, you can find the dependency you need.…Copy that line and paste it in app slash build dot gradle.…You will need to paste it in the dependency's block.…We will do it right after the espresso dependency…on line 29.…The documentation is old when it uses android test compile.…
Change that to android test implementation.…Perform a gradle sync.…Next, let's take a look at the documentation again…to see what we need to do.…It says that we need to use intents test rule…instead of activity test rule.…Let's do that.…Open main activity test…and on line 18, replace activity test rule…with intents test rule.…
- Incoming and outgoing intents
- How intents are used
- Dependency injection
- Why extract dependencies?
- Mockito and Dagger
Skill Level Advanced
Effective Android Testing for Mobile Developerswith Chiu-Ki Chan2h 56m Intermediate
Android App Development: Data Persistence Librarieswith Annyce Davis3h 59m 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.