Allure功能
- 在测试执行的时候关联测试框架,保存测试的执行信息到xml文件中
- 然后将xml文件解析为html报告展示
Allure优点
- 开源,轻量级,多语言支持
- 支持主流框架集成,testng、junit、pyunit等
- 支持jenkins集成
- 强大的注解功能
Allure注解
@Step:测试步骤动作,放在具体业务逻辑方法中,可以放在关键步骤中,在报告中显示;
@Attachments:附件信息,在截图或者其他方法上加上该注解即可(注意图片和文字区别),https://github.com/allure-framework/allure1/wiki/Attachments
@Features:将case分类到某个feature中,报告中behaviore中显示,可以理解为testsuite,用于组织管理测试用例https://github.com/allure-framework/allure1/wiki/Features-and-Stories
@Stories:属于feature之下的结构,报告中features中显示,可以理解为testcase,说明此用例是某个feature中的某个story下的用例https://github.com/allure-framework/allure1/wiki/Features-and-Stories
@Title: 测试用例的标题,报告中stories信息中展示
@Description: 测试用例的描述,报告中stories信息中展示
@Issue: 跟测试用例相关的bug Id(这是一个链接,可以配置bug管理系统的URL,直接跳转到bug管理系