Created
November 28, 2017 11:46
-
-
Save raven/d1baecb09b9f836875d7fdcb04da1893 to your computer and use it in GitHub Desktop.
Launching Mobile Safari for iOS UITests with a specific URL
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
// Get a hold of Mobile Safari | |
let safari = XCUIApplication(bundleIdentifier: "com.apple.mobilesafari") | |
// Pass in the launch arguments to open specific url immediately | |
safari.launchArguments = ["-u", "http://google.com"] | |
safari.launch() | |
// If using deeplinks, you will need to accept the prompt | |
safari.buttons.matching(identifier: "Open").firstMatch.tap() |
@pattu777 There should be a way to have it tap the URL bar, then enter a URL, and a return tap. I do have it in a UI test, I can't get at the code until tomorrow tho :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
-u
argument fails for iOS v12.2 on new iPads. Any workarounds..??