Android automation project with pytest+appium

Overview

APPIUM-AUTO-APP

一、介绍

pytest+appium 安卓自动化项目

二、软件架构

┌ common  
│   └ 基础方法  
│       └ BasePage.py 封装基本方法  
├ config  
│   └ 配置文件  
│       └ devices.yaml 管理测试机  
│       └ env.py 环境变量  
├ logs  
│   └ 日志报告  
├ pages  
│   └ 页面元素  
│       └ 继承BasePage编写对应page的文件  
├ report  
│   └ allure报告  
├ result  
│   └ html报告  
├ screen  
│   └ 截图文件
├ static  
│   └ 存储文件,如需上传的图片等(暂未使用)  
├ testcases  
│   └ 业务测试用例  
│       ├ conftest.py 公共操作文件(如登录)  
│       ├ test开头或结尾的测试用例  
│       └ run.py 用例启动文件  
├ utils  
└   └ 辅助功能函数  

三、安装教程

  1. pip install -r requirements.txt
  2. utils\appium_util.py第17行,编辑修改为本机的appium路径。
    注意最后是appium\build\lib结尾的。
    appium的安装路径配置环境变量,如APPIUM_HOME = 'C:\Users\XX\AppData\Local\Programs\Appium\resources\app\node_modules\appium\lib',注意android sdk的环境变量名要配置为ANDROID_HOME
  3. config\devices.yaml添加自己的设备,
    testcases\conftest.py中会根据devices.yaml来启动设备,返回driver_list,测试用例里传入driver来控制操作对应设备
  4. config\env.py是存储环境变量的文件,如账号密码等,可酌情使用

四、使用说明

  1. Page-Object设计思想
  2. testcases/run.py启动测试
  3. 如果项目第一次跑报错,请根据架构创建对应缺少的文件夹
  4. 项目中会用命令行启动appium服务,可不手动启动appium_desktop,具体看utils\appium_util.py文件
  5. pytest格式限制:
    5.1 测试用例文件是用test_开头或_test结尾的py文件
    5.2 测试用例的类用Test开头,测试类中不应该有构造函数
    5.3 测试用例中的方法用test_开头
  6. testcases\conftest.py只提供调起driver等非业务的公共方法,如果是业务的公共操作如登录, 建议在testcases业务子目录下新增conftest.py
Wraps any WSGI application and makes it easy to send test requests to that application, without starting up an HTTP server.

WebTest This wraps any WSGI application and makes it easy to send test requests to that application, without starting up an HTTP server. This provides

Pylons Project 325 Dec 30, 2022
Cornell record & replay mock server

Cornell: record & replay mock server Cornell makes it dead simple, via its record and replay features to perform end-to-end testing in a fast and isol

HiredScoreLabs 134 Sep 15, 2022
A Django plugin for pytest.

Welcome to pytest-django! pytest-django allows you to test your Django project/applications with the pytest testing tool. Quick start / tutorial Chang

pytest-dev 1.1k Dec 31, 2022
Main purpose of this project is to provide the service to automate the API testing process

PPTester project Main purpose of this project is to provide the service to automate the API testing process. In order to deploy this service use you s

4 Dec 16, 2021
Make Selenium work on Github Actions

Make Selenium work on Github Actions Scraping with BeautifulSoup on GitHub Actions is easy-peasy. But what about Selenium?? After you jump through som

Jonathan Soma 33 Dec 27, 2022
Connexion-faker - Auto-generate mocks from your Connexion API using OpenAPI

Connexion Faker Get Started Install With poetry: poetry add connexion-faker # a

Erle Carrara 6 Dec 19, 2022
:game_die: Pytest plugin to randomly order tests and control random.seed

pytest-randomly Pytest plugin to randomly order tests and control random.seed. Features All of these features are on by default but can be disabled wi

pytest-dev 471 Dec 30, 2022
User-interest mock backend server implemnted using flask restful, and SQLAlchemy ORM confiugred with sqlite

Flask_Restful_SQLAlchemy_server User-interest mock backend server implemnted using flask restful, and SQLAlchemy ORM confiugred with sqlite. Backend b

Austin Weigel 1 Nov 17, 2022
Pytest-rich - Pytest + rich integration (proof of concept)

pytest-rich Leverage rich for richer test session output. This plugin is not pub

Bruno Oliveira 170 Dec 02, 2022
Whatsapp messages bulk sender using Python Selenium.

Whatsapp Sender Whatsapp Sender automates sending of messages via Whatsapp Web. The tool allows you to send whatsapp messages in bulk. This program re

Yap Yee Qiang 3 Jan 23, 2022
Switch among Guest VMs organized by Resource Pool

Proxmox PCI Switcher Switch among Guest VMs organized by Resource Pool. main features: ONE GPU card, N OS (at once) Guest VM command client Handler po

Rosiney Gomes Pereira 111 Dec 27, 2022
Automated mouse clicker script using PyAutoGUI and Typer.

clickpy Automated mouse clicker script using PyAutoGUI and Typer. This app will randomly click your mouse between 1 second and 3 minutes, to prevent y

Joe Fitzgibbons 0 Dec 01, 2021
Sixpack is a language-agnostic a/b-testing framework

Sixpack Sixpack is a framework to enable A/B testing across multiple programming languages. It does this by exposing a simple API for client libraries

1.7k Dec 24, 2022
Python selenium script to bypass simaster.ugm.ac.id weak captcha.

Python selenium script to bypass simaster.ugm.ac.id weak "captcha".

Hafidh R K 1 Feb 01, 2022
A set of pytest fixtures to test Flask applications

pytest-flask An extension of pytest test runner which provides a set of useful tools to simplify testing and development of the Flask extensions and a

pytest-dev 433 Dec 23, 2022
A pytest plugin to skip `@pytest.mark.slow` tests by default.

pytest-skip-slow A pytest plugin to skip @pytest.mark.slow tests by default. Include the slow tests with --slow. Installation $ pip install pytest-ski

Brian Okken 19 Jan 04, 2023
This repository contains a set of benchmarks of different implementations of Parquet (storage format) <-> Arrow (in-memory format).

Parquet benchmarks This repository contains a set of benchmarks of different implementations of Parquet (storage format) - Arrow (in-memory format).

11 Dec 21, 2022
The definitive testing tool for Python. Born under the banner of Behavior Driven Development (BDD).

mamba: the definitive test runner for Python mamba is the definitive test runner for Python. Born under the banner of behavior-driven development. Ins

Néstor Salceda 502 Dec 30, 2022
UX Analytics & A/B Testing

UX Analytics & A/B Testing

Marvin EDORH 1 Sep 07, 2021
A collection of testing examples using pytest and many other libreris

Effective testing with Python This project was created for PyConEs 2021 Check out the test samples at tests Check out the slides at slides (markdown o

Héctor Canto 10 Oct 23, 2022