Examples of automated tests for iOS basic tests

Source: Internet
Author: User

first, the basic premise of iOS testing
There is no basic grammatical error. Basically, it can be run.

Second, test the basic steps of the approximate
requirements, develop test plans, design test cases, implement tests (first to build a test environment), manage tests to find bugs, test completion (test bugs and corrections), write test reports (each of these types: unit tests, integration tests, system tests, validation tests go through these steps.) )

1. Testing Requirements
The test requirements need to be written with the required documentation, and the requirements document is missing.

2. Test Plan
1, the first stage: the improvement of basic functions
2, the second stage: unit Test (whether the expected)
3. Integration Testing

1.1 Basic memory leaks are checked
Shortcut key is Command+shift+b

Instruments tools in 1.2Xcode check memory allocation and memory leaks

2, automated testing of iOS
Tree structure in iOS apps

UIATarget.onAlert = function onAlert(alert) {var title = alert.name();UIALogger.logWarning("Alert with title " + title );target.delay(5);UIALogger.logMessage("message");if (title == "Are you sure to exit?") {    target.delay(5);    alert.buttons()["OK"].tap();    return true;   }return false;

}//test the code that pops up the warning box (this code must be placed before the code that pops up the warning box)

var target = Uiatarget.localtarget ();
Target.delay (2); Delay
var testname = "Test Asiaweiluy";
Uialogger.logstart (testname);
Output day start will have the corresponding end output log
Enter your account
Target.frontmostapp (). MainWindow (). Scrollviews () [0].images () [1].textfields () [0].tap ()];
Target.delay (1);
Target.frontmostapp (). keyboard (). Typestring ("Testwanjomb");
Target.delay (3);
Some common code in the test

Test results:

To test iOS considerations:
Test the problems that arise and some caveats:
1) Gesture recognition is not very high.
2) The test process needs to be reasonable to modify the test code, set the appropriate time distance
3) on Xib: Accessibility (√) enabled or
Code: mytextfield.accessbilityenabled = YES;
4) Note:
1. You must first have this app on your phone
2, look, you must choose the app on the phone, otherwise not

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Examples of automated tests for iOS basic tests

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.