I am trying to stand up espresso tests but I keep getting this error:
INSTRUMENTATION_STATUS: Error=Unable to find instrumentation info for: ComponentInfo{com.mi
If the instrumentation package is missing install it with the following command:
$ gradle :{$project}:installDebugAndroidTest
To correctly run instrumentation testing, follow these instructions:
Install the base package on device/emulator. For example if you want to test devDebug
{flavorBuildType} combination, execute ./gradlew installDevDebug
. Replace devDebug
string with flavor and buildType you have in your project.
Install the test package on device/emulator. If you installed devDebug
now execute ./gradlew installDevDebugAndroidTest
, by default this will install the base package adding the .test
suffix
Verify instrumentation is correctly installed, running adb shell pm list instrumentation
it should print a line with your test package and the available runner, something like: androidx.test.runner.AndroidJUnitRunner
Launch the instrumentation test. For example if you want to test a single test class from your package, you can go with this: adb shell am instrument -w -e class com.your.base.package.MyClassTest com.your.base.package.test/androidx.test.runner.AndroidJUnitRunner
. Check the doc here for all the available options
Optional: After tests have been completed you can uninstall the packages with ./gradlew uninstallDevDebug uninstallDevDebugAndroidTest
Also, looks like yours app package is com.mikeestrada
.
So in AndroidManifest set android:targetPackage
as android:targetPackage="com.mikeestrada"
.
I hope this will help.
https://developer.android.com/studio/test/command-line
Looks like you need to make sure you app and test apks are installed.
You need to check which instrumentation packages have been installed on your device:
adb shell pm list instrumentation
Then verify whether com.mikeestrada.test is actually listed there.
The issue is that you are missing a space:
instrumentationandroid:name
should be
instrumentation android:name