Hi,
I have an issue with handling deeplink redirection in Appium.
Context:
I’ve automated a test for an iOS app that requires passing a deeplink in Safari and redirecting back to the app. The issue I’m having is that the deeplink is meant to logout of the app and it has to interact with a native alert. During the deeplink redirection this alert is ‘lost’ i.e. it’s not showing up when the app is reopened. It seems like a race condition, however I’m stuck trying to solve it.
I have tried to use wait()
but the behaviour is still very inconsistent.
Q: Is there a way to open Safari in app?
Any other solutions or ideas?
Code snippet:
//Deep Links//
async openDeepLinkIOS(url: string) {
await driver.execute('mobile: launchApp', {
bundleId: 'com.apple.mobilesafari',
})
const capabilities = driver.capabilities['deviceName']
const urlField = await (capabilities.includes('iPad')
? $('~UnifiedTabBar')
: $('-ios predicate string: label == "Address"'))
await urlField.click()
await driver.sendKeys([url])
await this.pressKeyIOS('go')
//await this.wait(1000)
}