Skip to content

Commit

Permalink
workaround for issue testng-team/testng#2960
Browse files Browse the repository at this point in the history
  • Loading branch information
Harmin committed Aug 16, 2023
1 parent e302e53 commit f9b5ba7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/com/github/report4s/TestListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ public void onTestStart(ITestResult result) {

//Force the test to skip if the necessary conditions are met.
if (SuiteListener.test_failure && Report4s.skipSuiteAfterTestFailure) {
if (Utils.getDependencies(result).length > 0) {
startTestReport(result);
return;
}
result.setEndMillis(result.getStartMillis());
result.setStatus(ITestResult.SKIP);
HtmlWriter.printTestTitle(result);
Expand Down
9 changes: 9 additions & 0 deletions src/com/github/report4s/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@ protected static String getParameters(ITestResult result) {
return null;
}

/**
* Return the dependsOnMethods attribute of a test method.
* @param result The test under execution.
* @return The dependsOnMethods attribute of the @test annotation of the test method.
*/
protected static String[] getDependencies(ITestResult result) {
return result.getMethod().getMethodsDependedUpon();
}

/**
* Return the success percentage of a test method.
* @param result The test under execution.
Expand Down

0 comments on commit f9b5ba7

Please sign in to comment.