Closed aleks-ex closed 1 week ago
Similar issue in google tracker https://issuetracker.google.com/issues/342778294
Hi! The thing is that SemanticsNodeInteraction belongs to a common code shared with Android Jetpack so whatever proposals you have on this API it's better to start here - https://github.com/androidx/androidx
The SemanticsNodeInteraction class is defined as follows:
The properties
testContext
,useUnmergedTree
, andselector
have internal visibility. This restricts access to these properties from external code that utilizes the library. Consequently, it hinders the creation of custom extension functions necessary for certain testing scenarios.Current testing API doesn't allow to search descendant deeper than 1st generation as SemanticsNodeInteraction has just
onChildren()
andonChildAt(index: Int)
to find it.(commonMain/androidx/compose/ui/test/Selectors.kt)
For instance, the library provides extension functions for working with lists, such as:
In my framework, I need to create similar extension functions with custom logic of target elements search. However, I am unable to do so because I do not have access to the testContext, useUnmergedTree, and selector properties.
I kindly request to change the visibility of these properties in the SemanticsNodeInteraction class from internal to public.
Jetpack Compose version:
1.6.7
Jetpack Compose component used:androidx.compose.ui:ui-test