@BeforeSuite、@AfterSuite(测试套件)
测试注解当中最先被执行的注解,可以通过xml配置,将@BeforeSuite注解写在测试类中,通过配置文件调用需要执行的程序和测试类;
@BeforeTest,@AfterTest(测试)
注解的方法将被运行前/后,所有的测试方法,属于内部类的<test>标签的运行,可以通过xml配置,将@BeforeTest注解写在测试类中,通过配置文件调用需要执行的程序和测试类;
@BeforeClass,@AfterClass(测试类)
注解的方法将只运行一次先行先试在当前类中的方法调用,不能通过xml注解的方式在测试类中调用;
@BeforeMethod,@AfterMethod(测试方法)
注解的方法将在每个测试方法之前执行;
@Test(测试方法)
对方法进行注释,表明这是测试方法;



网友评论