How to use plug-ins to view the allure jenkins report ----- complete articles (404 and no data to solve problems)

background:

python3 + appium + pytest + allure write automation scripts Andrews, ran through the young man became the allure of this report on the windows machine pycharm. Jenkins company built on linux server.

Pain points:

1.allure report requires a bunch of css / js static data files, in order to display data, to the leadership when a report can not throw throw a big archive, and can not guarantee success can view it ---- edge browser You can open another browser to open no data;

2. The script integrated into jenkins, rounded to the linux server running, they have to toss up a server in the environment out, you need to install the package node, sdk, net, appium, adb barabara, and find many, appium must also ensure is always activated state, the server can not identify the real machine test, with only Andrews simulator test. No need to conclude, on this machine even real test is like.

Expectations: Help people see the visual test report

Solutions:

1. The server is not running the test script, simply use the plug-jenkins allure of view the test report;

2. nginx from a service, put to the test report folder placed in the www directory, configuration about mapping the index.html;

The final selection:

Finally he chose to install a plug-in to go jenkins, relatively simple

Embodiment the steps of:

1. Open jenkins-- Plugin Manager - optional plug-ins, search for the latest version of Allure ;

2. Download allure-commandline  tool: https: //codeload.github.com/allure-framework/allure2/tar.gz/2.12.1, installed on the server / export / runtimes / allure-commandline lower;

3. After installing 1,2 restart Jenkins, the test results generated pytest html and xml two folders upload svn up. Construction of a new project in jenkins, code source: Test results on the path to svn.

 Build step: After the allure generate \ xml_report_path -o \ html_report_path --clean , later found to have executed a two allure generate recording is performed, because the building after the operation added allure-report: No, I wrote at the beginning of the build step this plug-in will automatically go to execute this command does not need people to enter, execute the report after two years but will not have the data.

 Construction of the steps of: increasing the allure-report, as follows:

    These two figures are not the same directory, otherwise it will prompt can not find the allure-report or allure-result path.

          

4. Click constructed, error, suggesting:       java.io.IOException: Allure of Can not the Find the CommandLine <null> , the initial judge may issue a second step allure-commandline, the allure --vresion executed on the server, but also to return the correct version number, indicating that the server allure is no problem. At this time, it is necessary to configure global jenkins up the configuration tool. An alias, check the installed automatically select maven 2.5.1 like. But the situation is more likely to encounter is set up after still reported the same mistake this time, we need to set the following figure:

           

 

      After completion of this setting, the system needs to go set - Add installation directory global attributes:

      

 

       This time to perform, you will find will not be reported to the wrong allure-commandline not find the.

5. Build again, allure and trends report came out, click allure-report will be able to jump to the correct page of the report.

       

 

Guess you like

Origin www.cnblogs.com/qingyuu/p/11209160.html