Last active
April 22, 2019 11:33
-
-
Save ngtk/b5c0265fd3ec98f503b5c2fc4431d002 to your computer and use it in GitHub Desktop.
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 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("smith@example.com") | |
| 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