Skip to content

Commit

Permalink
Fixed dry run option
Browse files Browse the repository at this point in the history
  • Loading branch information
martingrossmann committed Aug 30, 2024
1 parent 1cfc0cc commit e95ebf2
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,13 @@ public static void runHook(IConfigureCallBack callBack, ITestResult testResult)

if (Report.Properties.LIST_TESTS.asBool()) {
LOGGER.info("Dry run for list tests: " + testNGMethod.getMethodName());
testResult.setStatus(ITestResult.SUCCESS);
// no sleep
return;
}
if (Testerra.Properties.DRY_RUN.asBool()) {
if (dryRun(testNGMethod)) {
testResult.setStatus(ITestResult.SUCCESS);
return;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@ public static void runHook(IHookCallBack callBack, ITestResult testResult) {

if (Report.Properties.LIST_TESTS.asBool()) {
LOGGER.info("Dry run for list tests: " + testNGMethod.getMethodName());
testResult.setStatus(ITestResult.SUCCESS);
// no sleep
return;
} else if (Testerra.Properties.DRY_RUN.asBool()) {
if (dryRun(testNGMethod)) {
testResult.setStatus(ITestResult.SUCCESS);
return;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package io.testerra.test.pretest_testng;

import eu.tsystems.mms.tic.testframework.testing.TesterraTest;
import org.testng.Assert;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

/**
* Created on 2024-08-30
*
* @author mgn
*/
public class TestNGFeatureTest extends TesterraTest {

@BeforeMethod
public void before_method() {

}

@BeforeMethod
public void beofre_method_failed() {
Assert.fail();
}

@Test
public void T01_testng_passed_test() {

}

@Test(dependsOnMethods = "T01_testng_passed_test")
public void T02_testng_depends_method() {

}

@Test
public void T03_testng_failed_test() {
Assert.fail();
}

@AfterMethod
public void after_method() {

}

}

0 comments on commit e95ebf2

Please sign in to comment.