-
Notifications
You must be signed in to change notification settings - Fork 4
ZhaoGuan/Multithreading_api_test
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
# 简介 主运行是run_devops.py 运行是 python3 run_devops.py -f case中的测试用例集合文件夹 -s 用例中的source下的内容 编写用例的时候source中主要是url等对应参数,并且表示原名运行时对调用对应内容 assert下判断内容可以使用一致的 除了yml用例以外也可是是Python脚本这样就应对了复杂逻辑,判断方式比较简单脚本中如果输入出了失败那么就判断用例失败,所以判断逻辑具体内容要注意。并且注意运行脚本时的找不到包问题,可以在脚本上方增加sys.path.append('xxxxx')来解决 # 多线程运行使用格式 ## 格式: #资源来源 如果url结尾非&那么将不会添加key在url后 如果没有可添加的参数data下内容要为空,如果data下对应内容有空则data会默认为空 source: #来源名称 test: url: https://api.kikakeyboard.com/v1/utils/get_app_config?key=sticker2& #运行循环次数 cycle_times: 1 #拼接到url中的key值(duid=sign) keys: ['duid'] #keys 对应的data数据 data: #其中app kb_lang(kb_lang=header中的lang) duid android_level(安卓api数,默认23) 都是header中的内容 #app对应值必填(给header用至少1个) app: ['kika','ikey','pro'] #kb_lang=lang必填(给header用至少1个) kb_lang : ['en_US', 'en_AU', 'es_AR', 'pt_BR', 'in_ID'] #duid必填(给header用至少1个) duid : ['5a215835df204115ee3d2d4ec0c528aa', 'adad79631d9339915e3be1c9e783e82d', 'a2bb5434f3541bf5aa64186ec8c2b77f','920b56e9cadd743bfbbcb4126937e789'] #版本号不填写默认为1477 #version可以通过对指定对象配置版本,最后一个&后填写版本之前的都是条件用&分隔 version: [] #检查点 assert: 返回码(只能第一层) code : {'key':'errorCode','value':0} #字段格式 # 字段格式 # 多个返回可能的时候使用&连接可能性,使用@@@进行字段胡洛 # 返回内容如果是个多级字段则为前置条件条件各级用&连接 # $$$表示内容可以为null或使用null data_format : {"errorCode":'Str',"errorMsg":'Str',"data":{'tag':'&&&'}} #数据检查 #eg : '维g:度':'{"key":"value"}' #前面的值是对应的维度,后面的字典内容key是对应值的路径,value是对应应该出现的值(如果值添加问#那么只坚持对应结构是否存在忽略其具体值)(单引号需要用''来表示) #填写内容验证遵守json格式,数据使用"" #可以使用条件进行判断 #eg:'ikey&920b56e9cadd743bfbbcb4126937e789':'{"data&type":"sticker"}^{"data&popup_duration":"5000"}' #维度为'ikey&920b56e9cadd743bfbbcb4126937e789'时且满足"data&type":"sticker"对应字段等于5000是才进行{"data&popup_duration":"4000"}'判断 #在维度上有字段重复的时候使用"@数字"的形势进行区分 #多可能结果 eg:'ikey&920b56e9cadd743bfbbcb4126937e789':'{"data&popup_duration":"4000&500"} #检查特定字段下的数据结构 eg: '*@1':'{"data&popupList&0&type":"sticker"}^{"data&popupList&0":{"magic": null, "type": "Str", "sticker": {"key": "Str", "sourceText": "Str", "iconUrl": "$$$&HTTP","image": {"width": "Int", "md5": "Str", "height": "Int", "url": "HTTP","size": "Int"}, "packageId": "$$$&Int&Str"}}}' #内容中带有关键字 eg:'ikey&920b56e9cadd743bfbbcb4126937e789':'{"data&extra":"~EmptyScenario"}' data下extra字段中要包含EmptyScenario这个字段其中~代表包含 data_content : {'ikey':'{"data&stickers&0&popup_duration":"5000"}'} #其他内容设定 other: #header的选择(其实就是api或api-dev) way: online #host填写(可不填) host: # 上线问接口测试使用格式 #上文 above: source: test: url: http:https://api.kikakeyboard.com/backend-picture/v1/sticker/categories? keys: ['duid'] data: app: ['kika'] kb_lang : ['en_US'] duid : ['5a215835df204115ee3d2d4ec0c528aa'] version : assert: # 返回码(只能第一层) code : {'key':'errorCode','value':0} #字段格式 data_format : {'errorCode': 'Int', 'errorMsg': 'Str', 'data': {'categories': [{'preview': 'HTTP', 'name': 'Str', 'title': 'Str'}}}} # 传递给下文的内容 # []代表list content: 'data&categories&[]&name' other: way: online host: #下文 below: source: test: url: http:https://api.kikakeyboard.com/backend-picture/v1/sticker/search? keys: ['duid','query'] data: app: ['kika'] kb_lang : ['en_US'] duid : ['5a215835df204115ee3d2d4ec0c528aa'] query: ['content'] version : assert: # 返回码(只能第一层) code : {'key':'errorCode','value':0} data_format : {'errorCode': 'Int', 'errorMsg': 'Str','data': {'stickers': [{'small': {'url': 'HTTP', 'width': 'Int', 'height': 'Int'}, 'preview': 'HTTP', 'source': 'Str', 'index': 'Int', 'large': {'url': 'HTTP', 'width': 'Int', 'height': 'Int'}, 'tags': ['@@@'], 'id': 'Str'}]}} other: way: online host: # 注意在写用例的时候字段内容要更详细的写尽量保证字典型中的字都有这样才能检测的更仔细,list进行忽略的时候要会整体忽略,字典型忽略时会对应key逐个忽略。!!!接口返回null默认是正确的!!!
About
No description, website, or topics provided.