Airtest Project is a cross-platform UI automation testing framework (Airtest.netease.com) developed by netease. After reading the overall introduction and usage instructions of the framework, the basic functions and features of the framework are summarized as follows. Readers who are interested in UI automation testing for Android, iOS, 3D games and other applications are welcome to take a look

cross-platform

Airtest Project features cross-platform UI automation for the following applications

  • Android app
  • iOS app
  • Windows applications
  • The Web application
  • WeChat small applications (only support system kernel, TBS kernel is still in development, airtest.netease.com/blog/tutori…).

In terms of game applications, apps developed by the following engines are supported

  • Unity3d
  • cocos2dx-js
  • cocos2dx-lua

Runtime environment

The Airtest Project provides an editor AirtestIDE that can write, record and playback scripts. The IDE already provides clients for the following operating systems

  • Mac
  • Windows
  • Linux Ubuntu

Scripting language

The test script is written in Python, compatible with Python 2.7 and Python 3

The core module

1. Poco is used for control identification

Github.com/AirtestProj…

Poco framework is used for parsing and searching the control tree of Unity3D, Cocos2DX -*, Android native APP and iOS native APP to locate UI

For example, control positioning for Android native apps

2. Airtest is used for image recognition

Github.com/AirtestProj…

Airtest framework is used for Android, iOS, Windows, Unity, Cocos2dx, wechat small program application interface image recognition, interface search and positioning

For example, locate or search an image in app

3. The custom

Airtest.netease.com/docs/en/1_o…

Airtest Project can extend recording capabilities as needed, for example

  1. Sets custom parameters in script execution
  2. Add custom functions or replace default functions
  3. Perform operations such as setUp, tearDown before, during, or after the script runs

Connect to the device

You can connect to an Android device in the AirtestIDE easily by enabling the USB debugging of the device

However, connecting to iOS devices requires some configuration, and the following is for iPhone

  1. iOS-Tagent
git clone https://github.com/AirtestProject/iOS-Tagent.git
Copy the code

When starting webDriverAgent. xcodeProj, follow these steps to set up the developer. This is not described in the official configuration

Step 1: Modify the Bundle identifier

Change the value of step 4 in the following figure to be different from the original value. For example, HERE I add a “my” at the beginning.

On the basis of Step 1, set the local Apple ID (if not, add it first).

Change the value of Step 2 in the following figure to exactly the same as in Step 1

If this is not successful, please refer to my previous article: Appium V1.15.1 environment configuration on iOS real machine. There are a lot of third-party libraries that WebDriverAgent relies on, and they are also used in Appium, which I describe in more detail in this article

In addition, if you encounter the following error, Test Failed, trust Apple Development in general-device Management as prompted

2. Configure port mapping

Installation Agent:

$ brew install libimobiledevice
Copy the code

Port mapping:

$ iproxy 8100 8100
Copy the code

3. Run the Mac browser to view the iPhone UI

http://127.0.0.1:8100/inspector

Write in the back

Airtest Project is very powerful in terms of platform coverage. Thanks to the control recognition in image mode, it can be better applied in games and UI positioning scenarios where control mode cannot be used. In addition, as scripting in Python can support more third-party libraries, its expansibility is strong. It is suitable for developing scripts for specific requirements and is very testers friendly. Script recording is quick and easy, and even automated UI testing can be achieved for readers who do not know how to write Python code