TestNG(五) 5-7 套件测试



<?xml version="1.0" encoding="utf-8" ?>
<suite name="test">
    <test name="login">
        <classes>
            <class name="com.course.testng.suite.SuiteConfig"/>
            <class name="com.course.testng.suite.LoginTest"/>
        </classes>
    </test>

    <test name="pay">
        <classes>
            <class name="com.course.testng.suite.SuiteConfig"/>
            <class name="com.course.testng.suite.payment"/>
        </classes>
    </test>
</suite>

 

package com.course.testng.suite;

import org.testng.annotations.Test;

public class payment {
    @Test
    public void psymentTest(){
        System.out.println("支付成功");
    }
}

 

package com.course.testng.suite;

import org.testng.annotations.Test;

public class LoginTest {
    @Test
    public void Login(){
        System.out.println("淘宝登录成功");
    }
}

 

 

package com.course.testng.suite;

import org.testng.annotations.AfterSuite;
import org.testng.annotations.BeforeSuite;

public class SuiteConfig {
    @BeforeSuite
    public void beforSuite(){
        System.out.println();
        System.out.println("before suite 运行了");
    }

    @AfterSuite
    public void afterSuite(){
        System.out.println("after suite 运行了");
    }
}

 

 

 

posted @ 2019-08-24 15:49  怪圣卡杰  阅读(292)  评论(0编辑  收藏  举报