A must-see for software testing

Allure's test report is what the boss likes. Why choose other test report types if you can use allure? Python's pytest unit testing framework has an allure plug-in, which can easily use allure test reports in the python automated testing process.

1. Allure installation dependencies

  • Java8 +, JDK1.8+
  • Download the allure installation package
  • Configure environment variables
  • python library pytest-allure

2. Install Java JDK

  • Download the Java JDK .

    If Jenkins is installed, you can use the Jenkins Java environment, usually in the jre/bin directory under the Jenkins installation directory.

  • run under the windows platform

Change and remember the installed path:

Configure environment variables. Right-click on the interface in My Computer, click Properties, and select Advanced System Settings:

Click on Environment Variables:

Configure environment variables:

The cmd command determines whether the sdk is installed successfully:

3. Install allure

  • Download the allure installation package: github.com/allure-fram…
  • Download the installation package to the desired installation directory.
  • Configure environment variables. As with Java, put the path where allure appears in an environment variable.

cmd Enter the command allure to determine whether the installation is successful:

4. Install pytest allure

  
pip install allure-pytest
复制代码

Generate a test report:

  
pytest -s -q --alluredir report/allure/path
复制代码

View allure, this step will open the corresponding allure service, you can view the generated test report on the browser:

  
allure serve report\allure
复制代码

5. Configure Allure on Jenkins

  • Install the Allure plugin in the Jenkins plugin market;
  • Configure the Allure command line in the Jenkins global tools configuration.

  • Configure the Allure report path in the project.

Now there will be an allure icon on Jenkins:

After the build, there will be a history record:

end

Finally, I would like to thank everyone who has read my article carefully. Watching the rise and attention of fans all the way, there is always a need for ritual exchanges. Although it is not a very valuable thing, if you can use it, you can take it directly.

These materials should be the most comprehensive and complete preparation warehouse for friends who do [software testing]. This warehouse has also accompanied me through the most difficult journey. I hope it can also help you! Everything should be done as early as possible, especially in the technology industry, and the technical foundation must be improved. I hope to be helpful…….

Guess you like

Origin blog.csdn.net/jiangjunsss/article/details/124343938