查看官网:https://docs.qameta.io/allure/#_junit_5
源码example: https://github.com/allure-examples/allure-examples/tree/master/allure-junit5/src/test/java/io/qameta/allure/examples/junit5
添加描述信息
package com.allure; import io.qameta.allure.Allure; import io.qameta.allure.Description; import org.junit.jupiter.api.Test; public class AllureDescriptionTest { @Test @Description("静态描述信息") public void annotationDescriptionTest() { } @Test public void dynamicDescriptionTest() { assert 1+1 == 2; Allure.description("动态描述信息"); assert 1+1 == 2; Allure.description("动态描述信息2");//会覆盖上面的描述信息 } }
添加链接信息
package com.allure; import io.qameta.allure.Allure; import io.qameta.allure.Link; import org.junit.jupiter.api.Test; public class AllureLinkTest { @Test @Link(name = "静态链接", url = "https://www.baidu.com") public void staticLinkTest() { assert 1 + 1 == 2; } @Test public void dynamicLinkTest() { assert 1 + 1 == 2; Allure.link("Dynamic link", "https://www.baidu.com"); } }
标签:allure,用法,Allure,io,Test,import,qameta From: https://www.cnblogs.com/ixtao/p/17658506.html