Watch Star Fork

刘欣 / AirtestPythonApache-2.0

与超过 300 万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
一键复制 编辑 原始数据 按行查看 历史
README.rst 4.35 KB gzliuxin 提交于 2018-04-17 14:26 . level up to 1.0.7 & update reademe


UI Test Automation Framework for Games and Apps



Getting Started

Airtest is a cross-platform automated testing framework focusing mainly on games, but can also be used for native apps. Windows and Android are currently supported; iOS support will be available in the near future. [Roadmap]

Airtest provides cross-platform APIs, including app installation, simulated input, assertion and so forth. Airtest uses image recognition technology to locate UI elements, so that you can automate test on games without injecting any code. The test will generate an HTML report, which allows you to quickly locate failed test cases.

AirtestIDE is an out of the box GUI tool that helps to create and record test cases in a user-friendly way. AirtestIDE provides QA with a complete production workflow: record -> replay -> report

Get Started from Airtest Project Homepage


Use pip to install Airtest python library.

pip install -U airtest

Download AirtestIDE from our homepage if you need to use the GUI tool.


You can find the complete Airtest documentation on readthedocs.


Airtest aims at providing platform independent API, so that you can write tests once and be able to run it on multiple devices.

  1. Using connect_device API you can connect to any android device or windows application.
  2. Then perform simulated input to test your game or app.
  3. And do not forget to make assertions of the expected test result.
from airtest.core.api import *

# connect an android phone with adb
swipe(Template("slide_start.png"), Template("slide_end.png"))

For more detailed info, please refer to Airtest Python API reference or take a look at API code

Running .air from CLI

Using AirtestIDE, you can easily create and author automated tests as .air directories. Airtest CLI provides the possibility to execute tests on different host machine and target device platforms without using AirtestIDE itself.

# run test targeting on Android phone connected to your host machine via ADB
airtest run "path to your .air dir" --device Android:///

# run test targeting on Windows application whose title matches Unity.*
airtest run "path to your .air dir" --device "Windows:///?title_re=Unity.*"

# generate HTML report after running test
airtest report "path to your .air dir"

# or use as python module
python -m airtest run "path to your .air dir" --device Android:///

Try running provided test case: airtest/playground/test_blackjack.air and see Usage of CLI.


Pull requests are very welcome.


Thanks for all these great works that make this project better.

评论 ( 0 )