我有以下代码片段-
第 1 类:- DependencyOne.java
public class DependencyOne
{
@Test(groups = "xxx")
public void parentTestMethodOne()
{
System.out.println("parent Test Method One");
}
@Test(groups = "vizac")
public void parentTestMethodTwo()
{
System.out.println("parent Test Method Two");
}
@Test(groups = "xxx")
public void parentTestMethodThree()
{
System.out.println("parent Test Method Three");
}
}
而另一类是
第 2 类:- DependencyTwo.java
public class DependencyTwo
{
@Test(dependsOnMethods = "testMethodThree")
public void testMethodOne()
{
System.out.println("Test Method One");
}
@Test(dependsOnGroups = "xxx")
public void testMethodTwo()
{
System.out.println("Test Method Two");
}
@Test(dependsOnMethods = "testMethodTwo")
public void testMethodThree()
{
System.out.println("Test Method Three");
}
}
当我执行DependencyTwo时,它给出以下输出 -
而我期待的是——
任何人都可以解释一下为什么会发生这种情况,即使我只访问其他类的指定组的测试方法,请建议我如何才能只访问其他类中的组指定的测试方法。