Daily iOS
Testing

Stabilizing UI tests

A login flow test written in XCUITest fails about 30% of the time on CI. What would you change on the app side to stabilize it?

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

The app prepares to help the test. Give every element an accessibilityIdentifier, and read a UI test mode from launchArguments to register a URLProtocol mock server, disable animations, clear the keychain and UserDefaults, and skip onboarding.

Share a question