随笔分类 - 接口测试框架
1
摘要:api_case运行所有的excel用例: 处理警告: 网页报告产出: run_all_case.py import osimport unittestfrom utils import HTMLTestReportCNfrom utils.config_utils import local_con
阅读全文
摘要:samples: import paramunittestimport unittest@paramunittest.parametrized( (10,20), (30,40), # (100,20))class ApiTestDemo(paramunittest.ParametrizedTest
阅读全文
摘要:多借口顺序执行: 接口关联: 接口断言设计: paramunittest基础应用讲解 paramunittest批量用例执行
阅读全文
摘要:samples: ⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️ 正则比对: 检查头部: Connection,Content-Length 此时的check_utils.py # -*- coding: utf-8 -*-#@File :check
阅读全文
摘要:检查json_key_value: 检查: requests.py # -*- coding: utf-8 -*-#@File :demo_04.py#@Auth : wwd#@Time : 2020/12/10 9:09 下午import jsonimport jsonpathimport req
阅读全文
摘要:key_value断言: demo5.run_check('json_key')传入json_key,调用self.function, self.function['json_key']() self.function是构造里面的一个字典类型的属性.里面指向了方法。 self.function['j
阅读全文
摘要:⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️ 测试: 断言处理: demo_04.pyimport jsonjson_obj = {"access_token":"39_qHfCmB0GdutZ2MXC0G5IbzrM3WY7E
阅读全文
摘要:demo_01.py import requestsimport resession = requests.session()get_param_dict={ "grant_type":"client_credential", "appid":"wx55614004f367f8ca", "secre
阅读全文
摘要:re的使用参考:正则表达式基础及re模块:https://www.cnblogs.com/dream66/p/12953729.html import restr1 = '{"access_token":${token}}'dict1 = {'token': 'AFABMG'}#成果:{"acces
阅读全文
摘要:举例子: demo01.py import jsonimport requestsimport jsonpathsession = requests.session()get_param_dict={ "grant_type":"client_credential", "appid":"wx5561
阅读全文
摘要:多步请求封装,执行完一个用例 def requests(self,step_info): request_type =step_info['请求方式'] if request_type=="get": result=self.get(step_info) elif request_type == "
阅读全文
摘要:字符串转化成字典: convert_to_dict.py: import jsonstr1 = '{"grant_type":"client_credential","appid":"wx55614004f367f8ca","secret":"65515b46dd758dfdb09420bb7db2
阅读全文
摘要:将结果的所有数据整理如下: {'api_case_01': [{'测试用例编号': 'api_case_01', '测试用例名称': '获取access_token接口测试', '用例执行': '是', '用例步骤': 'step_01', '接口名称': '获取access_token接口', '
阅读全文
摘要:把excel_oper02.py 里面实现的:通过字典的方式获取所有excel数据.放进utils: ⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️ utils: def get_all_data(self): ''' 把
阅读全文
摘要:excel02.py # -*- coding: utf-8 -*-#@File :excel_oper_02.py#@Auth : wwd#@Time : 2020/12/7 8:16 下午import xlrd3workbook = xlrd3.open_workbook('test_data_
阅读全文
摘要:import xlrd3workbook = xlrd3.open_workbook('test_data.xlsx')sheet =workbook.sheet_by_name('Sheet1')print(sheet.cell_value(0,3)) #第0行,第3列print(sheet.ce
阅读全文
摘要:import osimport configparsercurrent_path =os.path.dirname(__file__)#获取config当前文件路径config_file_path = os.path.join(current_path,'..','conf','localconfi
阅读全文
摘要: 1框架数据源概述 2处理数据源用到的工具包详解 3数据源处理设计思路和实战 1框架数据源概述 框架中的数据源是指作为测试框架执行时,输入的相关 配置数据、测试用例数据等。 配置数据一般使用后缀为.ini的文件进行配置,主要对比 如测试主机地址、测试日志和报告路径等进行配置。 在实际的框架
阅读全文
摘要: 1自动化测试框架概念 2自动化测试框架思想 3接口自动化测试框架设计目标 4接口自动化测试框架用到的技术点 1自动化测试框架概念: 自动化测试框架是一个集成体系,这个体系中包含测试功能的函数库、测试数据源 、测试对象以及可重用的模块。 框架(framework)是一个框子——指其约束
阅读全文
1

浙公网安备 33010602011771号