-
Notifications
You must be signed in to change notification settings - Fork 332
Description
Description
After migrate from deprecated ActivityTestRule to ActivityScenarioRule ui-tests with release build type failed:
java.lang.AssertionError: Activity never becomes requested state "[STARTED, CREATED, DESTROYED, RESUMED]" (last lifecycle transition = "PRE_ON_CREATE")
at androidx.test.core.app.ActivityScenario.waitForActivityToBecomeAnyOf(ActivityScenario.java:338)
Steps to Reproduce
The build type that test against is controlled by the testBuildType
flag. Switch between release & debug by setting property from CLI.
Use keeper library for keep test APK sources on minified release build.
Replace all ActivityTestRule with activityScenarioRule.
Actual Results
Bug reproduces on my pet-project's GitHub-Actions CI:
https://github.com/softartdev/NoteDelight/runs/2433814114?check_suite_focus=true#step:7:295
Note that step for debug build type ui-tests was successful:
https://github.com/softartdev/NoteDelight/runs/2433814114?check_suite_focus=true#step:6:1062
Expected Results
Both release & debug build types ui-tests was successful before test-rules update:
https://github.com/softartdev/NoteDelight/runs/2433726325?check_suite_focus=true#step:7:302
https://github.com/softartdev/NoteDelight/runs/2433726325?check_suite_focus=true#step:6:1082
Most test results are flaky, more stable in SDK 26~29 API versions.
AndroidX Test and Android OS Versions
AndroidX Test libs version 1.3.0
targetSdkVersion 30