As of Xcode 9 there is a new launch argument -StartFromCleanState
that I assume launches the app after a clean install. However it doesn't seem to work and googling -StartFromCleanState
doesn't yield any results so no documentation to go off of.
My goal is to launch my app using a deeplink. The flow of my test is like so:
- The UITest begins by launching the app
- UITest opens safari
- UITest enters the webpage that has the deeplink link
- UITest clicks the link and the App opens up
Step for opens the app by bringing it from background state to foreground state. which means application:didFinishLaunchingWithOptions: only gets called once on step 1.
func test_deeplink() {
programmaticallyTapDeepLink()
XCUIApplication().launchArguments = ["-StartFromCleanState", "YES"]
}
Ideally I would like to test the deeplink when the app is fresh/clean installed.
I have tried setting the launch arguments before/after I Programmatically tap the deeplink but it doesn't seem to work the way I would like it to.
Are there any solutions available for this?