Skip to content

Commit

Permalink
Fix for #3189 - fixed ignored testcases count
Browse files Browse the repository at this point in the history
  • Loading branch information
AnTopch committed Nov 21, 2024
1 parent 7c80f4c commit 36c0ebd
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ public void add(Count count) {
this.failed += count.failed;
this.skipped += count.skipped;
this.retried += count.retried;
this.ignored += count.retried;
this.ignored += count.ignored;
}

private Count(Builder builder) {
Expand Down
13 changes: 13 additions & 0 deletions testng-core/src/test/java/test/reports/SimpleIgnoredSample.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package test.reports;

import org.testng.annotations.Ignore;
import org.testng.annotations.Test;

public class SimpleIgnoredSample {

@Test
@Ignore
public void ignored() {

}
}
6 changes: 3 additions & 3 deletions testng-core/src/test/java/test/reports/XmlReporterTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public void ensureReportGenerationWhenTestMethodIsWrappedWithWrappedTestNGMethod
@Test(description = "GITHUB-2886")
public void ensureConfigurationMethodsAreNotCountedAsSkippedInXmlReports() throws Exception {
File file =
runTest(RuntimeBehavior.FILE_NAME, null, JekyllTestSample.class, HydeTestSample.class);
runTest(RuntimeBehavior.FILE_NAME, null, JekyllTestSample.class, HydeTestSample.class, SimpleIgnoredSample.class);
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document doc = builder.parse(file);
Expand All @@ -103,8 +103,8 @@ public void ensureConfigurationMethodsAreNotCountedAsSkippedInXmlReports() throw
int total = Integer.parseInt(node.getAttributes().getNamedItem("total").getNodeValue());
int passed = Integer.parseInt(node.getAttributes().getNamedItem("passed").getNodeValue());
int failed = Integer.parseInt(node.getAttributes().getNamedItem("failed").getNodeValue());
assertThat(ignored).isZero();
assertThat(total).isEqualTo(2);
assertThat(ignored).isEqualTo(1);
assertThat(total).isEqualTo(3);
assertThat(passed).isEqualTo(2);
assertThat(failed).isZero();
}
Expand Down

0 comments on commit 36c0ebd

Please sign in to comment.