Disabling waiting for idle state in UI testing of iOS apps -
basically problem same one: xctestcase: wait app idle
i using perpetually repeating "background animations" in views. !@#$#$&@ ui testing of xcode/ios wants wait uiview animations end before considers app idle , goes on stuff tapping buttons etc. doesn't work way we've designed app(s). (specifically, have button animated uiviewanimationoptionrepeat | uiviewanimationoptionautoreverse
options, never stops.)
but i'm thinking there might way turn off and/or shorten state "wait app idle". there? how? there other way around this?
unfortunately using apple's ui testing can't turn 'wait app idle' or poll other network activity, can use environment variables disable animations in app make tests more stable. in setup method before test set environment variable this.
override func setup() { super.setup() continueafterfailure = false let app = xcuiapplication() app.launchenvironment = ["uitest_disable_animations" : "yes"] app.launch() }
now in source code:
if (processinfo.processinfo.environment["uitest_disable_animations"] == "yes") { uiview.setanimationsenabled(false) }
you can place check in specific view if want disable animations specific view or in delegate file disable animations throughout app.
Comments
Post a Comment