pythonHtmlRunnner

HTMLTestRunner下载与安装 HTMLTestRunner保姆级安装教程 阅读详情

class sendEmail:
def sendemail(self):
# msg = email.mime.multipart.MIMEMultipart()
# msg[‘from’] = ‘shixinfa@baidu.com’
# msg[‘to’] = ‘shixinfa@baidu.com’
msg = MIMEMultipart()
tolist = [‘v_wangjiwei01@baidu.com’, ‘shixinfa@baidu.com’, ‘jinghenan@baidu.com’]
msg[‘from’] = ‘v_wangjiwei01@baidu.com’
msg[‘to’] = ‘,’.join(tolist)
msg[‘subject’] = “测试邮件”
content = “测试邮件内容”
txt = email.mime.text.MIMEText(content, ‘plain’, ‘utf-8’)
msg.attach(txt)
# 添加附件地址
part = MIMEApplication(open(r’/Users/v_wangjiwei01/Desktop/report.html’, ‘rb’).read())
part.add_header(‘Content-Disposition’, ‘attachment’, filename=“UI自动化测试结果111.html”) # 发送文件名称
msg.attach(part)

    smtp = smtplib.SMTP()
    smtp.connect('proxy-in.baidu.com', '25')
    smtp.sendmail(msg['from'], tolist, str(msg))

    print("发送成功!")

if name == ‘main’:
suite = unittest.TestSuite()
# #####suite.addTests(unittest.TestLoader().loadTestsFromTestCase(TestStringMethods))

suite.addTest(TestStringMethods('test_onlineCalculation_searchPages'))
suite.addTest(TestStringMethods('test_offlineCalculation_searchPages'))
suite.addTest(TestStringMethods('test_goHome_goCompany'))
suite.addTest(TestStringMethods('test_search_cityName'))
suite.addTest(TestStringMethods('test_city_calculateRoad'))
suite.addTest(TestStringMethods('test_no_high_speed'))
suite.addTest(TestStringMethods('test_high_speed_priority'))
suite.addTest(TestStringMethods('test_avoid_congestion'))
suite.addTest(TestStringMethods('test_priority_time'))
suite.addTest(TestStringMethods('test_intelligent_recommendation'))
suite.addTest(TestStringMethods('test_selectionPage_detailsPage_information'))
suite.addTest(TestStringMethods('test_openClose_naviSound'))
suite.addTest(TestStringMethods('test_route_preference'))
suite.addTest(TestStringMethods('test_incident_reporting'))
suite.addTest(TestStringMethods('test_searchAlong_theWay'))
suite.addTest(TestStringMethods('test_global_mode_switch'))
suite.addTest(TestStringMethods('test_page_display'))
suite.addTest(TestStringMethods('test_clickAgree_disclaimerPage'))
suite.addTest(TestStringMethods('test_clickNoAgree_disclaimerPage'))
suite.addTest(TestStringMethods('test_set_home_address'))
suite.addTest(TestStringMethods('test_set_company_address'))
suite.addTest(TestStringMethods('test_switch_browse_mode'))
suite.addTest(TestStringMethods('test_input_keywords'))
suite.addTest(TestStringMethods('test_keyword_search'))
suite.addTest(TestStringMethods('test_click_sug_search'))
suite.addTest(TestStringMethods('test_passing_point_icon'))
suite.addTest(TestStringMethods('test_routePoint_inputDestination'))
suite.addTest(TestStringMethods('test_team_management'))
suite.addTest(TestStringMethods('test_team_name_modification'))
suite.addTest(TestStringMethods('test_favorites_set_company_address'))
suite.addTest(TestStringMethods('test_favorites_set_home_address'))
suite.addTest(TestStringMethods('test_favorites_del_home_address'))
suite.addTest(TestStringMethods('test_favorites_del_company_address'))
suite.addTest(TestStringMethods('test_del_favorites_address'))
suite.addTest(TestStringMethods('test_i_want_report'))
suite.addTest(TestStringMethods('test_i_want_report5'))
suite.addTest(TestStringMethods('test_i_want_report1'))
suite.addTest(TestStringMethods('test_i_want_report2'))
suite.addTest(TestStringMethods('test_i_want_report3'))
suite.addTest(TestStringMethods('test_i_want_report4'))
suite.addTest(TestStringMethods('test_i_want_report6'))
suite.addTest(TestStringMethods('test_i_want_report7'))
suite.addTest(TestStringMethods('test_i_want_report8'))
suite.addTest(TestStringMethods('test_i_want_report9'))
suite.addTest(TestStringMethods('test_i_want_report10'))
suite.addTest(TestStringMethods('test_i_want_report11'))
suite.addTest(TestStringMethods('test_i_want_report12'))
suite.addTest(TestStringMethods('test_i_want_report13'))
suite.addTest(TestStringMethods('test_i_want_report14'))
suite.addTest(TestStringMethods('test_i_want_report15'))
suite.addTest(TestStringMethods('test_i_want_report17'))
suite.addTest(TestStringMethods('test_i_want_report18'))
suite.addTest(TestStringMethods('test_i_want_report19'))
suite.addTest(TestStringMethods('test_i_want_report20'))
suite.addTest(TestStringMethods('test_i_want_report21'))
suite.addTest(TestStringMethods('test_i_want_report22'))
suite.addTest(TestStringMethods('test_i_want_report23'))
suite.addTest(TestStringMethods('test_i_want_report24'))
suite.addTest(TestStringMethods('test_i_want_report25'))
suite.addTest(TestStringMethods('test_i_want_report26'))
suite.addTest(TestStringMethods('test_i_want_report27'))
suite.addTest(TestStringMethods('test_delete_voice_package'))
suite.addTest(TestStringMethods('test_download_voice_package'))
suite.addTest(TestStringMethods('test_download_status_display'))
suite.addTest(TestStringMethods('test_preference_message_notification'))
suite.addTest(TestStringMethods('test_searchAlongTheWay_gasStation'))
suite.addTest(TestStringMethods('test_searchAlongTheWay_atm'))
suite.addTest(TestStringMethods('test_searchAlongTheWay_chargingStation'))
suite.addTest(TestStringMethods('test_searchAlongTheWay_frontBackSwitch'))
suite.addTest(TestStringMethods('test_auto_day_nightMode'))
suite.addTest(TestStringMethods('test_voic_avoidCongestion'))
suite.addTest(TestStringMethods('test_voic_noHighSpeedRoute'))
suite.addTest(TestStringMethods('test_voic_chargeLess'))
suite.addTest(TestStringMethods('test_voic_highSpeedPriority'))
suite.addTest(TestStringMethods('test_openRoad'))
suite.addTest(TestStringMethods('test_closeRoad'))
suite.addTest((TestStringMethods('test_switchFollowMode')))
suite.addTest(TestStringMethods('test_switchDueNorthMode'))
suite.addTest(TestStringMethods('test_switch2DMode'))
suite.addTest(TestStringMethods('test_switch3DMode'))
suite.addTest(TestStringMethods('test_switchDayMode'))
suite.addTest(TestStringMethods('test_switchNightMode'))
suite.addTest(TestStringMethods('test_zoomInMap'))
suite.addTest(TestStringMethods('test_zoomOutMap'))
suite.addTest(TestStringMethods('test_HomeUIDisplay'))
suite.addTest(TestStringMethods('test_morePanels_UIDisplay'))
suite.addTest(TestStringMethods('test_packUp_morePanels'))
suite.addTest(TestStringMethods('test_morePanels_clickSearch'))
suite.addTest(TestStringMethods('test_favorites_page'))
suite.addTest(TestStringMethods('test_search_record_display'))
suite.addTest(TestStringMethods('test_click_clearHistory'))
suite.addTest(TestStringMethods('test_clear_cache_page_display'))
suite.addTest(TestStringMethods('test_clear_cache'))
suite.addTest(TestStringMethods('test_clear_cache_field_display'))
suite.addTest(TestStringMethods('test_cacheDataIs0_click_clear_cache'))
#suite.addTest(unittest.makeSuite(test_mapauto.MyTest))

# with open(r'/Users/v_wangjiwei01/Desktop/report01.html', 'wb') as fp:
#     runner = TestRunner(fp, title='Phase4UITest', description='Phase4UITestDetail', verbosity=2)
#     runner.run(suite)
#     emais = sendEmail()
#     emais.sendemail()
python中unittest框架+htmlrunner来实现测试报告生成 大家熟知python中很多测试框架,经常使用的就是unittest、pytest、seldom等等。 而在做UI自动化或者接口自动化时,不知道怎么去美化你的报告。 1.当我们需要调试一部分用例,可以根据用例名称数字进行拼接然后加入测试套件,进行执行。 ```python if __name__ == '__main__': suite = unittest.TestSuite() ids = 165 while ids < 173: basename = 't 阅读详情

相关推荐

python3,HTMLTestRunner多样式代码

python3,HTMLTestRunner多样式代码,附有所有样式代码,以及测试代码,及样式截图,欢迎下载。

python htmltestrunner报告_Python自定义HtmlTestRunner测试报告

简述使用selenium webdriver + Python做自动化测试,执行完成后要生成测试报告,Python我们使用的HTMLtestrunner 进行生成,但是默认提供的生成报告内容,并不能满足我们的需求,怎么才能让测试报告数据更清晰,内容更丰富呢。对于一些人来说,可能已经重写了报告生成方式,放弃使用HTMLtestrunner。但是对于python小白可能还做不到,只能用现有东西进行展示...

weixin_39519769的博客 397

python3的HTMLRunner.py

python3的HTMLRunner.py

Python3 HTMLRunner测试报告

HTMLRunner测试报告: from appium import webdriver import HTMLTestRunner import time import unittest import warnings 此处省去过程代码 if __name__ == '__main__': print("----------执行---------- ") suite = unittest.TestSuite() # 构造测试集 suite.add.

生活中最美丽的样子 507

基于Python3语法的HTMLTestRunner.py

0.8.2版本的HTMLTestRunner,把原有文件中Python2语法部分全部更新成了Python3语法

HTMLTestRunner-基于python3-日志显示-截图显示

经过总结网络上其他人的版本,加入了截图和日志正常显示的功能,基于python3,

python+unittest+requests+HTMLRunner搭建接口测试框架,执行用例请求多个不同请求方式的接口_htmltestrunner部署

⑤ 从base.py文件获取到请求地址后,需要组合不同类型的请求方式,如get请求直接将参数与地址进行拼接,或post请求以json数据格式等为请求体请求接口,然后再获取接口对象,得到接口返回的数据,此过程涉及的方法封装到request_way.py(注:该实例get请求返回数据格式为jsonp,因此需要jsonp格式数据转换为json格式的方法)41 # 校验实际接口返回结果和用例预期结果是否一致(校验json数组中的status值和message是否返回成功)

2401_84254057的博客 504

支持Python3的HTMLTestRunner

由于官方下载的HTMLTestRunner是基于python2写的,参照网上资料修改了一份支持python3 的HTMLTestRunner

appium学习【一】:pycharm运行不生成HtmlTestRunner测试报告

参考文章和解决办法:http://blog.youkuaiyun.com/xie_0723/article/details/50825310       http://jingyan.baidu.com/article/cbcede071e479e02f40b4dc5.html 根本原因: 其实这是编辑器搞得鬼,编辑器为了方便用户执行测试,都有一项功能,可以用编辑...

weixin_30394251的博客 150

HTMLTestRunner.py 基于python能直接使用的

能直接用于python3在测试中,生成html格式的插件,因为本身无python3的,只有python2的,这是已经改好了的,下载后可以直接使用的

3D视觉革命丨多相机协同拼接技术如何重塑工业检测边界

本文深入探讨了多相机协同拼接技术如何突破单台3D相机的物理局限,实现工业检测从“点面”到“立体”的无死角覆盖。通过拆解系统标定、同步融合等核心技术,并结合锂电池、长轴零件等实战案例,揭示了该技术如何以虚拟“超级视觉传感器”重塑检测边界,提升精度与效率。

weixin_29056865的博客 387

python3中可用的HTMLTestRunner

""" A TestRunner for use with the Python unit testing framework. It generates a HTML report to show the result at a glance. The simplest way to use this is to invoke its main method. E.g. import ...

qq_24208765的博客 1059

RAG开源框架深度评测:从RAGFlow到Dify的实战选型指南

本文深度评测了主流RAG开源框架(RAGFlow、Dify、WeKnora)的核心能力与实战表现,提供企业级选型指南。重点对比了文档解析、检索性能和生产部署等关键指标,揭示RAGFlow在复杂文档处理、Dify在低代码开发、WeKnora在腾讯生态集成的差异化优势,并给出技术选型决策树与成本优化方案。

weixin_29294597的博客 825

python unittest框架&生成html报告学习笔记

unittest基本框架 import unittest class RunCase(unittest.TestCase): @classmethod def setUpClass(cls): print('所有case执行之前的前置') @classmethod def tearDownClass(cls): print('所有case执行之后的后置') def s...

持之以恒,脚踏实地 1909

Vienna整流器SVPWM调制:7扇区划分与中点电位平衡的MATLAB/Simulink实现解析

本文深入解析Vienna整流器的SVPWM调制技术,重点介绍7扇区划分与中点电位平衡的MATLAB/Simulink实现方法。通过详细的算法推导和仿真模型构建,帮助工程师掌握整流器闭环控制策略,优化功率转换效率。内容涵盖扇区判断逻辑、矢量作用时间计算及中点电位平衡的PID调节等核心技术要点。

weixin_33937499的博客 386

SAP ERP销售应收&成本科目确定

ERP作为业财一体软件,其中最核心的就是业务与财务模块的自动集成,无需财务进行手工做账,提高工作效率的同时降低人工操作产生的误差。今天浅浅的分享一下SD模块生成会计凭证时,借贷项确定的系统配置。一般项目上借贷项、科目都有FICO提供,但是具体的集成配置是在SD这边。

weixin_43657667的博客 1568

unitTest(生成 HTMLTestRunner 模块)

一:生成 HTMLTestRunner 模块 unittest 里面是不能生成 html 格式报告的,需要导入一个第三方的模块:HTMLTestRunner 方法1.这个模块下载不能通过 pip 安装了,只能下载后手动导入,下载地址:http://tungwaiyip.info/software/HTMLTestRunner.html 方法2.在 python 安装文件的 Lib 目录...

一个老宅男 913

《UDS协议从入门到精通》系列——到底什么是DTC?

到底什么是DTC?看这里,深度图解DTC格式,详述DTC状态位、快照信息和扩展信息!!

车载系统攻城狮 1万+

【功能自动化】使用HTMLTestRunner生成测试报告

1.部署webtours网站。

a272329874a的博客 1883

科研绘图系列:R语言绘制世界地图数据分布(world map)

科研绘图系列:R语言绘制世界地图数据分布(world map)

专注生信领域 527

硅电容的工艺结构原理及选型参数总结

硅电容,也称为硅质电容或硅二极管电容,是一种特殊的电容器。它利用硅二极管的结构来实现电容的功能。本文对硅电容的工作原理,结构特点,选型参数及设计注意事项进行总结。

fydar的博客 2331

【UI自动化测试】Appium+Python+Unittest+HTMLRunner

使用Android SDK的uiautomatorviewer.bat(在..\sdk\tools\ 目录下),电脑开启开发者模式,可以使用adb命令的状态下使用该sdk自带的工具,可视化安卓手机的界面信息。3.每个用例又分独立的page层,例如测试集里的用例test_16_creat_aquatype,其page层就是PoolPage,在编写测试集时引入该文件即可,也就是testcase层调用page层。反编译apk,反编译后打开AndroidManifest.xml文件,文件会有package信息。

dad22211的博客 1107

AgentScope 2.0 API完全指南:构建企业级AI智能体应用的技术实践

本文系统梳理AgentScope 2.0框架的完整API体系,涵盖智能体核心引擎、统一模型适配层、工具系统、消息协议、权限控制与工作空间管理等七大核心模块。通过深入的源码级分析与架构图示,详细解读Agent类的推理-行动循环、ChatModelBase的多模型抽象、Toolkit的工具管理机制、ContentBlock的多模态内容表达、PermissionEngine的安全决策流程,以及Local/Docker/E2B三种工作空间实现。文章还提供了智能客服系统的完整实战案例,展示从自定义工具开发到流式服务部

program哲学 407

Python3 引用HTMLTestRunner

我们在做自动化测试的时候,希望能生一张漂亮的测试报告来展示用例执行的结果,HTMLTestRunner就能满足你的愿望。HTMLTestRunner 是 Python 标准库的 unittest 模块的一个扩展。它生成易于使用的 HTML 测试报告。 首先要下载 HTMLTestRunner.py 文件,下载地址:http://tungwaiyip.info/software/HTMLTestRu...

非攻的博客 9926

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

【编写UI自动化测试集】Appium+Python+Unittest+HTMLRunner​

使用Android SDK的uiautomatorviewer.bat(在..\sdk\tools\ 目录下),电脑开启开发者模式,可以使用adb命令的状态下使用该sdk自带的工具,可视化安卓手机的界面信息。3.每个用例又分独立的page层,例如测试集里的用例test_16_creat_aquatype,其page层就是PoolPage,在编写测试集时引入该文件即可,也就是testcase层调用page层。config.py 存放自动化测试所用到的数据,如账号密码,默认密码等。

OKCRW的博客 840

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

python3 HTMLTestRunner.py

""" A TestRunner for use with the Python unit testing framework. It generates a HTML report to show the result at a glance. The simplest way to use this is to invoke its main method. E.g. ...

568

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

上一篇: python性能测试
下一篇: Python 多线程统计
等风等雨
博客等级 码龄10年 42粉丝 223原创
评论 2
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值