mardi 5 avril 2016

How may I add an activity to androidTest package

Problem - Testing Custom Alert Dialog

Required - Show the dialog and test using espresso.

Solution 1: Have a buildType src but this breaks testBuildType as we can only have one testBuildType, also the file is not available for other buildTypes, so testing won't be possible in release builds.

Solution 2: Or flavor based folder and put a stub Activity there. Not a bad idea; but new flavors are not giving coverage report.

Is it possible to put a test stub activity in androidTest folder? Is this the right way to test an AlertDialog/Fragment? Is there any better approach to it?

Aucun commentaire:

Enregistrer un commentaire