代码拉取完成,页面将自动刷新
同步操作将从 王星元/Auto_Testing 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
from core.Setting import mail
from core.Auto import AUTO
from wxy_Mail import Mail
from core.Linux import close_monitor
import traceback
import time
import os
if __name__ == '__main__':
AUTO.SetUp(
'直播课堂5.9web测试',
["D:\Python\\fulaan\LIVE\压测1\jmeter_script\web1-getMyAllBuyExcellentCourses.do.jmx",
"D:\Python\\fulaan\LIVE\压测1\jmeter_script\web2-getMyOwnDetails.do.jmx",
"D:\Python\\fulaan\LIVE\压测1\jmeter_script\web3-gotoClass.do.jmx",
"D:\Python\\fulaan\LIVE\压测1\jmeter_script\web4-booleanBackList.do.jmx",
"D:\Python\\fulaan\LIVE\压测1\jmeter_script\web5-booleanUserAgreement.do.jmx",
"D:\Python\\fulaan\LIVE\压测1\jmeter_script\web6-getAllRole.do.jmx",
"D:\Python\\fulaan\LIVE\压测1\jmeter_script\web7-myRoleCommunitys.do.jmx"],
"D:\Python\\auto",
600,
)
try:
t1 = time.time()
AUTO.StartTest()
t2 = time.time()
mail = Mail(mail['user'], mail['password'])
mail.add_subject('测试完成')
mail.add_receivers(['490347953@qq.com'])
content = '测试完成,共耗时{}h'.format(round((t2 - t1) / 3600, 2))
mail.add_content('plain', content)
mail.send()
# os.popen('shutdown -s')
except Exception as e:
error=traceback.format_exc()
mail = Mail(mail['user'], mail['password'])
mail.add_subject('测试终止')
mail.add_receivers(['490347953@qq.com'])
mail_fpath=os.path.dirname(__file__)+'\mail\\test_fail.html'
with open(mail_fpath,'r',encoding='utf-8') as f:
content=f.read()
content=content.format(error).replace('\n','<br>')
mail.add_content('html', content)
mail.send()
close_monitor()
# os.popen('shutdown -s')
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。