Compose icon indicating copy to clipboard operation
Compose copied to clipboard

Add API to get children from specific node

Open AJIEKCX opened this issue 3 years ago • 0 comments

I want to get all items from Row or Column and cast them to specific PageObject. But now you can use only the Compose testing API to get all semantic nodes:

private val semanticItems = semanticsProvider
  .onAllNodes(hasTestTag(TestTag.MoneyItem.Title), useUnmergedTree = true)
   .fetchSemanticsNodes()

val items: List<KDashboardMoneyItemNode> = semanticItems.mapIndexed { index, _ ->
   child {
       useUnmergedTree = true
       hasTestTag(TestTag.MoneyItem.Tag)
       hasPosition(index)
   }
}

This solution has many disadvantages. It would be better if Kakao added children function to get all children nodes to hide low level api.

AJIEKCX avatar Apr 01 '22 12:04 AJIEKCX