自动化测试脚本需要频繁执行,也可能需要定时执行,执行的方法可能有很多种,下面我们来讲讲怎么使用Jenkins+Ant的方式来执行用例。
一、使用工具
Jenkins
Ant
Junit
二、Ant Task常用标签
<junit>: 定义一个junit task
<batchtest> :位于<junit>中,运行多个TestCase
<test>:位于<junit>中,运行单个TestCase
<formatter>:位于<junit>中,定义一个测试结果输出格式,包含以下格式:
brief:以文本格式提供测试失败的详细内容;
plain:以文本格式提供测试失败的详细内容以及每个测试的运行统计;
xml:以xml格式提供扩展的详细内容,包括正在测试时的Ant特性,系统输出,以及每个测试用例的系统错误;
<junitreport>:定义一个junitreport task
<report>:位于<junitreport>中,输出一个junitreport
三、Junit Task常用参数


四、Ant 执行测试生成报告配置:

五、jenkins自动执行测试配置:

六、测试报告内容展示:



网友评论