Open djette-st opened 4 months ago
I have the same problem too, event the workaround doesn't work.
@matteo-goghero-leitha
The bug occurs in Testify because the ComposableTestActivity
is automatically launched by the ComposableScreenshotRule
There's an extra step needed to work around this problem:
ComposableScreenshotRule
which uses the Activity created in the previous step.So, for now, I think the only way around this in Testify 2.0 would be for you to duplicate the code in ComposableScreenshotRule
and create your own version of it that uses a ComponentActivity instead of the hardcoded ComposableTestActivity.
Otherwise, this will have to be fixed in a future version of Testify.
Describe the bug
When using HiltAndroidRule from Dagger/Hilt 2.49+ with Testify, an
IllegalStateException
is thrown.This issue relates to:
To Reproduce
Related issue in Dagger: https://github.com/google/dagger/issues/3394
Example workaround: https://github.com/android/nowinandroid/blob/main/ui-test-hilt-manifest/src/main/kotlin/com/google/samples/apps/nowinandroid/uitesthiltmanifest/HiltComponentActivity.kt