Premise:
Download Plugin HTML Publisher plugin
First, installation
After you install HTML Publisher plugin, the option to "Publish HTML reports" appears when you create or edit a project in the "add post-Build action step." As follows:
Second, the configuration
After clicking on the build step above, the configuration item will appear here:
Click "Add" to configure, after the configuration, look at the description of each item, the following from Google Translate:
Following the instructions above, my configuration is as follows:
I only configured the HTML directory to archive entries, which said, this path is relative to the workspace, so I only fill in the relative path. While the rest of the options are configured as needed, I keep the default.
Tip: After I fill out the above, the final output directory is%workspace%/htmlreport/index.html
Note: You cannot use environment variables for paths here.
Note 2: This plugin does not automatically create folders and files according to the path above, so make sure that the folders and files on the path above are already created in the workspace, or there will be an error. In other words, this plugin does not create any HTML content.
This is my new one, in order to demonstrate the effect.
Note 3: This insert does not create any HTML reports, so when you see your HTML content, a blank page appears. If you want the HTML report to appear, you can work with some xunit plugin to generate an HTML report, and then point to the resulting HTML file in the path above. Reference: https://issues.jenkins-ci.org/browse/JENKINS-7242
Third, the test effect
Once configured, save and click "Build Now" to test.
When you're done, there's an HTML report button in the top left corner of the project, which you can click in.
Use of the Jenkins plugin HTML Publisher plugin