implements IReporter interface, override generateReport method, run test cases(at least two cases) by xml,set parallel="methods" ,check id of SuiteRunner->invokedMethods->TestNGMethod->beforeMethod
Test class:
package user.zdx.thread;
import common.ReportListener;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test;
@Listeners(ReportListener.class)
public class TestClassOne extends TestClassBase{
@Test(description = "testOne",groups = "default")
public void testOne(){
}
@Test(description = "testTwo",groups = "default")
public void testTwo(){
}
@Test(description = "testThree",groups = "default")
public void testThree(){
}
}
test father class : TestClassBase
package user.zdx.thread;
import org.testng.annotations.BeforeMethod;
import java.lang.reflect.Method;
public class TestClassBase {
@BeforeMethod
public void setUp(Method method){
System.out.println("before method thread name: "+Thread.currentThread().getName()+"----test method name----"+method.getName());
}
}
TestNG Version
7.0.0
Expected behavior
id of different beforeMethod is not same
Actual behavior
id of different beforeMethod is same
Is the issue reproductible on runner?
IntelliJ
Test case sample
implements IReporter interface, override generateReport method, run test cases(at least two cases) by xml,set parallel="methods" ,check id of SuiteRunner->invokedMethods->TestNGMethod->beforeMethod
Test class:
test father class : TestClassBase
custom report class:
xml file:
run xml output: