serenity/cucumber 的测试结果无法上传到 Jira/Xray 测试执行任务。
使用 mvn clean verify 执行的测试。上传 Json 文件会导致“执行结果中未找到测试”。上传 XML 文件会导致“说明 -> 需要说明。”。即使我向测试套件和测试用例添加描述,也会发生相同的错误。
如何导入测试结果?
X射线版本: 3.4.2_j7
依赖项:
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.6.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-cucumber</artifactId>
<version>1.9.37</version>
</dependency>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-junit</artifactId>
<version>2.0.55</version>
</dependency>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-core</artifactId>
<version>2.0.55</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>net.serenity-bdd.maven.plugins</groupId>
<artifactId>serenity-maven-plugin</artifactId>
<version>2.0.55</version>
<configuration>
<tags></tags>
</configuration>
<executions>
<execution>
<id>serenity-reports</id>
<phase>post-integration-test</phase>
<goals>
<goal>aggregate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
XML 结果文件:
<?xml version="1.0" encoding="UTF-8"?>
<testsuite errors="0" failures="0" name="simple text search" skipped="0" tests="10" time="77.58" timestamp="2019-07-30 02:16:13">
<testcase name="find a document by using the simple text search"/>
</testsuite>
JSON结果文件:
{
"name": "find a document by using the simple text search",
"id": "simple-text-search;find-a-document-by-using-the-simple-text-search",
"testSteps": [
{
"number": 1,
"description": "Example #1: {searchTerm\u003dquality assurance, documentTitle\u003dBRPM.LO Assurance Mgmt.}",
"duration": 7118,
"startTime": "2019-07-30T14:16:13.374+02:00[Europe/Berlin]",
"result": "SUCCESS",
"precondition": false,
"level": 0,
"children": [
{
"number": 2,
"description": "Login: user, password",
"duration": 5897,
"startTime": "2019-07-30T14:16:13.395+02:00[Europe/Berlin]",
"result": "SUCCESS",
"precondition": false,
"level": 1
},
{
"number": 3,
"description": "Is dashboard opened",
"duration": 135,
"startTime": "2019-07-30T14:16:19.293+02:00[Europe/Berlin]",
"result": "SUCCESS",
"precondition": false,
"level": 1
},
{
"number": 4,
"description": "Given the user opens the search",
"duration": 208,
"startTime": "2019-07-30T14:16:19.428+02:00[Europe/Berlin]",
"result": "SUCCESS",
"precondition": false,
"level": 1,
"children": [
{
"number": 5,
"description": "Open search",
"duration": 201,
"startTime": "2019-07-30T14:16:19.434+02:00[Europe/Berlin]",
"result": "SUCCESS",
"precondition": false,
"level": 2
}
]
},
{
"number": 6,
"description": "When documents are filtered with simple text search \"quality assurance\"",
"duration": 395,
"startTime": "2019-07-30T14:16:19.636+02:00[Europe/Berlin]",
"result": "SUCCESS",
"precondition": false,
"level": 1,
"children": [
{
"number": 7,
"description": "Filter documents by text: quality assurance",
"duration": 393,
"startTime": "2019-07-30T14:16:19.637+02:00[Europe/Berlin]",
"result": "SUCCESS",
"precondition": false,
"level": 2
}
]
},
{
"number": 8,
"description": "Then the document with title \"BRPM.LO Assurance Mgmt.\" must be found on first place",
"duration": 357,
"startTime": "2019-07-30T14:16:20.032+02:00[Europe/Berlin]",
"result": "SUCCESS",
"precondition": false,
"level": 1,
"children": [
{
"number": 9,
"description": "Is document on first place: BRPM.LO Assurance Mgmt.",
"duration": 356,
"startTime": "2019-07-30T14:16:20.033+02:00[Europe/Berlin]",
"result": "SUCCESS",
"precondition": false,
"level": 2
}
]
},
{
"number": 10,
"description": "Logout",
"duration": 101,
"startTime": "2019-07-30T14:16:20.390+02:00[Europe/Berlin]",
"result": "SUCCESS",
"precondition": false,
"level": 1
}
]
}
],
"userStory": {
"id": "simple-text-search",
"storyName": "simple text search",
"path": "src/test/resources/features/search/SimpleTextSearch.feature",
"narrative": "\tWithin the Search you can use a simple full text search to find documents.",
"type": "feature"
},
"featureTag": {
"name": "search/simple text search",
"type": "feature",
"displayName": "search/simple text search"
},
"title": "find a document by using the simple text search",
"tags": [
{
"name": "search",
"type": "capability",
"displayName": "Search"
},
{
"name": "TPD-3150",
"type": "tag",
"displayName": "TPD-3150"
},
{
"name": "search/simple text search",
"type": "feature",
"displayName": "simple text search"
}
],
"startTime": "2019-07-30T14:16:13.371+02:00[Europe/Berlin]",
"duration": 77582,
"projectKey": "",
"sessionId": "8e2f1927ce30efaa140c889e54081a9b",
"driver": "chrome",
"dataTable": {
"headers": [
"searchTerm",
"documentTitle"
],
"rows": [
{
"values": [
"quality assurance",
"BRPM.LO Assurance Mgmt."
],
"result": "SUCCESS"
}
],
"predefinedRows": true,
"scenarioOutline": "Given the user opens the search\n\rWhen documents are filtered with simple text search \"\u003csearchTerm\u003e\"\n\rThen the document with title \"\u003cdocumentTitle\u003e\" must be found on first place\n\r",
"dataSetDescriptors": [
{
"startRow": 0,
"rowCount": 0,
"name": ""
}
]
},
"manual": false,
"testSource": "Cucumber",
"result": "SUCCESS",
"scenarioOutline": "Given the user opens the search\r\nWhen documents are filtered with simple text search \"\u003csearchTerm\u003e\"\r\nThen the document with title \"\u003cdocumentTitle\u003e\" must be found on first place"
}