Search code examples
xcodeswiftkif

Swift UI Testing with Kif


I am working on UI testing in Xcode using Swift and the Kif framework. My question is about AccessibilityLabels. The accessibility labels are dynamic and change, is there a way to use different labels that are static to identify buttons and other actions that take place?

For Example:

 tester().tapViewWithAccessibilityLabel("Apr 29, 2015") 

Where "Apr 29, 2015" is the accessibility label but it changes every day. What other label or identifier can I use?


Solution

  • use accessibilityIdentifier. Identifier should be unique. Import KIF/IdentifierTests