-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could I get an example of FragmentTest with viewModel injected instead of mocked? #2
Comments
Hi there! Sorry for the late response, been out of the loop for a while. Glad the project has been of some help to you. It sounds like you want to do an integration or end to end test; In this case you do not really want to incorporate the viewmodel in your test, you'd rather want to just use the espresso API:s to do things such as view actions / assertions or intent stubbing. Have a look at this test and see if that makes any sense. It basically clicks an item in the video list and checks that the detail page is displayed. |
Hi there, Sorry for delaying answering this! I had a release and I t was a really crazy month. Could you upload again the link with the example test? I get a 404 now. Thanks in advance. |
Hi,
First of all, thank you very much for this repository. It´s very didactic and helps a lot to understand Android development with Jetpack.
I´m trying to testing one of my fragment without mocking viewModel because I need to do an acceptance test but I don't know why viewModel is not injecting. I think because I must setup dagger ready to use on espresso testing.
How would you setup your project to inject dependencies on espresso tests? Could I get an example of your "VideoListFragmentTest" with viewModel injected instead of mocked on a branch?
Thanks in advance!
The text was updated successfully, but these errors were encountered: