Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/EmptyTag/135.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
TestNG我想在报告中显示@BeforeClass和@AfterClass方法_Testng - Fatal编程技术网

TestNG我想在报告中显示@BeforeClass和@AfterClass方法

TestNG我想在报告中显示@BeforeClass和@AfterClass方法,testng,Testng,如何告诉testng在报告中显示所有方法,而不考虑注释。我想捕获@Test和configuration方法以显示在日志中 我的要求: 在我的项目中,无论方法是通过还是失败,我们都会为每个方法附加日志。 我可以为每个测试方法附加日志,它会在报告中显示方法。但当我在所有方法执行后使用@Afterclass执行某些操作时,我无法附加日志,因为此@Afterclass不会显示在报告中。@Afterclass方法仅在其失败时才会在报告中显示 我的问题是,即使没有故障,我们能否始终在报告中显示@AfterC

如何告诉testng在报告中显示所有方法,而不考虑注释。我想捕获@Test和configuration方法以显示在日志中

我的要求:

在我的项目中,无论方法是通过还是失败,我们都会为每个方法附加日志。 我可以为每个测试方法附加日志,它会在报告中显示方法。但当我在所有方法执行后使用@Afterclass执行某些操作时,我无法附加日志,因为此@Afterclass不会显示在报告中。@Afterclass方法仅在其失败时才会在报告中显示


我的问题是,即使没有故障,我们能否始终在报告中显示@AfterClass方法。

@After*
@Before*
不被视为测试方法,报告员可能不会显示它们


但是你可以用你自己的记者和它自己的逻辑。请参阅文档:

请添加更多详细信息,并明确您的要求