Skip to content

Instantly share code, notes, and snippets.

@paigeshin
Created July 3, 2022 09:41
Show Gist options
  • Select an option

  • Save paigeshin/aeb304b963a665108c1b3c3dad86bca1 to your computer and use it in GitHub Desktop.

Select an option

Save paigeshin/aeb304b963a665108c1b3c3dad86bca1 to your computer and use it in GitHub Desktop.
func test_should_display_error_message_for_missing_required_fields() {
let app = XCUIApplication()
continueAfterFailure = false
app.launch()
let usernameTextField = app.textFields["usernameTextField"]
usernameTextField.tap()
usernameTextField.typeText("")
let passwordTextField = app.textFields["passwordTextField"]
passwordTextField.tap()
passwordTextField.typeText("")
let loginButton = app.buttons["loginButton"]
loginButton.tap()
let messageText = app.staticTexts["messageText"]
XCTAssertEqual(messageText.label, "Required fields are missing")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment