pytest-- generate HTML report

Foreplay

We do automation, test report is essential. To facilitate their view, it can also provide leadership view, a test report can explain what we do something, pytest-html plug-in provides us with a very simple test reports, why simple, because it is really simple, and allure professional the report compared the test, the slightest difference was not a Ding.

pytest-html web may pytest generate a test result is displayed. This HTML report of the test results can (through, skipped, failed, error, is expected to fail, but failure is expected by) screening, but also by the test name, duration, state the results sorted. HTML reports can also customize some elements, such as screenshots and other data sets

use

pip install pytest-html

Usage pytest-html plug-in is very simple, you just add --html = report_name.html option.

After executing the current directory and then generate a file api_test.html, open the

Is so ugly a test report. Later we use professional-grade test report allure to generate test reports.

Guess you like

Origin www.cnblogs.com/zouzou-busy/p/11330036.html