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

    测试报告结果如图

     中文:

    英文:

  • 相关阅读:
    CodeForces Round #556 Div.2
    #Leetcode# 650. 2 Keys Keyboard
    #Leetcode# 552. Student Attendance Record II
    #Leetcode# 551. Student Attendance Record I
    #Leetcode# 522. Longest Uncommon Subsequence II
    牛客OI周赛9-普及组
    最长回文子序列 (模板)
    C++ 各种排序算法总结
    THU 数据结构 真二叉树重构(Proper Rebuild)
    C++中结构体函数的实现
  • 原文地址:https://www.cnblogs.com/fancy0158/p/10055003.html
Copyright © 2011-2022 走看看