项目地址:GitHub - SeldomQA/seldom: WebUI automation testing framework based on Selenium
基于 Selenium 和 unittest 的 Web UI 自动化测试框架。
pip install seldom
seldom -project mypro
目录结构如下:
mypro/
├── test_dir/
│ ├── data.json
│ ├── test_sample.py
├── reports/
└── run.py
test_dir/
目录实现用例编写。reports/
目录存放生成的测试报告。run.py
文件运行测试用例。python run.py
2020-05-16 11:34:36,014 INFO
_ _
| | | |
___ ___ | | __| | ___ _ __ ___
/ __| / _ \| | / _` | / _ \ | '_ ` _ \
\__ \| __/| || (_| || (_) || | | | | |
|___/ \___||_| \__,_| \___/ |_| |_| |_|
-----------------------------------------
@itest.info
2020-05-16 11:34:38,798 INFO ✅ Find element: id=kw
2020-05-16 11:34:38,813 INFO 🖋 input 'seldom'.
2020-05-16 11:34:38,991 INFO ✅ Find element: css selector=#su
2020-05-16 11:34:39,004 INFO 🖱 click.
2020-05-16 11:34:40,091 INFO 👀 assertIn title: seldom_百度搜索.
2020-05-16 11:34:40,092 INFO generated html file: file:////Users/tech/mypro/reports/2020_05_16_11_34_36_result.html
.1%
你可以到 mypro\reports\
目录查看测试报告。