UI Espresso Test on Dynamic feature modules
Asked Answered
F

2

10

The firebase test lab accept an App Bundle / APK and an android test APK and with dynamic feature module UI tests fail on Firebase test lab. The error is about some multi dex problem indicating that the feature module is not found in the base apk which makes sense if they don't take care of dynamic feature module. wondering if anyone ran to the same issue or someone from the firebase test lab team can help on this.

So the problem is running Espresso UI Test for dynamic feature modules, android studio fails to run them but latest gradle plugin takes care of it properly. it basically installs the base module first and then try to install the feature test apk and everything works properly. (Have some issues with running tests for particular method but this is not the case of my question). the command line that works is famous connectedAndroidTest command. The problem is running those on Firebase test lab.

Furtek answered 11/6, 2019 at 14:2 Comment(3)
So you were able to get the esspresso tests running in the dynamic feature module, but not on firebase?Illogicality
I have the same issue on Firebase Test Lab (and the Google Play pre-launch tests). Did you ever manage to overcome it?Wavelength
any updates on this question? @vahildlazioSesquipedalian
C
0

You can check my question and my answer here:

Create Unit and Instrumentation test for Android project with dynamic features

Basically, you need to add the test dependency in the Dynamic Feature build.gradle:

dependencies {
    implementation project(":app")
    androidTestImplementation project(":app")
}

With this approach, I'm successfully testing against with Firebase Test Lab

Cower answered 24/6, 2020 at 15:36 Comment(0)
H
0

If you use the gcloud command line tool (which I would recommend) you can use the --test parameter to pass in the dynamic feature module's test APK (use assemble to build that one). Also make sure to build the universal APK for the app so it includes the dynamic feature module (non-test code).

Handgun answered 22/12, 2022 at 21:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.