mercredi 18 novembre 2015

Unable to debug test with a chain of dependencies in IDEA

I'm using TestNG dependsOnMethods annotation to run my tests in IDEA ide:

@Test(priority = 1)
public void test1(){
    Utils.line("test 1");
}

@Test(dependsOnMethods = {"test1"})
public void test2(){
    Utils.line("test 2");
}

@Test(dependsOnMethods = {"test2"})
public void test3(){
    Utils.line("test 3");
}

Test3 depends on Test2 and Test2 depends on Test1

All of them pass okay but a strange behavior occurs when I'm trying to debug the Test3 (Right click on method -> debug). I get an TestNG error:

TestClass1.test2() is depending on method public void TestClass1.test1(), which is not annotated with @Test or not included.

However, when I debug Test2 in the same way, it runs okay. When I set Test3 depends on Test1 its also okay.

It seems like TestNG doesn't see a chain of dependencies in debug mode, or what is the point?

Aucun commentaire:

Enregistrer un commentaire