ArpitA
ArpitA

Reputation: 741

End to end test for android app with dynamic feature module . How to?

Android project structure :

-app module 
-featureA dynamic module -> depending on app module
-featureB dynamic module -> depending on app module

Use Case : I want to write end to end intrumentation test for my application

Issue : Since , dynamic module classes are not available to app module or other modules . It seems impossible to write end to end test for the application covering all the features .

So, please let me know what can be done here .

Is it possible or not ??
Any work around ??
How do big companies with dynamic feature do it ??

Upvotes: 3

Views: 508

Answers (1)

shubhamgarg1
shubhamgarg1

Reputation: 2005

In case you need to call some classes of dynamic features, you can do so by using Reflection or Service Locator mechanism.

Please see this answer for more details around that: Call dynamic feature code from base module

If you don't need to call those classes yourself in your end to end test, you can create a universal APK which contains all the modules and when the main app module will check if the feature module is installed, it will come out as true and it can then itself call the different methods of the dynamic module by Reflection or Service Locator pattern.

Upvotes: 0

Related Questions