IOS UITests failed: IDETestOperationsObserverErrorDomain Code = 13

I am running AppUITests for an iOS app from a Jenkins build script. Unit tests (AppTests) are working fine, but AppUITests fail due to the issue below. How can I solve this problem?

09: 19: 53.506 XCTRunner [22911: 77924] Failed to execute background test within 30.0 seconds. 09: 19: 53.507 xcodebuild [22835: 77541] - [IDETestOperationCoordinator testRunnerSession: initializationForUITestingDidFailWithError:] 09: 19: 53.507 XCTRunner [22911: 77924] Call completion. 09: 19: 53,507 xcodebuild [22835: 77541] Test operation failed: Background test runner failed. 09: 19: 53.507 xcodebuild [22835: 77541] _finishWithError: Domain Error = IDETestOperationsObserverErrorDomain Code = 13 "Background tester failed. " UserInfo = {NSLocalizedDescription = Background test failed.} DidCancel: 1

+3


source to share


1 answer


I had the same problem in our application. This was caused by the permission warning shown at startup (APN in this case, but it will probably be the same for any other warning).

Steps to reproduce

  • use an app which will display a startup warning
  • make sure the simulator is clean (to show a warning)
  • run all tests

Result

  • the app launches, shows a warning, and runs (regular) tests just fine
  • BUT when it comes to UITests the simulator will remain black and after a while it will fail the following error:

Domain Error = IDETestOperationsObserverErrorDomain Code = 13 "Background tester failed.



Decision

Run UITests before normal tests (just change the order in edit scheme

=> Test

=> Info

)

Notes:

  • Perhaps you need to make sure that UITests will handle the warning with the method XTest

    addUIInterruptionMonitor

    . Or else it might be possible (regular) tests will work the same (haven't tested this scenario).
  • If you really don't want to run UITests first, you can add an additional UITest target that runs first and just handles the warning. Then you should be able to run the (regular) tests followed by your UITests.

Related

+3


source







All Articles