In an XCUITest (UI test), is it possible to find a label that has three substrings in it?
For example, if I wanted to find a label with "contentsA", "contentsB", and "contentsC" in it, is there a wild card or some other way
I tried this
let labelValue = "contentsA with blah blah blah contentsB with blah blah contentsC"
let a = app.staticTexts.containing("contentsA")
let b = app.staticTexts.containing("contentsB")
let c = app.staticTexts.containing("contentsC")
Assert(a && b && c)
But this didn't work as expected.
You can pass an
NSPredicate
tocontaining
, which would allow more complex queryingSomething like this: