import XCTest class WelcomeTests OXTestCase func testVisibilityOfEsse

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import XCTest
class WelcomeTests: OXTestCase {
func testVisibilityOfEssentialElements() {
let title = app.staticTexts[AccessibilityIdentifiers.Welcome.title].firstMatch
XCTAssert(title.isHittable, "Expected the title to be presented")
let linkCardButton = app.buttons[AccessibilityIdentifiers.Welcome.linkCardButton].firstMatch
XCTAssert(linkCardButton.isHittable, "Expected the link card button to be presented")
let getNewCardButton = app.buttons[AccessibilityIdentifiers.Welcome.getNewCard].firstMatch //This is "Login" button on the Welcome Screen
XCTAssert(getNewCardButton.isHittable, "Expected the get new card button to be presented")
getNewCardButton.tap()
let loginInputField = app.textFields[AccessibilityIdentifiers.LoginForm.loginInputField].firstMatch
XCTAssert(loginInputField.isHittable, "Expected the login field to be presented")
loginInputField.typeText("5512345678")
let passwordInputField = app.otherElements[AccessibilityIdentifiers.LoginForm.passwordInputField].firstMatch
XCTAssert(passwordInputField.exists, "Expected the password field to be presented")
passwordInputField.tap()
passwordInputField.typeText("password")
}
}