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()

    测试报告结果如图

     中文:

    英文:

  • 相关阅读:
    Java语法总结 线程
    Java多线程编程总结
    eclipse插件开发
    Java私塾的一些基础练习题(一)
    反射练习
    内部类实现动态链表(增,删,查,打印)
    oracle 存储过程第四天
    java 面向对象个人理解
    jsp的flash小例子
    oralcle 存储过程批处理
  • 原文地址:https://www.cnblogs.com/fancy0158/p/10055003.html
Copyright © 2011-2022 走看看