-
-
Save dinneo/9552368c1df4d8920e95f803bda35990 to your computer and use it in GitHub Desktop.
UI Testing button, textField, allert, navigation bar
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
func testOther() { | |
let app = XCUIApplication() //create app | |
XCTAssertTrue(app.navigationBars.staticTexts["Title"].exists) //check navigation bar title | |
XCTAssertTrue(app.buttons["Test"].exists) //check button with title Test | |
app.buttons["Test"].tap() //tap button | |
XCTAssertTrue(app.alerts["Error"].exists) //check allert with title Error | |
app.alerts["Error"].buttons.elementBoundByIndex(0).tap()//tap first button on allert | |
let textField = app.textFields["nameTextField"] //choose textFields with idenificator nameTextField | |
textField.tap()// tap on text fields | |
textField.typeText("correct")// write text to textFields | |
app.buttons["Test"].tap() | |
XCTAssertTrue(app.alerts["Correct"].exists) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment