iOS automated UI test--kif using Share

Source: Internet
Author: User

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

    • Introduction Kif

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.

    • Import Kif

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"];

    • Tips

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;

    • Encounter the Pit

Pod ' KIF ',: configurations = [' Debug ']
Pod ' kif/identifiertests ' #此处错误;

Causes file loss within target support files and headers folders;

    • Reference URL

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.