문제

UPDATE: Is this still possible with the new way of UI testing with Xcode?

Can I programmatically access my email from an iOS UI Automation script?

I want to access the signup code that my iPhone app emails to my email account.

도움이 되었습니까?

해결책 2

Use NSURLSession to make HTTP requests from within test methods. See: https://stackoverflow.com/a/35708282/242933

다른 팁

If you have a way for your device/simulator to receive the code while still in the app then you can write a script an iOS UIA script to do this.

However with the current state of the built in iOS UIA tool, you cannot access anything that is outside of your app. So basically you cannot launch your app, then launch another app (like safari) go to mail.google.com blah blah.

The closest thing to leaving your app in iOS UIA is using a function call to send your app to background for X amount of seconds.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top