Skip to content

Instantly share code, notes, and snippets.

@azamsharp
Created December 3, 2017 04:10
Show Gist options
  • Save azamsharp/84a81b2225e03351d102d671529566b2 to your computer and use it in GitHub Desktop.
Save azamsharp/84a81b2225e03351d102d671529566b2 to your computer and use it in GitHub Desktop.
Register For a new Account Test
class When_User_Is_Registering_For_A_New_Account: XCTestCase {
private var app :XCUIApplication!
override func setUp() {
super.setUp()
continueAfterFailure = false
self.app = XCUIApplication()
self.app.launch()
}
func test_should_create_account_successfully() {
app.textFields["usernameTextField"].tapAndType(text: "johndoe")
app.textFields["passwordTextField"].tapAndType(text: "password")
app.buttons["registerButton"].tap() // writes a user default value to users
// go to the login screen if the login is successfull
XCTAssertEqual("Login", app.navigationBars.element.identifier)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment