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 运行了"); } }
创作不易,转摘请标明出处。如果有意一起探讨测试相关技能可加博主QQ 771268289 博主微信:ding17121598
本文来自博客园,作者:怪圣卡杰,转载请注明原文链接:https://www.cnblogs.com/dwdw/p/11404901.html