当前位置:网站首页>Pytest-- test report allure configuration
Pytest-- test report allure configuration
2022-07-02 10:22:00 【Lost ~ know to return】
pytest-- Test report of allure To configure
Environmental installation
The local environment
install jdk1.8, Configure environment variables at the same time
windows Configure environment variables , Right click on my computer , Click properties , Then click Advanced , Enter the following page , Then click on the environment variable
1、 Environment variable configuration , In the system variable , Create a new system variable configuration JAVA_HOME, Path is ,jdk Installation path for (D:\software\java_jdk),
Then click OK
2、 Find... In the system variable path, Add a new path ,%JAVA_HOME%\bin
github download allure Version of the suite :https://github.com/allure-framework/allure2/releases, Configure environment variables at the same time ( Method is the same as above. )
windows In the environment, you need to download allure-pytest plug-in unit
pip install allure-pytest
- Version checking
- pytest Version checking , Input in the terminal
- allure Version checking , Input in the terminal
pytest --version
allure --version

- jdk Installation success check
java

pytest Basic application of
- Test data generation
pytest.main(['--alluredir=./allure-result'])
- Generate a report
os.system('allure generate ./allure-result -o ./report')
- Basic code
# coding:utf-8
import os
import allure
import pytest
def set_01():
print('start')
def set_02():
print('finish')
class TestDemo(object):
"""object"""
def test_01(self):
set_02()
set_01()
print('practice')
def test_02(self):
print('crazy')
if __name__ == '__main__':
pytest.main(['--alluredir=./allure-result'])
os.system('allure generate ./allure-result -o ./report')
Test report 
allure Basic usage of
- Add test execution steps
# coding:utf-8
import os
import allure
import pytest
@allure.step(' The first step of genius ')
def set_01():
print('start')
@allure.step(' Queer's diapers ')
def set_02():
print('finish')
class TestDemo(object):
"""object"""
def test_01(self, fix):
set_01()
set_02()
print('practice')
def test_02(self, fix):
print('crazy')
if __name__ == '__main__':
pytest.main(['--alluredir=./allure-result'])
os.system('allure generate ./allure-result -o ./report --clean')
Running results 
allure Introduction to test report
- Overview: The overview
- Categories: Category , The default is divided failed and error, Any execution result that is one of them will be classified into the class , You can quickly see which use cases are failed and error Of , Support customization
- Suites: test suite , It's the hierarchy of all use cases , According to package、module、 class 、 Method to find the use case
- Graphs: Test results are graphical , Include a distribution diagram of the results of the use case execution , priority , Time consuming, etc
- Timeline: You can see the exact timing of the test case ( Execution order ), Including execution time
- Behaviors: Behavior driven , according to epic、feature、story To group test cases
- Packages: This is according to package、module Let's group test cases

allure Basic use

Event level :
Use case classification
--allure-severities=SEVERITIES_SET
Comma-separated list of severity names.
Tests only with these severities will be run.
Possible values are: blocker, critical, normal, minor, trivial.
blocker: Blocking defects ( Function not implemented , There's no next step )
critical: Serious defects ( Missing function point )
normal: General defects ( Boundary situation , Format error )
minor: Minor defects ( Interface error and ui Demand discrepancy )
trivial: Minor defects ( Must be silent , Or the prompt is not standard )
Description information
@allure.description(‘ Description information ’)
class TestDemo(object):
"""object"""
@allure.story(' Sign in ')
@allure.title(" Perform a login ")
@allure.issue('http:123456789') # bug Link address
@allure.testcase('http:123456789') # Address of function use case
@allure.severity('normal')
# @allure.description(' Description information ')
def test_01(self):
""" Use case name Use case step Expected results """
set_01()
set_02()
print('practice')

边栏推荐
- 渗透测试的介绍和防范
- 2837xd code generation module learning (3) -- IIC, ECAN, SCI, watchdog, ECAP modules
- Blender model import UE, collision settings
- go语言入门
- 网络通信学习
- VLAN experiment
- Mobile mall app solution: how much is it to make an app? Detailed explanation of APP mall development content
- Following nym, the new project Galaxy token announced by coinlist is gal
- Spatial interpretation | comprehensive analysis of spatial structure of primary liver cancer
- How much is it to develop a system software in Beijing, and what funds are needed to develop the software
猜你喜欢

How to judge the quality of primary market projects when the market is depressed?

Post disaster reconstruction -- Floyd thought

Alibaba cloud ack introduction

【虚幻4】从U3D到UE4的转型之路

JS reduce accumulator

Matlab generates DSP program -- official routine learning (6)

阿里云Prometheus监控服务

Ue5 - ai Pursuit (Blueprint, Behavior tree)

How to achieve the top progress bar effect in background management projects

Blender多镜头(多机位)切换
随机推荐
虚幻材质编辑器基础——如何连接一个最基本的材质
Illusion -- Animation blueprint, state machine production, character walking, running and jumping action
Junit5 支持suite的方法
Project practice, redis cluster technology learning (VIII)
Understand the composition of building energy-saving system
Remember a simple Oracle offline data migration to tidb process
C language: making barrels
MySQL index
【Unity3D】无法正确获取RectTransform的属性值导致计算出错
What wires are suitable for wiring on bread board?
UE5——AI追逐(蓝图、行为树)
阿里云SLS日志服务
ICLR 2022: how does AI recognize "things I haven't seen"?
Blender ocean production
【教程】如何让VisualStudio的HelpViewer帮助文档独立运行
2.14 is it Valentine's day or Valentine's day when the mainstream market continues to fluctuate and wait for changes?
ue4材质的入门和原理笔记
【Unity3D】嵌套使用Layout Group制作拥有动态子物体高度的Scroll View
allure--常用配置项
Mobile mall app solution: how much is it to make an app? Detailed explanation of APP mall development content