How to open url in Safari and the get back to the app under UITests in Xcode 7?

后端 未结 2 630
时光说笑
时光说笑 2021-02-04 05:45

This is my custom view where \"LondonStreet\" is a button.

When I tap that button I get url and open it in Safari (it works). Then I can go back, u

2条回答
  •  温柔的废话
    2021-02-04 05:50

    UI Testing cannot interact with anything outside of your application. In your scenario, the framework can no longer do anything once your app opens Safari.

    To verify this, try printing out the app's hierarchy once Safari opens. You will notice that nothing in Safari nor the navigation bar will show up - you will only see your app's information.

    print(XCUIApplication().debugDescription)
    

提交回复
热议问题