Test fragments with Espresso properly while using Navigation UI

Viewed 72

I am new to Android Testing (both Unit and Espresso testing). I can set rule

val activityTestRule = ActivityTestRule<MainActivity>(MainActivity::class.java)

when I want to create espresso test for MainActivity.

yet, I found this blog to do this, but I'm not willing to use external libraries (if possible) for this.

So, what is the alternative of this for fragment (any kind of) testing?

But I am using Navigation UI with BottomNavigation, I want to test my fragments which are inside the navigation. Help me how can I do that and obviously a proper way?

0 Answers
Related