Testing with compose: is there a way to match a no...
# compose
d
Testing with compose: is there a way to match a node by tag only if it's a child of another node? Hypothetical situation:
Copy code
Column: tag A
  TextField: tag field
  Text: tag error
Column: tag B
  TextField: tag field
  Text: tag error
Column: tag C
  TextField: tag field
  Text: tag error
If i want to match the TextField tagged "field" inside the column tagged "B", how do I write the SemanticMatcher?
z
I am on my phone but I thought there was a
withParent
matcher and
onChildren
or something.
d
@Zach Klippenstein (he/him) [MOD]
Copy code
composeTestRule.onNode(hasParent(hasTestTag("B")) + hasTestTag("field"))
hasParent is there, but I'm not sure how to combine it with the child tag
oh... wait
Copy code
composeTestRule.onNode(hasParent(hasTestTag("B")) and hasTestTag("field"))
just and? gee that's awesome
🤩 2