Created
April 2, 2020 18:13
-
-
Save azamsharp/5ca6eacc25cd56ed422c9435852b327b to your computer and use it in GitHub Desktop.
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
//ContentView: | |
NavigationLink(destination: LoginView().accessibility(identifier: "loginView"), isActive: self.$registrationVM.showLoginView) { | |
EmptyView() | |
} | |
// Test | |
func test_should_register_successfully() { | |
let usernameTextField = self.app.textFields["usernameTextField"] | |
usernameTextField.tap() | |
usernameTextField.typeText("johndoe") | |
let passwordTextField = self.app.secureTextFields["passwordTextField"] | |
passwordTextField.tap() | |
passwordTextField.typeText("password123\n") | |
let registerButton = self.app.buttons["registerButton"] | |
registerButton.tap() | |
let loginView = self.app.staticTexts["loginView"] | |
let loginViewExists = loginView.waitForExistence(timeout: 5.0) | |
XCTAssertTrue(loginViewExists) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment