Created
March 2, 2020 10:51
-
-
Save sukhrobkhakimov/0e535a736f99b3a301b9bb1a926aef80 to your computer and use it in GitHub Desktop.
This file contains 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
import XCTest | |
// MARK: - Sign In | |
extension Accessibility.SignIn { | |
var element: XCUIElement { | |
let application = XCUIApplication() // This doesn't create a new instance every time but the existing instance is reused by XCTest framework automatically if there is one already. | |
let identifier = self.identifier | |
switch self { | |
case .emailTextField, | |
.passwordTextField: | |
return application.textFields[identifier].firstMatch | |
case .signInButton: | |
return application.buttons[identifier].firstMatch | |
} | |
} | |
} | |
// MARK: - Sign Up | |
extension Accessibility.SignUp { | |
var element: XCUIElement { | |
let application = XCUIApplication() | |
let identifier = self.identifier | |
switch self { | |
case .emailTextField, | |
.passwordTextField, | |
.confirmPasswordTextField: | |
return application.textFields[identifier].firstMatch | |
case .signUpButton: | |
return application.buttons[identifier].firstMatch | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment