You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our team would like to create E2E tests where the app should function as close to production as possible (even with backend). We realise this is inherently flaky but I'll leave that discussion for another day. We've figured we would use Hilt testing utils to inject some "interceptor-like" utils so that, for example, we could know what is coming from backend on our tests and check the corresponding behavior on our app.
Also, we'd like our test cases to be very self-contained, i.e. each test case should launch its own process / application, as we'd like to avoid sharing state across test cases and also avoid crashes in one test case spilling over to the rest. From what we've investigated, this seems to be possible with Android Test Orchestrator.
The issue now is that it doesn't seem like it is possible to accomplish this with @HiltAndroidTest. It looks like the application is always shared between test cases (even using Orchestrator) and the application is actually initialized before any test case. It is especially evident from the abundance of exceptions we've gotten trying to make this work (WorkManager/DataStore initializing twice as they are rebound each test case, etc.). We also realize this is expected and well documented.
Regardless, I guess my question is: is there any way to make Hilt testing work with Android Test Orchestrator and make these self-contained test cases possible?
The text was updated successfully, but these errors were encountered:
Our team would like to create E2E tests where the app should function as close to production as possible (even with backend). We realise this is inherently flaky but I'll leave that discussion for another day. We've figured we would use Hilt testing utils to inject some "interceptor-like" utils so that, for example, we could know what is coming from backend on our tests and check the corresponding behavior on our app.
Also, we'd like our test cases to be very self-contained, i.e. each test case should launch its own process / application, as we'd like to avoid sharing state across test cases and also avoid crashes in one test case spilling over to the rest. From what we've investigated, this seems to be possible with Android Test Orchestrator.
The issue now is that it doesn't seem like it is possible to accomplish this with
@HiltAndroidTest
. It looks like the application is always shared between test cases (even using Orchestrator) and the application is actually initialized before any test case. It is especially evident from the abundance of exceptions we've gotten trying to make this work (WorkManager/DataStore initializing twice as they are rebound each test case, etc.). We also realize this is expected and well documented.Regardless, I guess my question is: is there any way to make Hilt testing work with Android Test Orchestrator and make these self-contained test cases possible?
The text was updated successfully, but these errors were encountered: