Test like a user!
- Demo Automated UI test sample
Demo seconds to version, the whole process of a line test down, registration--Login--Real-name authentication--Credit card authentication--Add register--Credit card payment
The full name of KIF is keep it functional. It is a UI testing framework built on Xctest that uses accessibility to locate specific controls to manipulate the UI.
Target ' member treasure seconds to version Tests ' do
# 3.5.2
Pod ' KIF ',: configurations = [' Debug ']
End
- Writing test cases and explaining common methods
The UI component assigns a value to its own Accessibilitylabel property, for example:self. NAMETEXTF. Accessibilitylabel = @ "NAMETEXTF";
[tester tapviewwithaccessibilitylabel:@ "lijizhucebtn"];
[tester entertext:@ "19902030220" intoviewwithaccessibilitylabel:@ " Phonenumfield "];
[tester cleartextfromandthenentertext:@ " Deng Chao bounded " Intoviewwithaccessibilitylabel :@ "Jiesuanzhanghutext"];
[tester waitfortimeinterval:]; manually enter the verification code
[tester waitforviewwithaccessibilitylabel:@ "DENGLUVC"];
If ([tester tryfindingtappableviewwithaccessibilitylabel:@ "Jumpbutton" Error :Nil]) {
[tester tapviewwithaccessibilitylabel:@ "Jumpbutton"];
}
[tester entertext:@ "0119" intoviewwithaccessibilitylabel:@ "Carddatefield" traits:uiaccessibilitytraitnone expectedresult:@ "01/19"];
The title of the button, the title of the class, can be directly used as the access tag; TextField's placeholder can be used as an access tag, but cannot change the value;
The screen is visible before you can access it. For example: Register button.
Scrolling view, the screen is not range, can respond to clicks. Example: The Submit Audit button in real name authentication;
Pod ' KIF ',: configurations = [' Debug ']
Pod ' kif/identifiertests ' #此处错误;
Causes file loss within target support files and headers folders;
Http://www.cocoachina.com/ios/20170401/18995.html
Http://www.oschina.net/translate/ios-ui-testing-with-kif
iOS automated UI test--kif using Share