java 如何在 Jenkins 中配置 Selenium HTML 报告

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13082425/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-31 11:25:40  来源:igfitidea点击:

How to configure Selenium HTML Reports in Jenkins

javaseleniumjenkinsjenkins-pluginsmojo

提问by

We have a Java MOJO configured in Jenkins. Once the code is build in CI, surefire reports would be generated. We have Junit and Selenium test cases to test the application.

我们在 Jenkins 中配置了一个 Java MOJO。在 CI 中构建代码后,将生成万无一失的报告。我们有 Junit 和 Selenium 测试用例来测试应用程序。

I need to present the results coming from the test cases in a HTML format. Is there any plugin available for Jenkins to display the content in HTML format?

我需要以 HTML 格式呈现来自测试用例的结果。是否有任何插件可用于 Jenkins 以 HTML 格式显示内容?

采纳答案by Anil Kumar C

First you need to install the Selenium HTML Report Plugin. If you are not aware of installing the plugin, use this link

首先,您需要安装Selenium HTML 报告插件。如果您不知道安装插件,请使用此链接

After installing the Selenium HTML report plugin, Add the post build script to generate the HTML content from the surefire reports. Use the following screenshot for configuring the HTML plugin..

安装 Selenium HTML 报告插件后,添加后期构建脚本以从 Surefire 报告生成 HTML 内容。使用以下屏幕截图来配置 HTML 插件..

Configuring the SeleniumHTML Report plugin in Jenkins

在 Jenkins 中配置 SeleniumHTML 报告插件

Change the ProjectRootwith your MOJO

使用您的 MOJO更改ProjectRoot

回答by karthick

  1. Install "Selenium HTML Report Plugin" into jenkins.
  2. In the post build action add below actions.

    action 1: Publish Selenium HTML Report

    value: */(Job Name)/workspace/   --> note: (place your test resultFile in this folder)

    action 2: Publish Selenium Report

    value: */(Job Name)/workspace/.html

  1. 将“Selenium HTML Report Plugin”安装到 jenkins 中。
  2. 在构建后操作中添加以下操作。

    行动 1:发布 Selenium HTML 报告

    value: */(Job Name)/workspace/ --> 注意:(将您的测试结果文件放在此文件夹中)

    行动 2:发布 Selenium 报告

    : * /(工作名称)/workspace/.html

This way we can generate a successful selenium report.

这样我们就可以生成一个成功的 selenium 报告。