Disable animations during UI Testing

suggest change

XCUIApplication does not treat an animations environment value as a switch. The app under test has to turn its own animations off. Pass a launch argument, and check it at startup:

app.launchArguments.append("UITEST_DISABLE_ANIMATIONS")

app is the XCUIApplication. In the app, before the first screen appears:

if ProcessInfo.processInfo.arguments.contains("UITEST_DISABLE_ANIMATIONS") {
    UIView.setAnimationsEnabled(false)
}

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents