Pytest document 13-allure2 generate HTML report (most detailed in history)

Source: Internet
Author: User

Objective

Allure is a report framework that supports frameworks such as Java junit/testng and, of course, supports Python's pytest framework, and can also be integrated into Jenkins to showcase a tall reporting interface.

Environment preparation

    • 1.python3.6
    • 2.windows Environment
    • 3.pycharm
    • 4.pytest-allure-adaptor
    • 5.allure2.7.0
    • 6.java1.8

* * Shanghai-yo QQ Exchange Group: 588402570**

Pytest-allure-adaptor Download

PIP Installation Pytest-allure-adaptor,github Address Https://github.com/allure-framework/allure-pytest

PIP3 Install Pytest-allure-adaptor

Generate an XML report

Pytest-s-Q--alluredir Report

If you do not specify a path, the default is to create a new report directory under the current directory, or you can specify a path

Pytest-s-Q--alluredir specifying the report path

Open the Report folder after execution, and automatically generate reports in XML format

Install Command Tool

Allure version currently has 2, from GitHub, Allure1 is no longer supported, please consider using Allure2 https://github.com/allure-framework/allure2 instead

Allure-commandline releases version https://github.com/allure-framework/allure2/releases

Download the latest download allure2.7.0 version

[DOWNLOAD Download allure2.7.0 address: Https://dl.bintray.com/qameta/generic/io/qameta/allure/allure/2.7.0/allure-2.7.0.zip]
(Https://dl.bintray.com/qameta/generic/io/qameta/allure/allure/2.7.0/allure-2.7.0.zip)

After downloading, unzip to the directory running Pytest

Open the \allure-2.7.0\bin folder, you will see the Allure.bat file, this path is set to the system environment variable path, so that cmd any directory can be executed

Like my path: D:\YOYO\case\allure-2.7.0\bin.

Run Allure2

Front Pytest-s-Q--alluredir This step has produced a report in XML format, placed in the reports directory, and then executed the following command format

Allure Generate directory-with-results/-o directory-with-report

Directory-with-results is the alluredir generated XML directory, Directory-with-report is the final HTML-generated directory

Allure.bat has been added to the environment variable, so you can use relative paths to generate HTML reports

Allure Generate report/-o report/html

After execution, the directory structure is as follows:

Open Report

Directly find report/html open index.html will show an empty report, here with Pycharm to open

Open Post report Show

Rely on the Java environment

Allure2 is developed in Java and needs to rely on Java environment, JDK version with 1.8 can be
* * Shanghai-yo QQ Exchange Group: 588402570**

Pytest document 13-allure2 generate HTML report (most detailed in history)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.