New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request - allow checking if activity is destroyed with ActivityScenario #235
Comments
copybara-androidxtest
pushed a commit
that referenced
this issue
Mar 12, 2019
getState() API provides a way to check the current state of the activity under testing. This is especially useful when your activity redirects to another activity or finish itself during the launch. FR: #235 PiperOrigin-RevId: 238095286
copybara-androidxtest
pushed a commit
that referenced
this issue
Mar 13, 2019
getState() API provides a way to check the current state of the activity under testing. This is especially useful when your activity redirects to another activity or finish itself during the launch. FR: #235 PiperOrigin-RevId: 238095286
copybara-androidxtest
pushed a commit
that referenced
this issue
Mar 13, 2019
getState() API provides a way to check the current state of the activity under testing. This is especially useful when your activity redirects to another activity or finish itself during the launch. FR: #235 PiperOrigin-RevId: 238095286
copybara-androidxtest
pushed a commit
that referenced
this issue
Mar 13, 2019
getState() API provides a way to check the current state of the activity under testing. This is especially useful when your activity redirects to another activity or finish itself during the launch. FR: #235 PiperOrigin-RevId: 238144049
8 tasks
rauljurado620
added a commit
to rauljurado620/test-android-project
that referenced
this issue
Mar 24, 2022
getState() API provides a way to check the current state of the activity under testing. This is especially useful when your activity redirects to another activity or finish itself during the launch. FR: android/android-test#235 PiperOrigin-RevId: 238144049
Zemotacqy
pushed a commit
to Zemotacqy/android-test
that referenced
this issue
May 5, 2023
Add SHA256 of android-test for Bazel to cache it properly.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
We have an activity that immediately finishes (in
onCreate()
) if it does not receive correct intent arguments. I have found no way to test this with ActivityScenario. WithActivityTestRule
we could do something like this:With
ActivityScenario
, theActivityScenario.getCurrentActivityState()
and connected methods are private, so I had to try something like:But it fails with
It would be nice to provide a way to test use case like this. If you do not want to expose the
getCurrentActivityState
, maybe there could be at least something likeActivityScenario.isDestroyed()
AndroidX Test Versions
androidxTestMonitorVersion = '1.1.1'
androidxTestRulesVersion = '1.1.1'
androidxTestRunnerVersion = '1.1.1'
androidxTestJunitVersion = '1.1.0'
The text was updated successfully, but these errors were encountered: