Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save paigeshin/c9b2cc03ab4fdf563a2dbde7b2114a56 to your computer and use it in GitHub Desktop.
func test_should_display_error_message_for_missing_required_fields() {
let app = XCUIApplication()
continueAfterFailure = false
let loginPageObject = LoginPageObject(app: app)
app.launch()
let usernameTextField = loginPageObject.usernameTextField
usernameTextField.tap()
usernameTextField.typeText("")
let passwordTextField = loginPageObject.passwordTextField
passwordTextField.tap()
passwordTextField.typeText("")
let loginButton = loginPageObject.loginButton
loginButton.tap()
let messageText = loginPageObject.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