Intermittent “Failure attempting to launch” in ios UITest

前端 未结 1 1898
后悔当初
后悔当初 2021-01-02 22:32

I see this about 1/10 times with my UI Tests on Xcode7.3/iOS9.3

Test Case \'-[WhatevUITests.RegistrationUITests testVerifyUnsupportedPhoneNumberAlert]\' star         


        
相关标签:
1条回答
  • 2021-01-02 23:19

    I had this issue with Xcode 8.3.2 and iOS 10.3 Simulator. All of the tests started failing after updating the Mac OS to Sierra.

    We would see the above exception at:

    XCUIApplication().launch()
    

    and the first time the test tries to access the XCUIApplication() it crashes.

    The fix was to move the XCUIApplication().launch() call to the setUp() function.

    Background

    In our case the problem was multithreading. We wanted to make sure some other code was executed before the app started. That code ran asynchronous and started the app once it returned. The fix makes sure that the app is launched first and on the main thread. Now everything works fine again.

    0 讨论(0)
提交回复
热议问题