How to get current activity ( newly started activity ) , started from ui testing. Is there anyway to get its instance using composeTestRule
Jetpack compose testing : how to getcurrent activity after starting new activity from testrule
532 views Asked by VIGNESH At
1
There are 1 answers
Related Questions in ANDROID-JETPACK-COMPOSE
- android-pdf-viewer Received status code 401 from server: Unauthorized
- Inject a class into a composable function using hilt
- preventing duplicate text
- Jetpack compose - how I can hookup LiveData property from ViewModel with TextField in activity?
- MarkerInfoWindow doesn't hold the clicked marker position after list refresh in Compose Map
- How do you import functions from one page to another in Jetpack Compose?
- Jetpack compose ViewModels - should I have one ViewModel for different api calls?
- Change background color of clicked sentence in Text
- How to add and retrive pdf file on firebase in jetpack compose
- Made a widget with glance API in Jetpack Compose. Button filling the whole widget
- Jetpack Compose how to reverse edge-to-edge when leaving composition
- Can Anyone help me to load pdf file from firebase to user app by URL in jetpack compose?
- PullRefreshIndicator circle always displaying on jetpack compose
- Android Studio Using recently added resources in compose preview in multi-module project
- Android compose animations crashing in release builds
Related Questions in ANDROID-TESTING
- Android Gradle Managed Device Test Fails Need to Read WindowHierarchy
- Espresso forces a test to wait 5 seconds on making a screenshot by DefaultFailureHandler when executing method onData()
- What is the difference between AndroidJUnit4::class and AndroidJUnit4ClassRunner::class?
- How to use android-reporting plugin with Kotlin DSL and Version Catalog?
- anndroid test fail java.lang.RuntimeException: Unable to get provider androidx.startup.InitializationProvider
- Run instrumented test inside module's androidTest
- Facing read ECONNRESET in Perfecto execution
- "Record espresso test" option is not enabled in Android Studio
- Directory does not contain gradle build error even though gradle build is in directory
- Why would androidTest not show as a directory type in the dropdown for New Directory?
- Android espresso tests clash with ActivityScenario causing "main thread" error (Kotlin)
- Skip androidx.startup when running instrumented tests
- End to end test for Passkey in mobile App
- Android UIAutomator: How to reset value of Companion Object after closing and restarting App in TestCase?
- launchFragmentInContainer<MyFragment> causing compile error in task app:compileDebugAndroidTestKotlin
Related Questions in ANDROID-JETPACK-COMPOSE-TESTING
- How can I test that a composable is not displayed, but also accept if it doesn't exist?
- How to get Fragment Manager in compose test
- How to write UI unit test case for these composables in android?
- I am not able to test android composable UI getting "FINGERPRINT must not be null" Error
- Jetpack compose testing : how to getcurrent activity after starting new activity from testrule
- Why can't I access to ComposeTestRule when UI testing with xml and compose screen hybrid
- Writing tests for Composable screen with repeated items in Jetpack Compose
- Android. How to test composable function?
- Testing Location API on Firebase Test Lab
- How to write compose UI test to verify background color of a button
- Compose Android Test Lazy Column Not Detect All The Children
- Android UI test for Compose HorizontalPager scrollToPage
- How to Run Compose UI tests multiple times in a row locally?
- Android JetPack Compose Testing. How do I check if the Toast message appears?
- Testing a Composable with assertTextEquals() fails with IllegalStateException
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Usually you would write seperate test methods / a separate test class that verifies the behaviour of the newly started Activity in isolation. So I don't think there is a way to actually access properties or the context of a newly started Activity.
If you only want to check whether a new Activity was successfully started after a button press, try out the following code:
Check out the documentation for the
intendedfunction.If you want to test whether intent extras are passed properly, have a look at this question.