当前位置:网站首页>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 )
边栏推荐
- pip install pyodbc : ERROR: Command errored out with exit status 1
- 开源与安全的“冰与火之歌”
- Smart street lamp based on stm32+ Huawei cloud IOT design
- 视频融合云平台EasyCVR增加多级分组,可灵活管理接入设备
- Awk command exercise
- Interpretation of Flink source code (I): Interpretation of streamgraph source code
- node の SQLite
- Quick start of Hongmeng system
- Xin'an Second Edition: Chapter 24 industrial control safety demand analysis and safety protection engineering learning notes
- 10 advanced concepts that must be understood in learning SQL
猜你喜欢

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

Flink parsing (VII): time window

Grafana 9 is officially released, which is easier to use and more cool!

Interview shock 62: what are the precautions for group by?

pip install pyodbc : ERROR: Command errored out with exit status 1

Flink parsing (III): memory management

FlutterWeb瀏覽器刷新後無法回退的解决方案

Start job: operation returned an invalid status code 'badrequst' or 'forbidden‘

OpenCV中如何使用滚动条动态调整参数

传统家装有落差,VR全景家装让你体验新房落成效果
随机推荐
Easy introduction to SQL (1): addition, deletion, modification and simple query
Yarn: unable to load file d:\programfiles\nodejs\yarn PS1, because running scripts is prohibited on this system
开源与安全的“冰与火之歌”
Solid principle
Guidelines for preparing for the 2022 soft exam information security engineer exam
Concept and basic knowledge of network layering
Establishment of graphical monitoring grafana
Debug xv6
10 advanced concepts that must be understood in learning SQL
The art of Engineering (2): the transformation from general type to specific type needs to be tested for legitimacy
Development and practice of lightweight planning service tools
The art of Engineering
Remote code execution penetration test - B module test
FlutterWeb瀏覽器刷新後無法回退的解决方案
Selenium test of automatic answer runs directly in the browser, just like real users.
The art of Engineering (3): do not rely on each other between functions of code robustness
基本磁盘与动态磁盘 RAID磁盘冗余阵列区分
Start job: operation returned an invalid status code 'badrequst' or 'forbidden‘
Mysqlimport imports data files into the database
微信小程序获取手机号