Closed AJIEKCX closed 2 years ago
Also there is another problem with nested page objects. Because BaseNode
inherits only direct parent node matchers but not all ancestors:
override val delegate: ComposeDelegate by lazy(LazyThreadSafetyMode.NONE) {
ComposeDelegate(
nodeProvider = NodeProvider(
nodeMatcher = NodeMatcher(
matcher = if (parentNode == null) nodeMatcher.matcher else hasParent(parentNode.nodeMatcher.matcher) and nodeMatcher.matcher,
position = nodeMatcher.position,
useUnmergedTree = nodeMatcher.useUnmergedTree
),
semanticsProvider = semanticsProvider
),
parentDelegate = parentNode?.delegate
)
}
And it can be a problem for some cases. I think we should combine matchers from all ancestor nodes.
I will try to work on this issue
I've done it in #28
Hi, I have a problem with matching child nodes for the
ComposeScreen
. It works in simple cases but for the current screen it won’t work:The following PageObject can’t find our title at this screen:
It can be fixed by deleting
child
and usinghasAnyAncestor
matcher:But it’s not convenient and it would be great if BaseNode had this matcher by default for the parent node or allowed to change this behavior.