This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
XCTAssert(HomeScreen.theLabel.waitUntilExists().exists, "label should exist") | |
HomeScreen.theLabel.waitUntilExistsAssert() | |
group("Testing the switch") { activity in | |
takeScreenshot(activity: activity, "First screenshot") | |
app.buttons["Second"].waitUntilExists().tap() | |
takeScreenshot() | |
app.buttons["Third"].waitUntilExists().tap() | |
takeScreenshot(groupName: "Screenshot group?") | |
HomeScreen.theButton.waitUntilExists().tap() | |
takeScreenshot("Last screenshot") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
infix operator ~~> | |
public extension UIView { | |
static func ~~> <T>(lhs: UIView, rhs: T) where T: RawRepresentable { | |
if let rv = rhs.rawValue as? String { | |
lhs.accessibilityIdentifier = rv | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public extension RawRepresentable { | |
var element: XCUIElement { | |
if query.count > 1 { | |
fatalError("There are \(query.count) elements with identifier \(self.rawValue as? String ?? "") found!") | |
} | |
return query.firstMatch | |
} | |
var query: XCUIElementQuery { | |
return XCUIApplication().descendants(matching: .any).matching(identifier: self.rawValue as? String ?? "") | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum HomeScreen: String { | |
case theLabel | |
case theTextField | |
case theButton | |
case switch1 | |
case switch2 | |
case dueButton | |
case detailsButton | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Generic query handling | |
- parameter type: An object instance that will be used as the type of the records that will be returned | |
- parameter query: The CloudKit query that will be executed | |
- parameter completionHandler: The function that will be called with the result of the query | |
- parameter errorHandler: The function that will be called when there was an error | |
:return: No return value | |
*/ | |
internal func queryRecords<T:EVCloudKitDataObject>(type:T, query: CKQuery, completionHandler: (results: [T]) -> Bool, errorHandler:((error: NSError) -> Void)? = nil) { |