Continuous integration of Jenkins+Allure+Pytest

1. Configure allure environment variables

1. Download

allureIt is a command line tool, you can  github download the latest version:https://github.com/allure-framework/allure2/releases

If you want to learn Pytest automated testing, here I recommend a set of videos for you. This video can be said to be the number one interface automated testing tutorial on the entire network at station B. At the same time, the number of online users reaches 1,000, and there are notes to collect and use. Technical exchanges of various great gods: click on the card at the bottom of the article 

The latest pytest interface automated testing framework in 2023 will take you to master pytest in three days and help you write the best code! (The 2023 new version has been updated)_哔哩哔哩_bilibili 2023 latest pytest interface automation testing framework, three days will take you to master pytest and write the best code! (Updated 2023 new version) A total of 32 videos, including: 1. Introduction to Pytest, 2. How to run the pytest test cases of Pytest, 3. What is the order of pytest execution test cases in Pytest? Wait, more exciting videos from the UP master, please pay attention to the UP account. https://www.bilibili.com/video/BV1py4y1t7bJ/?spm_id_from=333.337.search-card.all.click

2. Unzip to local

3. Configure environment variables

  • Copy path such as: F:\allure-2.13.7\bin

  • Environment variable, Path, add F:\allure-2.13.7\bin, save

  • Enter where allure in cmd to see if it can be found 

 Two, Jenkins configuration Allure

 1. Install the allure plugin

System management --> Plug-in management --> Installable plug-ins Search allurefor installation

2. Install Allure Commandline

After installing allurethe plug-in, enter the system management --> global tool configuration, installAllure Commandline

3. Jenkins task configuration build operation

New job--> Add build step --> WindowsBatch command, enter the following command:

#!/bin/bash
cd .jenkins\workspace\allure-test\allure-results
pytest -s -q --alluredir=allure-test/allure-results --clean-alluredir
exit 0

 Note: Add a post-build operation, Allure report, enter reportthe name of the directory: Windowsconsistent with the name of the report directory set in the batch command ( reportthe name is used here)

4. Execute the build and view the report

 

5. View report details

Guess you like

Origin blog.csdn.net/caixiangting/article/details/131331097