iosxcode7xcode-ui-testing

Xcode 7 UI Test Order


I have several UI tests that I can successfully individually or grouped. I ended up breaking my tests up into specific classes and running them that way. The issue I've come across is Xcode executes the UI tests in alphabetical order and not in order it is written/displayed. Any idea on how to get around that?

Thank you


Solution

  • A good test suite shouldn't depend on being executed in a specific order. If yours does, you might have some test pollution. I would add common initialization logic (e.g. logging the user in) to the setUp() method of the relevant tests. Or create a helper method and share that between classes. That, combined with relaunching the app for every test, should make the order of your tests irrelevant.