xcuitest

Open universal links (deep links) with XCUITest


I would like to create several tests for native iOS application. To be more precise, I want to test deep links. But I am not sure how to trigger deep link with XCUITest and I don't really see how launch() and launcArguments (https://developer.apple.com/documentation/xctest/xcuiapplication) can help me. Did anybody have a chance to open deep link with XCUITest?


Solution

    1. Set safari as app like this

      let safari = XCUIApplication(bundleIdentifier: "com.apple.mobilesafari")

    2. Open your email in safari

    3. Tap on the link
    4. Normally assert some element on app