pyse
WebUI automation testing framework based on Selenium and unittest.
基于 selenium 和 unittest 的 Web UI自动化测试框架。
特点
默认使用CSS定位,同时支持多种定位方法(id\name\class\link_text\xpath\css)。
基于Selenium二次封装,使用更简单。
提供脚手架,快速生成自动化测试项目。
自动生成/reports/目录,以及HTML测试报告生成。
自带断言方法,断言title、URL 和 text。
支持用例参数化。
增加用例失败重跑。
增加用例失败截图。
安装 > pip install -U git+https://github.com/defnngj/pyse.git@master
pyse命令
1、查看帮助:
> pyse -h
usage: pyse [-h] [-V] [--startproject STARTPROJECT] [-r R]
WebUI automation testing framework based on Selenium.
optional arguments:
-h, --help show this help message and exit
-V, --version show version
--startproject STARTPROJECT
Specify new project name.
-r R run test case
2、创建项目:
>pyse --startproject mypro
2019-11-07 00:24:57,783 - INFO - Start to create new test project: mypro
2019-11-07 00:24:57,784 - INFO - CWD: D:\
2019-11-07 00:24:57,785 - INFO - created folder: mypro
2019-11-07 00:24:57,786 - INFO - created folder: mypro\test_dir
2019-11-07 00:24:57,787 - INFO - created folder: mypro\reports
2019-11-07 00:24:57,788 - INFO - created file: mypro\test_dir\test_sample.py
2019-11-07 00:2