代码拉取完成,页面将自动刷新
import time, hashlib
from common_func.login import *
# httprunner缺点
"""
1.没有idea自动提示错误功能
2.suite无法多次运行,没有一个参数驱动
3.缺少重试机制(异步接口,你不知道返回,)
retry: (5, 10) 5代表次数, 10代表多少时间 10s
content.code == 200
4.变量支持定义太多了,容易出问题,不好定位,缺少:变量追踪,变量的链路功能
5.debugtalk.py 不支持根据业务名,多个py文件读取
支持读取ini变量 loing_name
6.hrun3.x 版本,剔除了api层,只有case和suite2层,框架不走yml和json,写py代码,链式编程
"""
def sleep(n_secs):
time.sleep(n_secs)
def setup_login_hooks():
print("setup_login_hooks_cases....")
def teardown_login_hooks():
print("teardown_login_hooks_cases")
def setup_login_hooks_step(request):
setup_login_hooks_step(request)
def teardown_login_hooks_step(response):
teardown_login_hooks_step(response)
def md5(str):
a = hashlib.md5()
a.update(str)
return a.hexdigest()
# print(md5("123456".encode("utf-8")))
def skipif_test():
print("test_skipif。。。。。。。")
return False
def retern_task_name(task_name):
import time
return f"{time.time()}_{task_name}"
# print(retern_task_name("test_jelly"))
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。