@@ -79,20 +79,23 @@ open class AppTestCase: XCTestCase {
79
79
80
80
// MARK: - Other elements
81
81
82
+ // swiftlint:disable empty_count
82
83
/// Returns buttons with the given accessiiblity identifier
83
84
@MainActor func buttons( withA11yIdentifier id: String , _ app: XCUIApplication ) -> XCUIElementQuery {
84
85
let elements = app. buttons. matching ( identifier: id)
85
- XCTAssertTrue ( elements. containsElements ( ) , " No matching button with accessibility identifier ' \( id) ' " )
86
+ XCTAssertTrue ( elements. count > 0 , " No matching button with accessibility identifier ' \( id) ' " )
86
87
return elements
87
88
}
88
89
89
90
/// Returns elements with the given accessiiblity identifier
90
91
@MainActor func otherElements( withA11yIdentifier id: String , _ app: XCUIApplication ) -> XCUIElementQuery {
91
92
let elements = app. otherElements. matching ( identifier: id)
92
- XCTAssertTrue ( elements. containsElements ( ) , " No matching element with accessibility identifier ' \( id) ' " )
93
+ XCTAssertTrue ( elements. count > 0 , " No matching element with accessibility identifier ' \( id) ' " )
93
94
return elements
94
95
}
95
96
97
+ // swiftlint:enable empty_count
98
+
96
99
/// Returns element with the given accessiiblity label
97
100
@MainActor func otherElement( withA11yLabel label: String , _ app: XCUIApplication ) -> XCUIElement {
98
101
let element = app. otherElements [ label]
@@ -187,21 +190,6 @@ extension String {
187
190
}
188
191
}
189
192
190
- // MARK: - Extension of XCUIElementQuery
191
-
192
- extension XCUIElementQuery {
193
-
194
- // Ok, I know, this is crappy, but the SwiftFormat formatter
195
- // converts 'count > 0' to '!isEmpty' even if API not available
196
- // (┛❍ᴥ❍)┛彡┻━┻
197
- // See: https://github.com/nicklockwood/SwiftFormat/issues/2109
198
- // swiftlint:disable empty_count
199
- func containsElements( ) -> Bool {
200
- count > 0
201
- }
202
- // swiftlint:enable empty_count
203
- }
204
-
205
193
// swiftlint:enable nslocalizedstring_key
206
194
// swiftlint:enable required_deinit
207
195
// swiftlint:enable empty_xctest_method
0 commit comments