I would like to get parent (0x7fdc65735bd0) or better directly sibling (0x7fdc657082a0), of .staticText (0x7fdc65708190) which has no identifier, just unique label.
ScrollView, 0x7fdc65740830, {{0.0, 94.0}, {375.0, 620.0}}
Other, 0x7fdc657402a0, {{0.0, 94.0}, {375.0, 689.7}}
Other, 0x7fdc657403b0, {{0.0, 94.0}, {375.0, 50.0}}
Other, 0x7fdc65740ba0, {{16.0, 110.0}, {335.0, 26.0}}
Other, 0x7fdc65740cb0, {{16.0, 110.0}, {335.0, 26.0}}
StaticText, 0x7fdc65727630, {{16.0, 110.0}, {315.0, 26.0}}, label: 'Self pickup'
Image, 0x7fdc65727740, {{331.0, 110.0}, {20.0, 26.0}}, identifier: 'checkbox_unchecked'
Other, 0x7fdc6572b860, {{0.0, 144.0}, {375.0, 1.0}}
Other, 0x7fdc6572b970, {{0.0, 145.0}, {375.0, 66.3}}
Other, 0x7fdc65735ac0, {{16.0, 161.0}, {335.0, 42.3}}
Other, 0x7fdc65735bd0, {{16.0, 161.0}, {335.0, 20.0}}
StaticText, 0x7fdc65708190, {{16.0, 161.0}, {315.0, 20.0}}, label: 'Shipping'
Image, 0x7fdc657082a0, {{331.0, 161.0}, {20.0, 20.0}}, identifier: 'checkbox_checked'
following code works quite good for Self pickup:
app.otherElements.containing(NSPredicate(format: "label LIKE[c] 'Self pickup'")).images.firstMatch
but if I'll decide to get image of Shipping and replace NSPredicate condition:
app.otherElements.containing(NSPredicate(format: "label LIKE[c] 'Shipping'")).images.firstMatch
it is still giving me the Self pickup image
Do you have any idea how to bound that to children? I tried this but can't find anything:
app.otherElements.children(matching: .image).containing(NSPredicate(format: "label LIKE[c] 'Shipping'")).images.firstMatch
The reason why I need to get the sibling (.image) is to determine if the image (truly checkbox) is checked or not.
EDIT:
I would need something like this:
app.otherElements.containing(NSPredicate(format: "label LIKE[c] 'Shipping'")).siblingMatching(elementType: .image)
...not sure if something like this exists, but it would fits the best to my purpose.