一、环境部署
首先Python环境是必须要装的,其次是pycharm工具,和pytest库,其它可以按需要选择安装:
库/插件/工具
安装方法
用途
1
安装python 3.x
2
安装pycharm
3
安装pytest库
pip install pytest
4
安装yaml
pip install pyyaml
配置文件
5
安装pytest -html
pip install pytest-html
生成html报告
6
安装pytest-xdist
pip install pytest-xdist
分布式插件
7
安装pytest-ordering
pip install pytest-ordering
自定义用例执行顺序
8
安装pytest-repeat
pip install pytest-repeat
重复执行
9
安装allure
pip install allure-pytest
描述测试用例
二、用例设计原则
主要有四点:
1、测试用例的文件名以test_*.py或*_test.py命名;
2、方法或函数以test_开头;
3、类以Test_开头;
4、所有的包必须要有__init__.py文件。
另外,想