I’m using bwoken for iOS UI testing, which, under the hood, uses UIAutomation to run all tests.
I’ve setup a really simple sample application with two buttons and a small 1.5 second animation at startup – all I test for is to see that both buttons are actually available in the view.
This simple test case fails about 1/3 of all test runs.
See my attached test case:
#import "../../../../tuneup/tuneup.js"
test "Initial screen has two buttons", (target, app) ->
target.delay(2) # wait until animation is over
window = app.mainWindow()
assertNotNull window.elements()["buttonA"], "buttonA is missing"
assertNotNull window.elements()["buttonB"], "buttonB is missing"
Any ideas on why that is?
I’ve checked for common errors:
- the accessibilityLabel is set correctly
- the tests fail even if the animation at startup is disabled
- adding / removing delays doesn’t change the problem
The proper method is to make it even simpler. Remove animation. Test for existence of one button. I have a feeling it’s the animation. Also, it helps to paste in the exact log errors/printouts you’re getting.