Skip to content

Instantly share code, notes, and snippets.

@raxxpack
Created February 18, 2020 20:08
Show Gist options
  • Save raxxpack/b93bd4b930528d86e411d285510fda07 to your computer and use it in GitHub Desktop.
Save raxxpack/b93bd4b930528d86e411d285510fda07 to your computer and use it in GitHub Desktop.
XCUIApplication Extension - Launch Settings
extension XCUIApplication {
/// Launches the Settings app and verifies that the initial screen exists.
static func launchSettingsApp() -> XCUIApplication {
let app = XCUIApplication(bundleIdentifier: "com.apple.Preferences")
// Launch, terminate and again launch the Settings app to ensure we are in a clean state.
app.launch()
app.terminate()
app.launch()
app.navigationBars["Settings"].waitForIt()
return app
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment