Go to file
shao.xiaoping 81069fd572 clear branch 2024-01-30 16:44:48 +08:00
.github/workflows clear branch 2024-01-30 16:44:48 +08:00
.idea clear branch 2024-01-29 11:05:59 +08:00
allure pull demo code 2024-01-19 18:16:19 +08:00
base_page pull demo code 2024-01-19 18:16:19 +08:00
config update github yaml 2024-01-23 15:11:52 +08:00
features pull demo code 2024-01-19 18:16:19 +08:00
file update github yaml 2024-01-23 14:59:59 +08:00
logs update github yaml 2024-01-23 14:50:59 +08:00
page_element pull demo code 2024-01-19 18:16:19 +08:00
page_object update github yaml 2024-01-23 14:42:35 +08:00
step_definitions update github yaml 2024-01-23 14:42:35 +08:00
utils update github yaml 2024-01-23 14:42:35 +08:00
.DS_Store update .gitignore 2024-01-23 14:37:35 +08:00
.gitignore update github yaml 2024-01-23 14:43:22 +08:00
Pipfile pull demo code 2024-01-19 18:16:19 +08:00
Pipfile.lock update github yaml 2024-01-23 14:42:35 +08:00
README.md Update README.md 2024-01-29 15:01:29 +08:00
conftest.py update github yaml 2024-01-22 12:30:45 +08:00
pytest.ini pull demo code 2024-01-19 18:16:19 +08:00
run.py clear branch 2024-01-29 11:05:59 +08:00
web_ui_auto_demo.iml update github yaml 2024-01-23 14:42:35 +08:00

README.md

项目介绍 🚀

Pytest + Playwright + Allure UI自动化demo 目前有的功能:

  • UI自动化POM设计模式
  • Playwright 的基本功能封装(打开网页,元素定位,元素操作,断言)
  • Pytest fixture 常见的使用方式
  • Pytest 命令行各种常用的参数配置
  • Allure 报告用github page的
  • 支持logs封装

项目结构 📚

├── allure                     # 📂 allure包
├── base_page                  # 📂 playwright基本功能进一步封装
├── config                     
│   ├── conf.py                # 🔧 项目目录及文件地址
│   └── config.ini             # 🧪 被测系统相关的配置
├── features                   # 📂 测试特性描述文件
├── file                       # 📂 测试截图文件
├── logs                       # 📂 存放日志的文件夹
├── README.md                  # 📝 项目介绍及使用指南
├── temp                       # 📊 Allure测试结果存放目录                  
├── logs                       # 📂 存放日志的文件夹
├── page_object                # 📑 页面类文件夹按Page Object设计模式划分
│   └── search.py              # 🔐 百度搜索脚本
├── page_element               # 📑 页面元素存放目录
├── pytest.ini                 # ⚙️ pytest配置文件
├── pipfile                    # 📃 项目依赖文件
├── step_definitions           # 📁 测试用例文件夹
│   ├── conftest.py            # 🔧 存放pytest的fixture
│   └── test_search.py         # 🧪 测试用例页面用例
├── report                     # 📁 测试报告存放目录
├── utils                      # 📁 读取配置文件及公共方法封装的目录
├── run.py                     # 📁 执行测试的脚本

快速开始

环境准备 🛠️

  • Python 3.8
  • 环境用的是pipenv来管理的 如果是自主安装搭建环境Pytest + Playwright + Allure + BDD环境可以参考pipfile中的依赖逐一进行安装 安装参考 🎈 如果直接是下载本项目进行搭建安装好pipenv后可以直接安装依赖pipenv install 会自动安装pipfile中的所有依赖

安装浏览器 🌐

playwright install

运行测试并生成报告 🏃

python run.py