In TestNG 6.3.1~6.9.10, I'm trying to create dependency between two classes like below.
class A {
@Test(groups={"GA"})
public void testA() {
}
}
class B {
@Test(groups={"GB"}, dependsOnGroups={"GA"})
public void testB() {
}
}
It works if I just list classA&B in in testng.xml.
<classes>
<class name="pkg.A"></class>
<class name="pkg.B"></class>
</classes>
If I want to only pick out testcases belong to "GB" and expect the same behavior to previous one,
<groups>
<run>
<include name="GB" />
</run>
</groups>
<classes>
<class name="pkg.A"></class>
<class name="pkg.B"></class>
</classes>
then TestNg complains
DependencyMap::Method "B.testB()[pri:0, instance:pkg.B@250970c1]" depends on nonexistent group "GA".
Why does not TestNg recognize group GA? How to pick out some groups of testcases to run while keeping group dependencies? Thank you in advance.