Skip to content

Instantly share code, notes, and snippets.

@tieleman
Last active February 26, 2020 11:40
Show Gist options
  • Save tieleman/2eb640fd4a864d12e74ca2b3c2d70431 to your computer and use it in GitHub Desktop.
Save tieleman/2eb640fd4a864d12e74ca2b3c2d70431 to your computer and use it in GitHub Desktop.
SimpleGreeterUITests.swift#testInitialViewState
func testInitialViewState() {
let app = XCUIApplication()
app.launch()
let textField = app.textFields.element
let enterNameLabel = app.staticTexts["enterNameLabel"]
let greeterLabel = app.staticTexts["greetingTextLabel"]
XCTAssert(enterNameLabel.exists)
XCTAssertEqual(enterNameLabel.label, "Please enter your name below")
XCTAssert(greeterLabel.exists)
XCTAssert(greeterLabel.label.isEmpty)
XCTAssert(textField.exists)
XCTAssertEqual(textField.placeholderValue, "Your name")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment