From e237687a2166ebd8eb18b34adebb56a8088cf492 Mon Sep 17 00:00:00 2001 From: valeriaalampi Date: Tue, 19 Apr 2022 09:49:55 +0200 Subject: [PATCH] feat: added func withTextContains returning XCUIElementQuery (#71) --- XCode/Sources/UITests/XCTAssertion+.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/XCode/Sources/UITests/XCTAssertion+.swift b/XCode/Sources/UITests/XCTAssertion+.swift index 098d3e9..6407b23 100644 --- a/XCode/Sources/UITests/XCTAssertion+.swift +++ b/XCode/Sources/UITests/XCTAssertion+.swift @@ -69,6 +69,11 @@ public extension XCUIElement { let predicate = NSPredicate(format: "label CONTAINS[c] %@", value) return staticTexts.containing(predicate).firstMatch } + + func withTextContains(_ value: String) -> XCUIElementQuery { + let predicate = NSPredicate(format: "label CONTAINS[c] %@", value) + return staticTexts.containing(predicate) + } } public extension String {