Giter Site home page Giter Site logo

atxdemo's Introduction

简介

使用uiautomator2+pytest+allure进行Android的UI自动化测试

环境搭建

pytest框架

pip install pytest==3.7

allure报告

命令:
py.test --alluredir=reports
allure generate reports
allure generate reports --clean
allure generate --clean reports -o myreport
用火狐浏览器打开,chrome会404

uiautomator2官方文档

https://github.com/openatx/uiautomator2

安装atx-agent

pip uninstall uiautomator2
pip install --pre uiautomator2
python -m uiautomator2 init

查看页面元素

pip install weditor
python -m weditor

运行命令

测试单个方法: pytest -k test_home_search --alluredir=reports -s
测试单个用例:pytest -s testcase/test_find.py
测试PO级Case: pytest -v -m "P0" --alluredir=reports
不测试PO级Case: pytest -v -m "not P0" --alluredir=reports

生成报告

allure generate --clean reports -o myreport

无线连接

手机的ip地址需要和pc电脑的ip地址在一个网段上
d = ut2.connect("192.168.129.93")

学习笔记

https://docs.pytest.org/en/latest/example/simple.html

iOS环境搭建

查看设备中app列表 ideviceinstaller -u 86616cbaa40e52d3f9236ec982dd6f1e933a44bd -l

浅谈自动化测试工具 python-uiautomator2 https://testerhome.com/topics/11357

atxdemo's People

Watchers

James Cloos 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.