Imme22009
Imme22009

Reputation: 4129

Launch Instrumentation tests from intent

I have a web app that is using Firebase FCM to communicate with my android device.

On receiving a certain data message through Firebase, I need android to run Instrumentation tests (such tests are run in a separate test application or "test APK" which is developed in the androidTest folder).

How can I make an Intent that will launch the test APK?

Upvotes: 0

Views: 372

Answers (1)

Doug Stevenson
Doug Stevenson

Reputation: 317487

You can't run instrumentation tests in response to an external stimulus like this. Instrumentation tests are always driven through a JUnit test harness, which requires yet some other controlling process to kick them off using the am instrument command line program on the device. This is typically Android Studio, which will install both your app APK and your test APK, then kick off the tests. Firebase Test Lab will also take both APKs kick off your tests on physical and virtual devices.

Upvotes: 3

Related Questions