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

    (原文:https://www.cnblogs.com/fancy0158/p/10055003.html)

    适用于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()
     

    测试报告结果如图

     中文:

    英文:

    软件测试
  • 相关阅读:
    javascript小括号、中括号、大括号学习总结
    第二次面试
    Python 类编码风格
    Python常见初级错误
    2.傅里叶变换
    1.仿射变换
    Leetcode 136. 只出现一次的数字
    003 Python与类C语言的区别(未完)
    01 C++ 多线程入门实例
    Leetcode 503. 下一个更大元素 II
  • 原文地址:https://www.cnblogs.com/dorlin/p/10381812.html
Copyright © 2011-2022 走看看