Giter Club home page Giter Club logo

airtest's Introduction

Airtest

UI Test Automation Framework for Games and Apps

跨平台的UI自动化测试框架,适用于游戏和App中文版点这里

image

Getting Started

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

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 points.

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

Get Started from Airtest Project Homepage

Installation

Use pip to install Airtest python library.

pip install airtest

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

Documentation

You can find the complete airtest documentation on readthedocs.

Example

Airtest aims at providing platform independent API, so that you can write test once and run test on different 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
connect_device("Android:///")
install("path/to/your/apk")
start_app("package_name_of_your_apk")
touch(Template("image_of_a_button.png"))
swipe(Template("slide_start.png"), Template("slide_end.png"))
assert_exists(Template("success.png"))
keyevent("BACK")
home()
uninstall("package_name_of_your_apk")

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.

python -m airtest run <path to your air dir> --device Android:///
python -m airtest run <path to your air dir> --device Windows:///?title_re=Unity.*

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

Contribution

Pull requests are very welcome.

Thanks

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

airtest's People

Contributors

adolli avatar felixonmars avatar meteorix avatar rockywhisper avatar trehack avatar xjohn600 avatar yimelia avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.