File tree Expand file tree Collapse file tree 3 files changed +79
-0
lines changed
java/io/qameta/allure/testng Expand file tree Collapse file tree 3 files changed +79
-0
lines changed Original file line number Diff line number Diff line change @@ -1041,6 +1041,32 @@ public void shouldProcessArrayParameters() {
10411041 );
10421042 }
10431043
1044+ @ SuppressWarnings ("unchecked" )
1045+ @ AllureFeatures .Fixtures
1046+ @ Issue ("304" )
1047+ @ Test (dataProvider = "parallelConfiguration" )
1048+ public void shouldProcessFailedSetUps (final XmlSuite .ParallelMode mode , final int threadCount ) {
1049+ final AllureResults results = runTestNgSuites (parallel (mode , threadCount ), "suites/gh-304.xml" );
1050+
1051+ assertThat (results .getTestResults ())
1052+ .extracting (TestResult ::getName , TestResult ::getStatus )
1053+ .contains (tuple ("skippedTest" , Status .SKIPPED ));
1054+
1055+ assertThat (results .getTestResultContainers ())
1056+ .flatExtracting (TestResultContainer ::getAfters )
1057+ .extracting (FixtureResult ::getName , FixtureResult ::getStatus )
1058+ .contains (tuple ("afterAlways" , Status .PASSED ));
1059+
1060+ assertThat (results .getTestResultContainers ())
1061+ .flatExtracting (TestResultContainer ::getAfters )
1062+ .filteredOn ("name" , "afterAlways" )
1063+ .flatExtracting (FixtureResult ::getSteps )
1064+ .extracting (StepResult ::getName )
1065+ .containsExactly (
1066+ "first" , "second"
1067+ );
1068+ }
1069+
10441070 private AllureResults runTestNgSuites (final String ... suites ) {
10451071 final Consumer <TestNG > emptyConfigurer = testNg -> {
10461072 };
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2019 Qameta Software OÜ
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+ package io .qameta .allure .testng .samples ;
17+
18+ import org .testng .annotations .AfterMethod ;
19+ import org .testng .annotations .BeforeMethod ;
20+ import org .testng .annotations .Test ;
21+
22+ import static io .qameta .allure .Allure .step ;
23+
24+ /**
25+ * @author charlie (Dmitry Baev).
26+ */
27+ public class FailedSetUp {
28+
29+ @ BeforeMethod
30+ public void setUp () {
31+ throw new RuntimeException ("Hey" );
32+ }
33+
34+ @ Test
35+ public void skippedTest () {
36+ }
37+
38+ @ AfterMethod (alwaysRun = true )
39+ public void afterAlways () {
40+ step ("first" );
41+ step ("second" );
42+ }
43+ }
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
3+
4+ <suite name =" Github Issues" configfailurepolicy =" continue" >
5+ <test name =" gh-304" >
6+ <classes >
7+ <class name =" io.qameta.allure.testng.samples.FailedSetUp" />
8+ </classes >
9+ </test >
10+ </suite >
You can’t perform that action at this time.
0 commit comments