zoukankan      html  css  js  c++  java
  • xUnit框架整合定制测试报告Allure2

    1、报告框架分类

    • xUnit style xml报告

    • mvn surefire插件的html报告

    • Allure2多语言测试报告

    2、生成测试报告

    2.1 xUnit style xml报告

    所有XUnit的测试报告都适用,如Java的Junit,Python的pytest等

    • 1)现有如下测试类Junit4DemoTest

    package junit4demo;  
    import org.junit.*;import org.junit.runners.MethodSorters;import static org.junit.Assert.assertTrue;  
    @FixMethodOrder(MethodSorters.NAME_ASCENDING)public class Junit4DemoTest {  
        @BeforeClass    public static void beforeAllTestCase(){        System.out.println("我是@BeforeClass,我是第一步");    }  
        @AfterClass    public static void afterAllTestCase(){        System.out.println("我是@AfterClass,我是最后一步");    }  
        @Before    public void beforeTestCase(){        System.out.println("我是@Before,用例执行前先到我这");    }  
        @After    public void afterTestCase(){        System.out.println("我是@After,用例执行后到我这");    }  
        @Test    public void testDemoC(){        System.out.println("testDemoC");        assertTrue(true);    }  
        @Test    public void testDemoA(){        System.out.println("testDemoA");        assertTrue(false );    }  
        @Test    public void testDemoB(){        System.out.println("testDemoB");        assertTrue(true );    }}
    

    2)用mvn test -Dtest=Junit4DemoTest执行Junit4DemoTest测试类,执行完毕之后我们可以在target.surefire- report.Surefile suite路径下看到文件TEST-junit4demo.Junit4DemoTest.xml,这就是xUnit
    style xml报告

    来霍格沃兹测试开发学社,学习更多软件测试与测试开发的进阶技术,知识点涵盖web自动化测试 app自动化测试、接口自动化测试、测试框架、性能测试、安全测试、持续集成/持续交付/DevOps,测试左移、测试右移、精准测试、测试平台开发、测试管理等内容,课程技术涵盖bash、pytest、junit、selenium、appium、postman、requests、httprunner、jmeter、jenkins、docker、k8s、elk、sonarqube、jacoco、jvm-sandbox等相关技术,全面提升测试开发工程师的技术实力
    QQ交流群:484590337
    公众号 TestingStudio
    点击获取更多信息

  • 相关阅读:
    URL中的特殊字符 + % # & = ? /
    mvc 前端显示文本中的html标签处理
    URL中#号(井号)的作用
    自定义配置节 Section
    vshost.exe.config与.exe.config ;Debug目录与Release目录;bin目录与obj目录
    在MVC过滤器中获取触发的Controller、Action、参数 等
    js设置全局变量 ajax中赋值
    批处理 安装、卸载 window service
    [摘]HttpContext, HttpRequest, HttpResponse, HttpRuntime, HttpServerUtility
    摘要:ASP.NET的路由
  • 原文地址:https://www.cnblogs.com/hogwarts/p/15845418.html
Copyright © 2011-2022 走看看