title: XCUITest Order of Test Execution
body: <p>Is there any known way to influence the order in which test methods are called by <em>XCUITest</em>? Currently it seems to be completely arbitrary which test method is called in which order.</p>
  
  <p>This makes it impossible to define a specific order. In general the way how Xcode manages XCUITest runs is sub-optimal in that you have to define a test function for every single test case. It would be much more desirable to launch a complete test session from only one method so one can structure their own tests in for example session : features : scenarios.</p>
  
  <p>... That's exactly what I'm trying to do because we're following a Calabash-style test structure and a framework I've wrote around XCUITest provides a lot of additional functionality (such as Testrail integration).</p>
  
  <p>I've tried to implement the framework in such a way that all features and scenarios are organized and started from a single <code>test()</code> method. This would work if Xcode would allow for it but as it turns out terminating and launching the app between every scenario is problematic as it causes Main thread stalls or even crashes. So I've added support to our framework to do it the old-fashion Xcode way of having to define a method for every test but the order is messed up by Xcode which messes up the generation of logs and reports for Testrail.</p>