# ui-test-demo **Repository Path**: gffguo/ui-test-demo ## Basic Information - **Project Name**: ui-test-demo - **Description**: UI自动化Demo - **Primary Language**: Python - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 0 - **Created**: 2021-07-23 - **Last Updated**: 2024-10-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 基于python3 UI自动化整合包Demo #### 介绍 - 主要为python的测试UI自动化 - 目前与最终实现结果的出入较大,暂仅作为deom [comment]: <> (#### 支持内容) [comment]: <> (- 用例脚本的分层机制(po) --- 举例文件已完成) [comment]: <> (- 基本详细的日志记录 --- 已完成(basepage的装饰器 / 单独使用ReadConfiguration.py中已实例化的logger)) [comment]: <> (- 用例运行错误截图 --- 已完成(basepage的装饰器 & conftest文件pytest_runtest_makereport,全部都会添加到allure报告中)) [comment]: <> (- 项目的基本配置文件化 --- 已完成(application.yaml配置,DecorateUtiles.py给类的属性绑定配置文件字段,get_project_elements方法读取project项目配置,读不到返回None)) [comment]: <> (- 统一集成运行 --- 基本已完成) [comment]: <> (- 多设备(多设备分别跑全部用例-兼容性等) --- 已完成) [comment]: <> (- 多设备(多设备一起跑全部用例-主要节约时间) --- 已完成) [comment]: <> (- 传入设备id - 给basepage等,以便多设备os执行一些命令(多设备运行过程中支持获取当前进程中对应设备的设备号) --- 已完成) [comment]: <> (- 是否启动服务&服务操作 - 待完成) [comment]: <> (- 小工具: ) [comment]: <> ( - 定时删除过期报告 --- 已完成) [comment]: <> ( - 给allure报告添加环境展示信息 --- 待接入统一集成运行文件) [comment]: <> ( - 给allure报告添加趋势图 --- 待接入统一集成运行文件) [comment]: <> ( - 运行黑白名单 ---- 已完成) [comment]: <> ( - 自定义服务?装饰器判断使用我写的文件,还是他人写的文件,例如log?service? --- 待完成) #### 环境 - 编程语言 python3+ - android - [ui2(uiautomator2)][https://github.com/openatx/uiautomator2] - iOS-WDA - [wda(WebDriverAgent)][https://github.com/appium/WebDriverAgent] - iOS-python-wda(facebook-wda) https://github.com/openatx/facebook-wda - iOS - [这里也可以用tidevice,个人认为比wda更好用(提前你要有wda的ipa客户端包。)][https://github.com/alibaba/taobao-iphone-device] - pytest - python 第三方测试框架 - allure - 结果报告 ##### wda 安装教程(只有wda安装麻烦一点) - https://www.jianshu.com/p/e5b5936d0c6a - https://www.jianshu.com/p/6ee94ee90f6b #### 安装 - 如使用整合包,直接clone下载下来,定制化自己项目内容即可 - 电脑需自己手动安装allure - 需要自己安装电脑客户端,百度很多,这里不做介绍 - python3 - 百度很多,直接看百度教程 - python库环境直接,大致包含pytest-allure、weditor、python-wda、ui2、pytest框架一些插件 ```pip install -r requirements.txt``` #### 参考 https://github.com/appium/WebDriverAgent https://github.com/openatx/facebook-wda https://github.com/alibaba/taobao-iphone-device https://github.com/openatx/uiautomator2 https://www.jianshu.com/p/e5b5936d0c6a