- 博客(5)
- 收藏
- 关注
原创 自动化测试框架Pytest No.5(Pytest:HTML)
pytest-HTML pytest-HTML是一个插件,pytest用于生成测试结果的HTML报告。 兼容Python 2.7,3.6 安装 1.github上源码地址 https://github.com/pytest-dev/pytest-html 2.pip安装 pip install pytest-html 3.执行方法 pytest --html=report.html 执行指令:pytest --html=report.html 执行命令之后,在当前脚本的目录下生成一个r
2021-11-30 13:19:55 107
原创 自动化测试框架Pytest No.4(Pytest:fixture之yield实现teardown)
自动化测试框架Pytest No.4 一、fixture之yield实现teardown pytest中fixture通过scope参数控制setup级别,setup作为用例之前的操作,teardown操作作为用例执行完之后的操作。 fixture的teardown操作并不是独立的函数,用yield关键字唤醒teardown操作。 scope=“module” fixture参数scope=“module”,module作用是整个.py文件都会生效,用例调用时,参数写上函数名称就行。 import pyte
2021-11-30 13:19:46 239
原创 自动化测试框架Pytest No.3(Pytest:fixture)
自动化测试框架Pytest No.3 Pytest配置文件:pytest.ini pytest的配置文件通常放在测试目录下:pytest.ini,pytest.ini 可以修改 pytest 的默认行为。命令行运行时会使用该配置文件中的配置 #配置pytest命令行运行参数 [pytest] addopts= -s …# 空格分隔,可添加多个命令行参数 -所有参数均为插件包的参数配置测试搜索的路径 testpaths= ./scripts # 当前目录下的scripts文件夹 -可自定义 #配置测试搜索的文
2021-11-30 13:19:35 256
原创 自动化测试框架Pytest No.2(Pytest:setup和teardown函数)
自动化测试框架Pytest No.2 Pytest的setup、teardown函数 setup和teardown函数的用例运行级别 模块级(setup_module/teardown_module)开始于模块始末,全局的 函数级(setup_function/teardown_function)只对函数用例生效(不在类中) 类级(setup_class/teardown_class)只在类中前后运行一次(在类中) 方法级(setup_method/teardown_method)开始于方法
2021-11-30 13:19:19 196
原创 自动化测试框架Pytest No.1
自动化测试框架Pytest No.1 pytest是一个非常成熟的全功能的Python测试框架 一、pytest特点: 简单灵活,容易上手,文档丰富; 支持参数化:可以细粒度地控制需要测试的测试用例; 支持 单元测试、功能测试、自动化测试(selenium/appnium)、接口自动化测试(pytest+requests); pytest具有很多第三方插件,支持自定义扩展: pytest-selenium(集成selenium)、pytest-html(完美html测试报告生成)、pytes
2021-11-30 13:18:47 93
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人