The following highlights 3 elements
DebugUtil.highlightAll(BasicPath.element.inside(BasicPath.main) .that(ElementProperties.isAfterSibling(BasicPath.svg)) .containing(BasicPath.header.that(ElementProperties.hasAggregatedTextEqualTo("Page Title"))) )
While this highlights only one
DebugUtil.highlightAll(BasicPath.element.inside(BasicPath.main) .containing(BasicPath.header.that(ElementProperties.hasAggregatedTextEqualTo("Page Title"))) .that(ElementProperties.isAfterSibling(BasicPath.svg)) )
This also highlights only one:
DebugUtil.highlightAll(BasicPath.element.inside(BasicPath.main) .that(ElementProperties.isAfterSibling(BasicPath.svg)) .parentOf(BasicPath.header.that(ElementProperties.hasAggregatedTextEqualTo("Page Title"))) )
The following highlights 3 elements
DebugUtil.highlightAll(BasicPath.element.inside(BasicPath.main) .that(ElementProperties.isAfterSibling(BasicPath.svg)) .containing(BasicPath.header.that(ElementProperties.hasAggregatedTextEqualTo("Page Title"))) )
While this highlights only one
DebugUtil.highlightAll(BasicPath.element.inside(BasicPath.main) .containing(BasicPath.header.that(ElementProperties.hasAggregatedTextEqualTo("Page Title"))) .that(ElementProperties.isAfterSibling(BasicPath.svg)) )
This also highlights only one:
DebugUtil.highlightAll(BasicPath.element.inside(BasicPath.main) .that(ElementProperties.isAfterSibling(BasicPath.svg)) .parentOf(BasicPath.header.that(ElementProperties.hasAggregatedTextEqualTo("Page Title"))) )
The expected result is just one.
Happy to provide more details