1

We have some UI Tests which open links in an external app (Safari). After verifying Safari is launched, the tests uses the “activate” method on XCUIApplication to return to the application and continue with the test. Starting with Xcode 12.5 the command often fails with an assertionFailure and a message "Application cannot be launched because it has outstanding termination assertion”.

We already attempted waiting for a given time, “manually” tapping the home button to return to the Springboard before calling “activate”, but none of these solutions seems to work.

francybiga
  • 960
  • 1
  • 8
  • 16
  • I hopped into my code to see how I do this and the answer was an automation design one - I don't do it. When I assert Safari has launched (and assert some things inside it), my test is complete; I only ever assert things at one step in my tests. Perhaps you can rework your tests in some way that ends them at launching and asserting Safari? – Mike Collins Jun 01 '21 at 16:32
  • 1
    Indeed it's what I've done to workaround the issue at the moment. But for some use cases I would like to be able to open the app again, for example to verify that some UI updates after enabling notifications in Settings. – francybiga Jun 03 '21 at 07:44
  • Did you manage to resolve this problem? – user431791 Apr 03 '22 at 19:59

0 Answers0