Giter Club home page Giter Club logo

automatorx's Introduction

logo

AutomatorX (atx) (中文版)

Build Status Documentation Status PyPI PyPI Gitter

简介

该项目是为了让手机应用的一些常规测试可以自动化起来,让测试人员摆脱那些枯燥的重复性工作。 基于OpenCV的图像识别技术,有点类似于SikuliX(这东西挺好用的,只是没说要支持手机端)

This project is to make mobile test automated, free people from the boring of repeated job. AutomatorX is a python library base on python-opencv and a lot of outstanding python libs.

ATX is short for AutomatorX

If you are new to atx, it better to start from Quick start tutorial or just view API documentation link

Features

  1. 完全的黑盒测试框架,无需知道项目代码,非侵入式
  2. 支持iOS, Android的自动化测试,两个平台都支持测试第三方应用
  3. 对于iOS的真机,安卓模拟器都能很好的支持
  4. 可以用来测试Windows应用
  5. 对于游戏的测试使用了图像识别
  6. 同一个测试脚本可以通过图像的缩放算法,适配到其他分辨率的手机上

demo-gif

Discuss (讨论群)

面向游戏行业测试人员,当然也开放给国际友人(PS:中文不知道他们看得懂不)

  • Gitter Chat Room
  • QQ: 497460177 PS: 因为我们公司上不了QQ, 所以不会经常上
  • 网易内部用户目前请直接联系 hzsunshx 或加群 1347390

限制

  • 只支持Python2的测试脚本
  • Android 4.1+
  • iOS 9.0+
  • iOS测试必须要有一个Mac

Installation

  1. 安装ATX

    注: iOS的测试一定需要一个Mac 装完之后测试下安装是否成功, python -m atx version 查看atx版本号

  2. 安卓的设备上还需要安装一个ATX手机助手

    可以下载APK到手机, 或者手机连接到电脑上用命令行安装 python -m atx install atx-assistant

    该App为自动化提供了输入法的功能,屏幕常量等功能

Getting Started

To get started, it is better to look at the Quick Start

More about the ATX API here

There is also a doc for professional users. here

Command Line Tools

There are a lot of command tools along with atx, eg

  • Screenshot
  • Screenrecord
  • Install minicap to android
  • Apk file parser
  • Show phone info with JSON
  • Enable iPhone developer mode

etc... To see the whole list click here

Known Issues

If you are having some issues please checkout wiki first.

ATX Extentions

该部分属于atx的扩展插件实现的功能

插件说明

  • HTML Report

    利用此插件可以在ATX自动化跑完之后,自动生成可以HTML报告,详细记录每一步的执行情况

  • Performance record (For Android)

    性能测试直接使用了腾讯开源的GT

    PS: 刚写好没多久,你只能在最新的开发版中看到。有可能以后还会修改。

    使用方法

    1. 首先需要去腾讯GT的主页上,将GT安装到手机上

      http://gt.qq.com

    2. 代码中引入GT扩展

      import atx
      from atx.ext.gt import GT
      
      
      d = atx.connect()
      
      gt = GT(d)
      gt.start_test('com.netease.my') # start test
      # ... do click touch test ...
      gt.stop_and_save()
    3. 运行完测试后,代码会保存到/sdcard/GT/GW/+包名(com.netease.my)目录下,直接使用adb pull下载下来并解析

      $ adb pull /sdcard/GT/GW/com.netease.my/
      

    该部分代码位于 atx/ext/gt.py, 这部分代码目前在我看来,易用性一般般,希望使用者能根据具体情况,进行修改,如果是修改具有通用性,欢迎提交PR,我们会负责Review代码。

代码导读

connect 函数负责根据平台返回相应的类(AndroidDevice or IOSDevice)

图像识别依赖于另一个库 aircv, 虽然这个库还不怎么稳定,也还凑合能用吧

每个平台相关的库都放到了 目录 atx/device下,公用的方法在atx/device/device_mixin.py里实现。第三方扩展位于atx/ext目录下。

相关的项目

  1. 基于opencv的图像识别库 https://github.com/netease/aircv

  2. 感谢作者 https://github.com/xiaocong 提供的uiautomator的python封装,相关项目已经fork到了

  3. Android input method https://github.com/macacajs/android-unicode

  4. SikuliX http://sikulix-2014.readthedocs.org/en/latest/index.html

  5. Blockly https://github.com/codeskyblue/blockly

Articles

  1. 让adb install显示进度
  2. Android 屏幕同步和录制工具
  3. 安卓手机的快速截图
  4. 更多的系列文章 https://testerhome.com/topics/node78

Developer dashboards

  1. Platform Versions, Screen Size, Open GL Version http://developer.android.com/intl/zh-cn/about/dashboards/index.html

Contribution

如何才能让软件变的更好,这其中也一定需要你的参与才行,发现问题去在github提个issue, 一定会有相应的开发人员看到并处理的。文档有错误的话,直接提Issue,或者提PR都可以。 由于我平常使用该项目的概率并不怎么高,所有不少问题即使存在我也不会发现,请养成看到问题提Issue的习惯,所有的Issue我都会去处理的,即使当时处理不了,等技术成熟了,我还是会处理。但是如果不提交Issue,说不定我真的会忘掉。

BTW: 有开发能力的也可以先跟开发者讨论下想贡献的内容,并提相应的PR由开发人员审核。

License

This project is under the Apache 2.0 License. See the LICENSE file for the full license text.

automatorx's People

Contributors

codeskyblue avatar wuxc avatar lucyking avatar jinpf 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.