How should I test my iPhone app\'s passwordless authentication?
To sign up or log in, UI Testing in Xcode needs the random code that gets emailed to me.
Add your email account to the Mail app. Make sure that Push notifications are enabled.
Set the notifications style for Mail to the Alerts style.
In your UI Tests, add the UI interruption monitor to listen for the alert from Mail, which contains the random two-factor authentication code.
Use NSURLSession
to make HTTP requests from within test methods.
I think you should run UI tests on stage/QA env and as result you can have some backdoor on stage env for UI tests, for example accept code 1111 for all users etc