I'm using Calabash framework for test automation and there's a need to automate the sign up scenario of an Android/IOS application.
Just so happens that is that one of the sign up steps is to link to a Paypal account.
At least for Android, I can confirm that the Paypal/Braintree SDK opens the default external browser for the user to complete the linking process, when this happens Calabash framework cannot interact with the browser and the test hangs.
Can I force Paypal SDK to use an embedded webview for the linking process? If not, does anyone picture another way of automating this scenario?
Although this is a common scenario (i.e. facebook sign in, Google sign in etc...) unfortunately neither calabash framework currently provide a documented way to interact with 3rd party applications. The limitation lies in security features of both operating systems which disallow automation to jump outside of its process (and mobile browsers are separate processes).
However, as I mentioned this is a common scenario so there is a solution: we generally advise people to use something called "backdoor methods", which are methods inside of your application that you can trigger directly from calabash. Documentation is available for iOS and Android from Xamarin's official docs pages.
The idea is that you'd create a backdoor method in your application that simulates the user having successfully logged in/done whatever via Paypal/facebook/whatever. When you get to the part in your test where the user would normally go to that third party app, you instead invoke the backdoor.
Consider also philosophically: what happens if Paypal/facebook/whatever is down? What if the user isn't able to log in due to factors outside of your application's control? It doesn't make sense for your app's test to fail in this case, because the failure is unrelated to your application. In other words, backdoors allow you to test your app, not Paypal.
Hope this is helpful, please let me know if you'd like more info.