This document records the process and steps of the initial report generation with allure.
Install allure first, download and configure the environment
reference documents:
https://www.cnblogs.com/wsy1103/p/10530397.html
After installation, the following steps begin:
Step 1: generate report data with assure. The generated report data includes two files: one JSON file and one TXT file.
Switch to D: Python/Test & gt; The following is implemented:
hrun test_post_api.json --alluredir=report
Step 2: create the report data generated just now with assure, generate the report2 folder, – O means to specify the folder to generate the report, – C means to clean up the previous report directory before generating the report.
allure generate D:\Python\test\report -o D:\Python\test\report2 -c
Then open the assure report using the default browser to view it.
allure open D:\Python\test\report2
end. The effect of successful generation:
[frequently asked questions]
1. If the error prompt oserror: [winerror 6] handle is invalid, please refer to the document for solution:
https://ask.csdn.net/questions/3017114
Add some code to runner. Py’s test_ Start method, and import colorama, Sys at the beginning of the file
2. If the Chinese encoding in the return body fails, please refer to the document for solution:
https://blog.csdn.net/zjxht62/article/details/116305944
Add some code to the log of client. Py_ In the print method, the default ASCII encoding is used for Chinese when json.dumps is serialized. To output real Chinese, you need to specify ensure_ ascii=False
[allure grammar]
$Hrun — alluredir allure results — clean alluredir # when the use case format is py file, you can replace “Hrun” with “pytest”, which has the same effect
– alluredir: generate the original data of allure report
allure results: save location of the original data
– clean alluredir: clear the historical data of allure results
$assure generate assure results – O assure report
– O specify the folder to generate the report
– C clean up the previous report directory before generating the report
Assure open assure report: start the default browser to open the assure test report
Read More:
- When generating a test report in HTML format, report [typeerror: a bytes like object is required, not ‘STR’]
- [Solved] emulator: glteximage2d: got err pre 🙁 0x502 internal 0x1908 format 0x1908 type 0x1401
- Apache Groovy——java.lang.NoSuchMethodError: x.x.x: method <init>()V not found
- Python generates (x, y, z) 3D coordinate sequence
- After JQ gets the tag element itself, it gets its own HTML text format (find only finds one level of child elements)
- RuntimeError: Expected hidden[0] size (x, x, x), got(x, x, x)
- Ubuntu18.04 x11vnc failed, report error opening logfile: /var/log/x11vnc.log
- Vscode HTML file auto supplement HTML skeleton failure
- Has HTML webpack plugin been installed, or error: cannot find module ‘HTML webpack plugin’
- invalid connection string format, a valid format is host:ip:port
- Convert Tencent video QLV format to MP4 format
- How to use JavaScript in HTML
- Call Excel to report an error (the exception comes from HResult: 0x80010105 (RPC)_ SERVERFAULT))
- CLP: error: getaddrinfo enotfound http://x.x.x.x/
- Win10 account login error report error code: 0x80190001
- module ‘win32com.gen_py.00020813-0000-0000-C000-000000000046x0x1x9‘ has no attribute ‘CLSIDToClassMa
- The problem of “value error: zero length field name in format” in Python 2.6.6 of CentOS 6.9
- Extract audio from ffmpeg video to mp3 format or m4a format command
- HTML echo error, NPM run build error, HTML path error
- 1067 – Invalid default value for ‘sex‘1366 – Incorrect string value: ‘\xE6\x8A\x80\xE6\x9C\xAF…‘ f