zoukankan      html  css  js  c++  java
  • Appium+python HTML测试报告(2)——一份报告模板

    转载自博客园作者Findyou,https://www.cnblogs.com/findyou/p/6925733.html

    [项目地址] https://github.com/findyou/HTMLTestRunnerCN/tree/dev

    适用于python3:

    下载地址:

    英文:https://pan.baidu.com/s/1Xb8VG6UFxR_R6aSqZumwWw

    中文:https://pan.baidu.com/s/1Hmi-brNTTgtbDqzb1IVuHQ

    使用方法:

    HTMLTestRunnerCN.py和HTMLTestRunnerEN.py下载到...pythonLib目录下,在使用时导入该模块即可。

    # coding:utf-8
    import unittest, time
    from HTMLTestRunnerCN import HTMLTestRunner if __name__ == '__main__': suite = unittest.TestSuite() suite.addTest(TestCalculator('test_add')) suite.addTest(TestCalculator('test_sub')) now_time = time.strftime("%Y%m%d_%H-%M-%S") file_path = open('./'+now_time+'_TestResult.html', 'wb') runner = HTMLTestRunner( stream=file_path, # 文件 title='计算器测试报告', # 标题 description='测试用例执行情况', # 副标题 tester=u"fancy" # 测试人员名字,不传默认为QA ) runner.run(suite) file_path.close()

    英文报告:

    # coding:utf-8
    import unittest, time
    from HTMLTestRunnerEN import HTMLTestRunner
    
    if __name__ == '__main__':
        suite = unittest.TestSuite()
        suite.addTest(TestCalculator('test_add'))
        suite.addTest(TestCalculator('test_sub'))
        now_time = time.strftime("%Y%m%d_%H-%M-%S")
        file_path = open('./'+now_time+'_TestResult.html', 'wb')
        runner = HTMLTestRunner(
            stream=file_path,  # 文件
            title='计算器测试报告',   # 标题
            description='测试用例执行情况',   # 副标题
            tester=u"fancy"     # 测试人员名字,不传默认为QA
        )
        runner.run(suite)
        file_path.close()

    测试报告结果如图

     中文:

    英文:

  • 相关阅读:
    ionic环境搭建
    C# Enum Type
    【IOS】3. OC 类声明和实现
    【IOS】2.基础
    【IOS】1.学前准备
    win8, VS2013 .NET 4.5在哪找svcutil.exe?
    【你吐吧c#每日学习】11.10 C# Data Type conversion
    【你吐吧c#每日学习】10.30 C#Nullable Types
    【你吐吧c#每日学习】10.29 C#字符串类型&Common operators
    给三个int,判断是否可构成三角形算法
  • 原文地址:https://www.cnblogs.com/fancy0158/p/10055003.html
Copyright © 2011-2022 走看看