package com.course.testng;
import org.testng.annotations.*;
public class BasicAnnotation {
    //最基本的注解,用来把方法标记为测试的一部分
    @Test
    public void testCase1() {
        System.out.println("这是测试用例1");
    }
    @Test
    public void testCase2() {
        System.out.println("这是测试用例2");
    }
    //测试方法之前运行的
    @BeforeMethod
    public void beforeMethed() {
        System.out.println("这是在测试方法之前运行的");
    }
    //测试方法之后运行的
    @AfterMethod
    public void afterMethed() {
        System.out.println("这是在测试方法之后运行的");
    }
    @BeforeClass
    public void beforeclass() {
        System.out.println("beforeclass2这是在类之前运行的方法");
    }
    @AfterClass
    public void afterclass() {
        System.out.println("bafterclass2这是在类之前运行的方法");
    }
    @BeforeSuite
    public void beroresuite() {
        System.out.println("BeforeSuite测试套件");
    }
    @AfterSuite
    public void aftersuite() {
        System.out.println("AfterSuite测试套件");
    }
}
![]()