Skip to content

Instantly share code, notes, and snippets.

@ngtk
Last active April 22, 2019 11:33
Show Gist options
  • Select an option

  • Save ngtk/b5c0265fd3ec98f503b5c2fc4431d002 to your computer and use it in GitHub Desktop.

Select an option

Save ngtk/b5c0265fd3ec98f503b5c2fc4431d002 to your computer and use it in GitHub Desktop.
func testSignup() {
let app = XCUIApplication()
// Start from welcome page
app.buttons["Signup"].tap()
// Move to sign up page
let emailField = app.textFields["emailField"]
let passwordField = app.secureTextFields["passwordField"]
let nameField = app.textFields["nameField"]
XCTAssert(emailField.exists)
XCTAssert(passwordField.exists)
XCTAssert(nameField.exists)
// Fill email, password and name fields
emailField.typeText("[email protected]")
passwordField.typeText("jg28hwm90iflz")
nameField.typeText("Smith")
// Tap "create an account" button
app.buttons["createAccount"].tap()
// Move to complete page
let heading = app.staticTexts["heading"]
XCTAssert(heading.exists)
XCTAssertEqual(heading.label, "Welcome, Smith!")
// Select country
app.pickers["CountryPicker"]
.pickerWheels
.element(boundBy: 0)
.adjust(toPickerWheelValue: "Japan")
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment