如何在詹金斯上运行CI硒侧面测试

时间:2019-07-19 09:15:47

标签: selenium jenkins selenium-ide

我有一个由 Selenium IDE 生成的.side文件,我需要使用 Jenkins CI 上运行。

我正在使用以下shell命令将其作为构建步骤运行:

selenium-side-runner /path/to/file.ide

问题的出现是由于无论硒测试是否失败,詹金斯总是表明成功与否。

在此线程中,建议将文件作为通用文件上传,但仍然缺少执行该文件的命令 How to upload a generic file into a Jenkins job?

我在这篇文章中找到了一种可能的解决方案,但是我希望有一种更简洁的方法来解决此问题,而不是解析结果以检查错误。 How to mark a build unstable in Jenkins when running shell scripts

是否有一个插件可以在Jenkins上运行selenium .side文件,并且该插件可以显示测试的成功/失败?

1 个答案:

答案 0 :(得分:1)

您可以生成Junit测试报告文件,然后在执行测试后使用Jenkins Junit插件。

selenium-side-runner --output-directory=results --output-format=junit
# Outputs results in `junit` frormat in `./results/projectName.xml'

检查official documentation以获得更多详细信息。

相关问题