Last active
October 17, 2017 14:47
-
-
Save olbrichj/4a7479b1859665d5eb74426cf60a868f 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
class LoginScreen { | |
var app: XCUIApplication | |
let identifier = "german-icon" | |
var usernameTextField: XCUIElement { return app.textFields["usernameTextField"] } | |
var passwordTextField: XCUIElement { return app.secureTextFields["passwordTextField"] } | |
var loginButton: XCUIElement { return app.buttons["loginButton"] } | |
init(app: XCUIApplication) { | |
self.app = app | |
} | |
func enter(username: String) { | |
emailTextField.write(string: username) | |
} | |
func enter(password: String) { | |
passwordTextField.write(string: password) | |
} | |
func tapLogin() { | |
loginButton.tap() | |
} | |
func login(withUsername username: String, password: String) { | |
enter(username: username) | |
enter(password: password) | |
tapLogin() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment