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
Front End Test Automation with Pytest Framework

Front End Test Automation Framework with Pytest Installation and running instructions: 1. To install the framework on your local machine: clone the re

Sergey Kolokolov 2 Jun 17, 2022
Web testing library for Robot Framework

SeleniumLibrary Contents Introduction Keyword Documentation Installation Browser drivers Usage Extending SeleniumLibrary Community Versions History In

Robot Framework 1.2k Jan 03, 2023
A suite of benchmarks for CPU and GPU performance of the most popular high-performance libraries for Python :rocket:

A suite of benchmarks for CPU and GPU performance of the most popular high-performance libraries for Python :rocket:

Dion Häfner 255 Jan 04, 2023
Set your Dynaconf environment to testing when running pytest

pytest-dynaconf Set your Dynaconf environment to testing when running pytest. Installation You can install "pytest-dynaconf" via pip from PyPI: $ pip

David Baumgold 3 Mar 11, 2022
WEB PENETRATION TESTING TOOL 💥

N-WEB ADVANCE WEB PENETRATION TESTING TOOL Features 🎭 Admin Panel Finder Admin Scanner Dork Generator Advance Dork Finder Extract Links No Redirect H

56 Dec 23, 2022
masscan + nmap 快速端口存活检测和服务识别

masnmap masscan + nmap 快速端口存活检测和服务识别。 思路很简单,将masscan在端口探测的高速和nmap服务探测的准确性结合起来,达到一种相对比较理想的效果。 先使用masscan以较高速率对ip存活端口进行探测,再以多进程的方式,使用nmap对开放的端口进行服务探测。 安

starnightcyber 75 Dec 19, 2022
A command-line tool and Python library and Pytest plugin for automated testing of RESTful APIs, with a simple, concise and flexible YAML-based syntax

1.0 Release See here for details about breaking changes with the upcoming 1.0 release: https://github.com/taverntesting/tavern/issues/495 Easier API t

909 Dec 15, 2022
This repository has automation content to test Arista devices.

Network tests automation Network tests automation About this repository Requirements Requirements on your laptop Requirements on the switches Quick te

Netdevops Community 17 Nov 04, 2022
pytest_pyramid provides basic fixtures for testing pyramid applications with pytest test suite

pytest_pyramid pytest_pyramid provides basic fixtures for testing pyramid applications with pytest test suite. By default, pytest_pyramid will create

Grzegorz Śliwiński 12 Dec 04, 2022
A Library for Working with Sauce Labs

Robotframework - Sauce Labs Plugin This is a plugin for the SeleniumLibrary to help with using Sauce Labs. This library is a plugin extension of the S

joshin4colours 6 Oct 12, 2021
Fills out the container extension form automatically. (Specific to IIT Ropar)

automated_container_extension Fills out the container extension form automatically. (Specific to IIT Ropar) Download the chrome driver from the websit

Abhishek Singh Sambyal 1 Dec 24, 2021
A wrapper for webdriver that is a jumping off point for web automation.

Webdriver Automation Plus ===================================== Description: Tests the user can save messages then find them in search and Saved items

1 Nov 08, 2021
Load Testing ML Microservices for Robustness and Scalability

The demo is aimed at getting started with load testing a microservice before taking it to production. We use FastAPI microservice (to predict weather) and Locust to load test the service (locally or

Emmanuel Raj 13 Jul 05, 2022
A tool to auto generate the basic mocks and asserts for faster unit testing

Mock Generator A tool to generate the basic mocks and asserts for faster unit testing. 🎉 New: you can now use pytest-mock-generator, for more fluid p

31 Dec 24, 2022
WomboAI Art Generator

WomboAI Art Generator Automate AI art generation using wombot.art. Also integrated into SnailBot for you to try out. Setup Install Python Go to the py

nbee 7 Dec 03, 2022
PyAutoEasy is a extension / wrapper around the famous PyAutoGUI, a cross-platform GUI automation tool to replace your boooring repetitive tasks.

PyAutoEasy PyAutoEasy is a extension / wrapper around the famous PyAutoGUI, a cross-platform GUI automation tool to replace your boooring repetitive t

Dingu Sagar 7 Oct 27, 2022
Mixer -- Is a fixtures replacement. Supported Django, Flask, SqlAlchemy and custom python objects.

The Mixer is a helper to generate instances of Django or SQLAlchemy models. It's useful for testing and fixture replacement. Fast and convenient test-

Kirill Klenov 871 Dec 25, 2022
It's a simple script to generate a mush on code forces, the script will accept the public problem urls only or polygon problems.

Codeforces-Sheet-Generator It's a simple script to generate a mushup on code forces, the script will accept the public problem urls only or polygon pr

Ahmed Hossam 10 Aug 02, 2022
Docker-based integration tests

Docker-based integration tests Description Simple pytest fixtures that help you write integration tests with Docker and docker-compose. Specify all ne

Avast 326 Dec 27, 2022
A web scraping using Selenium Webdriver

Savee - Images Downloader Project using Selenium Webdriver to download images from someone's profile on https:www.savee.it website. Usage The project

Caio Eduardo Lobo 1 Dec 17, 2021