citrusframework / citrus

Framework for automated integration tests with focus on messaging integration
https://citrusframework.org
Apache License 2.0
459 stars 136 forks source link

Citrus html report doesn't register the skipped tests in its citrus report as "Skipped" #761

Open ppahari opened 3 years ago

ppahari commented 3 years ago

Citrus Version dependencies { compile group: 'org.testng', name: 'testng', version: '6.14.3' compile group: 'junit', name: 'junit', version: '4.12' compile group: 'com.consol.citrus', name: 'citrus-core', version: '2.8.0' compile group: 'com.consol.citrus', name: 'citrus-java-dsl', version: '2.8.0' compile group: 'org.testng', name: 'testng', version: '6.14.3' implementation(group: 'junit', name: 'junit', version: '4.12') implementation 'io.reactivex.rxjava2:rxjava:2.2.20' }

Expected behavior when test1 fails test 2 is skipped by testNG , citrus reports is supposed to show the skipped count in its citrus html report

Actual behavior when test1 fails test 2 is skipped by testNG , but citrus reports fails to show the skipped count in its citrus html report

Test case sample

public class InitialTest extends TestNGCitrusTestRunner {

@Parameters("context")
@Test
@CitrusTest(name = "test1")
public void test1( @Optional @CitrusResource TestContext context){
    System.out.println("test1");
    fail("I am failing");
}

@Parameters("context")
@Test(dependsOnMethods = "test1")
@CitrusTest(name = "test2")
public void test2( @Optional @CitrusResource TestContext context){
    System.out.println("test2");
}

}

christophd commented 3 years ago

Tests that are skipped because of TestNG dependsOnMethods="foo" are not supported yet

Would need to find a way to hook into the skip operation of TestNG in order to reflect this also in Citrus reports. Not sure if this is even possible.