Better solution for holding app finish after all UI tests finished [closed]


I've been working with iOS UI tests in the past few weeks and besides KIF I've been using Fastlane to check my code and some other stuff like releasing to Fabric and TestFlight. One of the great features of Fastlane is 'snapshot', which takes screenshots of every screen on every language of the app and then gives you everything on a silver plate, pretty sweet. Problem is: It uses XCUI so it does not work with KIF. I had to do a workaround that seems pretty much hacky and maybe there is already a better solution for this on the framework and I could not find it, anyways my problem was that after all the tests have finished I had to force a waiting interval so I could upload screenshots that I took programmatically. My solution was to run a while loop with a flag being changed on a callback after the completion block was called on the request. I do not have the code snippet with me right now but I will edit this question soon with it. My question basically is: Is there a better way to do this? I've tried to use semaphores and other GCD stuff that did not work out, I was always deadlocked or un-useful wait. I did semaphore in distinct queues etc, nothing of that worked ... It's not a problem for me to lock the main thread because this code will only run on a test scheme.

asked by anonymous 29.09.2017 / 23:44

0 answers