Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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()
- }
- }
Add Comment
Please, Sign In to add comment