PredicateBaseExtensionProtocol
public protocol PredicateBaseExtensionProtocol
Use generic protocols to better extend functionality in both engineering and testing projects
// for project
extension XCUIElement: PredicateBaseExtensionProtocol {
public typealias T = XCUIElement
}
// for test
extension EasyPredicateTestItem: PredicateBaseExtensionProtocol {
typealias T = EasyPredicateTestItem
}
-
Declaration
Swift
associatedtype T
-
waitUntil(predicates:logic:timeout:handler:)
Default implementationcreate a new preicate with EasyPredicates and LogicalType to judge is it satisfied on self
Default Implementation
Declaration
Swift
func waitUntil(predicates: [EasyPredicate], logic: NSCompoundPredicate.LogicalType, timeout: TimeInterval, handler: XCTNSPredicateExpectation.Handler?) -> (result: XCTWaiter.Result, element: T)
Parameters
predicates
predicates rules
logic
rules relative
timeout
time limit
handler
expectation handler
Return Value
a tuple of waiting result and element
-
assertBreak(predicates:logic:)
Default implementationassert by new preicate with EasyPredicates and LogicalType, if assert is passed then return self or return nil
Default Implementation
Declaration
Swift
func assertBreak(predicates: [EasyPredicate], logic: NSCompoundPredicate.LogicalType) -> T?
Parameters
predicates
predicates rules
logic
rules relative
Return Value
self or nil