3

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 ??
1
  • I'm running the same problem, any help would be useful Commented Apr 5, 2021 at 15:59

1 Answer 1

0

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.