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
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.
XC testing is incredibly buggy. Sometimes it seems like the direction of the wind or speed of the Earth's rotation will determine if you get a random failure or not. One fix I found that somewhat alleviates these frustrating issues are if you call this is your tearDown() function:
XCUIApplication().terminate()
Where XCUIApplication() is the application that you're running.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With