I am trying out KIF for iOS testing and am having trouble with UITextField interactions.
I am using the following code for adding text in a textfield.
KIFTestScenario *scenario = [KIFTestScenario scenarioWithDescription:@"Test that a user can successfully log in."];
[steps addObject:[KIFTestStep stepToEnterText:@"test text" intoViewWithAccessibilityLabel:@"username"]];
The problem is that, this method responds if ‘username’ text is the value of textfield, instead if its ID or label as it might seem.
Is there a way by which I could access the textfield with its ID / label? (since I intend to have my textfield empty)
I think that as long as you don’t set an accessibilityLabel yourself, the UITextField uses its text value as accessibilityLabel.
Set the accessibilityLabel of the TextField and you should be fine.