All Questions
6 questions
0
votes
1
answer
37
views
NoMatchingViewException error during Espresso test
I am doing an instrumentation test of Fragment is displayed or not. When I start the test it execute, I am able to see FragmentLogin view in physical device but test fail by saying androidx.test....
1
vote
0
answers
78
views
Why Android enforces me to use Hilt if I want to test @AndroidEntryPoint annotated classes (UI TEST) but hilt can not provide Activity object
I am trying to test a Main Activity class that is @AndroidEntryPoint using Hilt Testing in my Android application. The PermissionHelper class is defined as follows:
public class PermissionHelper {
...
0
votes
1
answer
160
views
In a Hilt Instrument Test, can you have two ViewModels for @BindValue?
I am having some issues with a instrument test using Hilt. The problem is that I have to deal with two viewModels, one for the activity and then one for the base class. Here is what I have:
@RunWith(...
3
votes
2
answers
2k
views
ComponentActivity ClassNotFoundException when trying to setup Instrumented tests, with Android Compose and Hilt
I'm setting up my first instrumented unit-test and getting an obscure crash in logcat.
The emulator starts and immediately crashes when the app tries to open and the unit test doesn't even run because ...
2
votes
1
answer
2k
views
Getting failed in providing HiltTestApplication as a dependency in my test module
I have followed this guide and trying to run instrumented test with HILT.But its getting failed in providing HiltTestApplication as a dependency in my test module.
Below is my module class-
@...
1
vote
0
answers
2k
views
How to inject mocked ViewModel into Fragment during Instrumented tests with Android Hilt?
I am having a hard time to get my instrumented tests on Android.
Goal: Inject a mocked ViewModel during a Fragment Instrumented test.
Context:
My ViewModel is built using the Hilt Jetpack integrations ...