Xcode 7 UI Testing: Dismiss Push and Location alerts

后端 未结 4 1767
生来不讨喜
生来不讨喜 2020-12-09 08:26

I encountered a problem with Xcode 7 UI Testing.

The app displays two alerts after my user logs in, the Request Location Alert and the Push

4条回答
  •  佛祖请我去吃肉
    2020-12-09 08:47

    As I noted in the answer you mentioned, you must interact with the application after the alert appears.

    Second, after presenting the alert you must interact with the interface. Simply tapping the app works just fine, but is required.

    // add UI interruption handlers
    
    app.buttons["Request Location"].tap()
    app.tap() // need to interact with the app for the handler to fire
    

提交回复
热议问题