Earlgrey iOS Automated UI test (integration)

Source: Internet
Author: User

Currently, there are few UI-related automated tests for iOS development.

Currently Xcode provides UI Automation,ui testing Bundle, both of which have the advantage of automatically generating test code by recording a real simulator or a real-world operation. And no need for an extra environment, just need xcode. But the flaws are obvious, Is the automatic generation of code enforceability, and maintainability is poor. Minor changes on the page will cause the case to not work properly.

Earygrey is a set of iOS UI testing frameworks provided by Google, based on the unit testing Bundle, which ensures that page elements can be obtained through matcher and Condition,matcher. condition to ensure that case execution succeeds through conditional judgment.

Earygrey integration has two ways, one is through Cocoapods, one is github to download the source code itself to build the framework to add dependencies

Source Address: Https://github.com/google/EarlGrey

Earygrey Integration:

1. Create a new test target in the project where you need to test and select "IOS Unit testing Bundle".

2. Create a new target import earlgrey.framework (this article uses its own compiled framework)

3. New Target,build phases>add new Copy File phases (reference image)

4. New Scheme,product>scheme>new Scheme,target Select New test

5. Edit Scheme,product>scheme>manager schemes, just new Scheme Select shared

6. Edit the original target Scheme

   Key: ' dyld_insert_libraries '   Value: ' @executable_path/earlgrey.framework/earlgrey '

7. Test target New TestCase

-(void) testexample {[[Earlgrey Selectelementwithmatcher:grey_keywindow ()]     assertwithmatcher: Grey_sufficientlyvisible ()];}

8.command+u performing Tests

How to test automatically?

' Platform=ios simulator,name=iphone 6,os=9.3 ' tail -F Test.log

The Xcodebuild Terminal command executes the unit test. This allows for timed execution and statistical output logs.

Earlgrey is a more complete set of UI automated testing solutions that previously relied too much on labor. This automated test approach will greatly increase efficiency.

Earlgrey iOS Automated UI test (integration)

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.