当前位置:网站首页>Getting started with pytest ----- allow generate report
Getting started with pytest ----- allow generate report
2022-07-06 17:49:00 【Peng Yuyan in the testing industry】
allure Generate test reports
First of all, make sure that allure-pytest plug-in unit
1) If it is Windows System , Want to go Git download 、 decompression 、 To configure path route .
2) If it is Mac, To install allure, I tried brew install allure But the installation failed , Always can't download . Only in a stupid way :
1. download allure
Address https://github.com/allure-framework/allure2/releases download zip file , Then unzip it and put it in the directory you want to put .
2. Make sure you put allure Of bin Where is the folder
hold bin Drag the folder to the terminal , then pwd You can see the path :

3. Mac Configure environment variables
Input... At the terminal :open -t ~/.bash_profile Open profile , Input :
PATH="/Users/macbook/allure-2.17.2/bin:${PATH}"
export PATH

chart 1: The open .bash_profile file

chart 2: Handwritten allure PATH
4. Make the configured environment variables take effect
Back to the terminal , Input source ~/.bash_profile Enable environment variables
5. Input allure --version
Display version number , Prove that the configuration is successful

6. restart pycharm
modify pytest.ini file , stay addopts increase --alluredir ./temp It means setting it up allure Generate json Temporary report path in format ./temp It is put in the current path temp Under the folder .

And then execute pytest
You can see in the temp Many are generated in the folder .json The file of

And then in pytest.main() Add below
os.system("allure generate ./temp -o ./report --clean")

explain :
allure generatecommand , fixed./temptemporary json Path to format report-oOutput output./reportGenerated allure Report path--cleanEmpty report The original report under the folder
In this way report You can see the generated report under the folder

After opening :

There are many areas for improvement in this report , It can be displayed according to your needs , Let's talk about it later .
The following is the supporting information , For doing 【 software test 】 For our friends, it should be the most comprehensive and complete war preparation warehouse , This warehouse also accompanied me through the most difficult journey , I hope it can help you !
Last : It can be in the official account : Programmer Xiaohao ! Get a free copy of 216 Page software testing engineer interview guide document information . And the corresponding video learning tutorial is free to share !, It includes basic knowledge 、Linux necessary 、Shell、 The principles of the Internet 、Mysql database 、 Special topic of bag capturing tools 、 Interface testing tool 、 Test advanced -Python Programming 、Web automated testing 、APP automated testing 、 Interface automation testing 、 Testing advanced continuous integration 、 Test architecture development test framework 、 Performance testing 、 Safety test, etc. .
If my blog helps you 、 If you like my blog content , please “ give the thumbs-up ” “ Comment on ” “ Collection ” One button, three links ! Friends who like software testing , You can join our testing technology exchange group :779450660 There are various software testing resources and technical discussions )
边栏推荐
- Basic configuration and use of spark
- Interview shock 62: what are the precautions for group by?
- EasyCVR电子地图中设备播放器loading样式的居中对齐优化
- Distinguish between basic disk and dynamic disk RAID disk redundant array
- JMeter interface test response data garbled
- 全网最全tcpdump和Wireshark抓包实践
- Run xv6 system
- The shell generates JSON arrays and inserts them into the database
- Example of batch update statement combining update and inner join in SQL Server
- Kali2021 installation and basic configuration
猜你喜欢

Virtual machine startup prompt probing EDD (edd=off to disable) error

面试突击62:group by 有哪些注意事项?

重磅!蚂蚁开源可信隐私计算框架“隐语”,主流技术灵活组装、开发者友好分层设计...
![[ASM] introduction and use of bytecode operation classwriter class](/img/0b/87c9851e577df8dcf8198a272b81bd.png)
[ASM] introduction and use of bytecode operation classwriter class

一体化实时 HTAP 数据库 StoneDB,如何替换 MySQL 并实现近百倍性能提升

10 advanced concepts that must be understood in learning SQL

学 SQL 必须了解的 10 个高级概念

EasyCVR授权到期页面无法登录,该如何解决?

The most complete tcpdump and Wireshark packet capturing practice in the whole network

kivy教程之在 Kivy 中支持中文以构建跨平台应用程序(教程含源码)
随机推荐
Smart street lamp based on stm32+ Huawei cloud IOT design
虚拟机启动提示Probing EDD (edd=off to disable)错误
Concept and basic knowledge of network layering
一体化实时 HTAP 数据库 StoneDB,如何替换 MySQL 并实现近百倍性能提升
It doesn't make sense without a distributed gateway
sql语句优化,order by desc速度优化
Grafana 9 is officially released, which is easier to use and more cool!
The shell generates JSON arrays and inserts them into the database
【Elastic】Elastic缺少xpack无法创建模板 unknown setting index.lifecycle.name index.lifecycle.rollover_alias
Quick start of Hongmeng system
Interview shock 62: what are the precautions for group by?
2022年大厂Android面试题汇总(一)(含答案)
SAP UI5 框架的 manifest.json
The solution to the left-right sliding conflict caused by nesting Baidu MapView in the fragment of viewpager
Establishment of graphical monitoring grafana
微信小程序获取手机号
Uipath browser performs actions in the new tab
Huawei certified cloud computing hica
【MySQL入门】第四话 · 和kiko一起探索MySQL中的运算符
Guidelines for preparing for the 2022 soft exam information security engineer exam