Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
baev committed Mar 18, 2024
1 parent b44e303 commit 3ceb5c4
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ private void startTestCase(final TestIdentifier testIdentifier) {

result.getLabels().add(getJUnitPlatformUniqueId(testIdentifier));

// supported for inner classes
// add annotations from outer classes (support for @Nested tests in JUnit 5)
testClass.ifPresent(clazz -> {
Class<?> clazz1 = clazz;
do {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,8 @@ void shouldSupportNestedClasses() {
.containsExactlyInAnyOrder(
"parentTest()",
"feature1Test()",
"feature2Test()"
"feature2Test()",
"story1Test()"
);

assertThat(allureResults.getTestResults())
Expand Down Expand Up @@ -912,5 +913,15 @@ void shouldSupportNestedClasses() {
tuple("epic", "Parent epic"),
tuple("feature", "Feature 2")
);

assertThat(allureResults.getTestResults())
.filteredOn("name", "story1Test()")
.flatExtracting(TestResult::getLabels)
.extracting(Label::getName, Label::getValue)
.contains(
tuple("epic", "Parent epic"),
tuple("feature", "Feature 2"),
tuple("story", "Story 1")
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import io.qameta.allure.Epic;
import io.qameta.allure.Feature;
import io.qameta.allure.Story;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;

Expand Down Expand Up @@ -47,5 +48,15 @@ class Feature2 {
@Test
void feature2Test() {
}

@Story("Story 1")
@Nested
class Story1 {

@Test
void story1Test() {
}

}
}
}

0 comments on commit 3ceb5c4

Please sign in to comment.