Created
June 1, 2018 14:16
-
-
Save evermeer/ac779703e09c2e09f50cb0c94ce5fa08 to your computer and use it in GitHub Desktop.
Code block 4 for UITest medium blog
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") | |
} | |
HomeScreen.theTextField.tapAndType("testing") | |
HomeScreen.theLabel.or(HomeScreen.theTextField).tap() | |
HomeScreen.theLabel.orAssert(HomeScreen.theTextField) | |
HomeScreen.theButton.ifExists { $0.tap() } | |
HomeScreen.hideButton.ifExists(2) { $0.tap() } | |
HomeScreen.hideButton.ifNotExist(2) { | |
app.buttons["Third"].waitUntilExists().tap() | |
} | |
HomeScreen.hideButton.ifNotExistwaitUntilExists(2) { | |
HomeScreen.showButton.waitUntilExists().tap() | |
}.tap() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment