Jenkins 包装名称显示为“QUOTE”;根“;在Jenkin管道与cypress junit reporter
我使用Cypress和JUnit Reporter,自动化套件在Jenkin运行。但是在Jenkin的Junit测试结果中,包名总是显示root 如何将其从root更改为任何其他名称 下面是我的cypress.json reporter选项配置Jenkins 包装名称显示为“QUOTE”;根“;在Jenkin管道与cypress junit reporter,jenkins,npm,junit,jenkins-plugins,cypress,Jenkins,Npm,Junit,Jenkins Plugins,Cypress,我使用Cypress和JUnit Reporter,自动化套件在Jenkin运行。但是在Jenkin的Junit测试结果中,包名总是显示root 如何将其从root更改为任何其他名称 下面是我的cypress.json reporter选项配置 "reporter": "cypress-junit", "reporterOptions": { "testCaseSwitchClassnameAndName": true, "rootSui
"reporter": "cypress-junit",
"reporterOptions": {
"testCaseSwitchClassnameAndName": true,
"rootSuiteTitle":"MYPROJECT-UI",
"testsuitesTitle": "MYPROJECT-UI-TEST",
"suiteTitleSeparatedBy": ".",
"useFullSuiteTitle":true,
"mochaFile": "cypress/reports/myproject-ui-report[hash].xml",
"toConsole": false,
"outputs": true,
"jenkinsMode":true
```
XML File generated post execution of Test Suite:
<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="MYPROJECT-UI-TEST" time="25.085" tests="2" failures="0">
<testsuite name="" timestamp="2020-04-28T14:12:06" tests="0" file="cypress\integration\001_Login_spec.js" failures="0" time="0">
</testsuite>
<testsuite name="MYPROJECT-UI.Verify SKLM Login functionlity" timestamp="2020-04-28T14:12:06" tests="2" failures="0" time="25.085">
<testcase name="Invalid username and password" time="3.707" classname="Login Test">
</testcase>
<testcase name="Valid username and password" time="21.378" classname="Login Test">
</testcase>
</testsuite>
</testsuites>
“reporter”:“cypress junit”,
“报告选项”:{
“testCaseSwitchClassnameAndName”:true,
“rootSuiteTitle”:“MYPROJECT-UI”,
“TestSuiteStile”:“MYPROJECT-UI-TEST”,
“suiteTitleSeparatedBy”:“,
“useFullSuiteTitle”:正确,
“mochaFile”:“cypress/reports/myproject ui report[hash].xml”,
“toConsole”:错误,
“输出”:正确,
“詹金斯模式”:正确
```
测试套件执行后生成的XML文件:
可能有点晚了,但我想我刚刚找到了这个问题的答案
您还可以通过设置reporterOptions.testsuitestle来配置testsuites.name属性,并通过设置reporterOptions.rootSuiteTitle来配置根套件的name属性
第节:结果报告
编辑:
cypress.json文件中的用法示例:
{
"reporter": "junit",
"reporterOptions": {
"mochaFile": "results/my-test-output.xml",
"toConsole": true
}
}
但是还没有测试。这解决了您的“根”问题吗?我仍然使用“根”作为默认名称,随着时间的推移,结果证明它不会让我太烦恼。因此答案将是-可能不会,但我不确定。