Search code examples
iosswiftxcodexctestxcuitest

How to fix wait for app to idle in XCUITest


In my UI test, I sometimes get the Wait for app to idle message in the console. Usually, it's not that often, but now, it always appears and makes the test fails on my mac. This is what I have done so far:

  1. Disabling/enabling animation didn't work
  2. Disabling XCLogger that is used to log to a file didn't work
  3. Disabling IQKeyboardManager didn't work

How do you get a trace of the main thread in UITest to see what's holding it? How do I fix this? Thanks.


Solution

  • Sorry guys, it's my mistake. I have made helper functions to simplify tapping, inserting a string to a textfield, assert for existence, assert for non existence, etc. And at the start of each of those functions, I've added app.activate() to make sure the app is active. So, it happened because I am too cautious.