Join Chiu-Ki Chan for an in-depth discussion in this video CustomTestRunner, part of Advanced Android Espresso Testing.
- [Instructor] Great, we have a test application.…How do we use it?…We need a custom test runner.…Put your cursor over TestApplication,…right click,…and select New, Kotlin File/Class.…We will call it CustomTestRunner.…Inside, we will create the class CustomTestRunner,…class CustomTestRunner colon,…and then we'll have it extend AndroidJUnitRunner.…
Inside, we will override the new application function.…Click on Code, Override Methods,…then type newApplication.…newApplication takes three parameters:…class loader, className, and context.…We are going to change the className…to be our test application.…We need the full package name, though,…so let's copy that.…
Press Command + E to switch to TestApplication.…Copy the package name from the first line.…Press Command + E to come back to CustomTestRunner.…Then on line nine,…replace className with the string that we copied…and append dot TestApplication.…Now that we have defined our custom test runner,…we need to use that.…
On line 16,…you can see that we are using the default…
- 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 Davis4h 52m 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.