UITests in my project use Messages app to open main application via deep link. But after update Xcode to v.15.0 I found that Messages doesn't work any more. Sending message doesn't take any effect - text just disappears, now new message appears. It makes no difference whether the message contains links or not. Has anyone encountered the same issue? How can this be fixed?
I couldn't find any settings for the Messages app in the simulator.
I've found a workaround for this issue. Just using Spotlight to open links. It's even faster than using Messages.
class LinkHelper {
static func openFromMessages(_ urlString: String) {
XCUIDevice.shared.press(.home)
let spotlight = XCUIApplication(bundleIdentifier: "com.apple.Spotlight")
spotlight.swipeDown()
let textField = spotlight.textFields["SpotlightSearchField"]
textField.tap()
textField.tap(withNumberOfTaps: 3, numberOfTouches: 1)
textField.typeText(urlString)
if spotlight.buttons["Continue"].exists {
spotlight.buttons["Continue"].tap()
}
sleep(2)
let searchButton = spotlight.buttons["Search"]
searchButton.tap()
spotlight.collectionViews.cells.firstMatch.tap()
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With