Skip to content

Instantly share code, notes, and snippets.

@cipolleschi
Created August 2, 2020 10:50
Show Gist options
  • Select an option

  • Save cipolleschi/be7644db94507a59a2fde8405a0f41c6 to your computer and use it in GitHub Desktop.

Select an option

Save cipolleschi/be7644db94507a59a2fde8405a0f41c6 to your computer and use it in GitHub Desktop.
func testExample() throws {
// UI tests must launch the application that they test.
let app = XCUIApplication()
app.launch()
// Use recording to get started writing UI tests.
// Use XCTAssert and related functions to verify your tests produce the correct results.
let tosButton = app.buttons["legal_view.tos_button"]
let privacyButton = app.buttons["legal_view.privacy_button"]
let continueButton = app.buttons["legal_view.continue_button"]
XCTAssertFalse(tosButton.isSelected)
XCTAssertFalse(privacyButton.isSelected)
XCTAssertFalse(continueButton.isEnabled)
tosButton.tap()
XCTAssertTrue(tosButton.isSelected)
XCTAssertFalse(privacyButton.isSelected)
XCTAssertFalse(continueButton.isEnabled)
privacyButton.tap()
XCTAssertTrue(tosButton.isSelected)
XCTAssertTrue(privacyButton.isSelected)
XCTAssertTrue(continueButton.isEnabled)
continueButton.tap()
XCTAssertTrue(app.otherElements["home_view"].exists)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment