Skip to content

Commit 4dc896c

Browse files
authored
add test case name model property (via #690)
1 parent 6aa4043 commit 4dc896c

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

allure-junit-platform/src/main/java/io/qameta/allure/junitplatform/AllureJunitPlatform.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,10 @@ private void startTestCase(final TestIdentifier testIdentifier) {
422422
.orElseGet(testIdentifier::getUniqueId)
423423
: testIdentifier.getUniqueId()
424424
)
425+
.setTestCaseName(testTemplate
426+
? maybeParent.map(TestIdentifier::getDisplayName)
427+
.orElseGet(testIdentifier::getDisplayName)
428+
: testIdentifier.getDisplayName())
425429
.setHistoryId(getHistoryId(testIdentifier))
426430
.setStage(Stage.RUNNING);
427431

allure-model/src/main/java/io/qameta/allure/model/TestResult.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public class TestResult implements Serializable, ExecutableItem, WithLinks {
4242
private String uuid;
4343
private String historyId;
4444
private String testCaseId;
45+
private String testCaseName;
4546
private String fullName;
4647
private List<Label> labels = new ArrayList<>();
4748
private List<Link> links = new ArrayList<>();
@@ -117,6 +118,26 @@ public TestResult setTestCaseId(final String value) {
117118
return this;
118119
}
119120

121+
/**
122+
* Gets test case name.
123+
*
124+
* @return the test case name
125+
*/
126+
public String getTestCaseName() {
127+
return testCaseName;
128+
}
129+
130+
/**
131+
* Sets test case name.
132+
*
133+
* @param value the value
134+
* @return self for method chaining.
135+
*/
136+
public TestResult setTestCaseName(final String value) {
137+
this.testCaseName = value;
138+
return this;
139+
}
140+
120141
/**
121142
* Gets full name.
122143
*

0 commit comments

Comments
 (0)