当前位置: 首页 > news >正文

我国网站建设现状上海公司注册联贝财务优势

我国网站建设现状,上海公司注册联贝财务优势,怎么做网页动图,东莞著名网站建设api: 存储测试接口 conftest.py :设置前置操作 目前前置操作:1、获取token并传入headers,2、获取命令行参数给到环境变量,指定运行环境commmon:存储封装的公共方法 connect_mysql.py:连接数据库http_requests.py: 封装…

api: 存储测试接口

conftest.py :设置前置操作

         目前前置操作:1、获取token并传入headers,2、获取命令行参数给到环境变量,指定运行环境

commmon:存储封装的公共方法

     connect_mysql.py:连接数据库http_requests.py: 封装自己的请求方法logger.py: 封装输出日志文件read_yaml.py:读取yaml文件测试用例数据read_save_data.py:读取保存的数据文件

case: 存放所有的测试用例

data:存放测试需要的数据
save_data: 存放接口返回数据、接口下载文件
test_data: 存放测试用例依赖数据
upload_data: 存放上传接口文件

logs: 存放输出的日志文件

report: 存放测试输出报告

getpathinfo.py :封装项目测试路径

pytest.int :配置文件

requirement.txt: 本地python包(pip install -r requirements.txt 安装项目中所有python包)

run_main.py: 项目运行文件

# 结构设计

1.每一个接口用例组合在一个测试类里面生成一个py文件

2.将每个用例调用的接口封装在一个测试类里面生成一个py文件

3.将测试数据存放在yml文件中通过parametrize进行参数化,实现数据驱动

4.通过allure生成测试报告

## 代码展示
api/api_service.py #需要测试的一类接口

‘’’
Code description:服务相关接口
Create time: 2020/12/3
Developer: 叶修
‘’’
import os
from common.http_requests import HttpRequests

class Api_Auth_Service(object):

def __init__(self):self.headers = HttpRequests().headersdef api_home_service_list(self):# 首页服务列表# url = "http://192.168.2.199:9092/v1/auth/auth_service/findAuthService"url = os.environ["host"] + "/v1/auth/auth_service/findAuthService"  # 读取conftest.py文件地址进行拼接response = HttpRequests().get(url, headers=self.headers, verify=False)# print(response.json())return responsedef get_service_id(self):#获取银行卡三要素认证服务idurl = "http://192.168.2.199:9092/v1/auth/auth_service/findAuthService"#url = os.environ["host"] + "/v1/auth/auth_service/findAuthService"  # 读取conftest.py文件地址进行拼接response = HttpRequests().get(url,headers=self.headers)#print(response.json()['data'][0]['service_list'][0]['id'])service_id = response.json()['data'][0]['service_list'][1]['id']return service_iddef api_service_info(self,serviceId='0b6cf45bec757afa7ee7209d30012ce1',developerId=''):#服务详情body = {"serviceId" :serviceId,"developerId":developerId}url = "http://192.168.2.199:9092/v1/auth/auth_service/findServiceDetail"#url = os.environ["host"] + "/v1/auth/auth_service/findServiceDetail"#读取conftest.py文件地址进行拼接response = HttpRequests().get(url,headers=self.headers,params = body,verify=False)#print(response.json())return responsedef api_add_or_update_service(self,api_param_req,api_param_res,description,error_code,icon,id,interface_remarks,name,product_info,request_method,sample_code,sort,type,url):#服务添加或者更新body={"api_param_req": api_param_req,"api_param_res": api_param_res,"description": description,"error_code": error_code,"icon": icon,"id": id,"interface_remarks": interface_remarks,"name": name,"product_info": product_info,"request_method": request_method,"sample_code": sample_code,"sort": sort,"type": type,"url": url,}#url = "http://192.168.2.199:9092/v1/auth/auth_service/insertOrUpdateService"url = os.environ["host"] + "/v1/auth/auth_service/insertOrUpdateService"  # 读取conftest.py文件地址进行拼接response = HttpRequests().post(url,json=body,headers=self.headers,verify=False)return responsedef api_add_service_price(self,id,max_number,money,service_id,small_number):#服务价格添加body = {"id": id,"max_number": max_number,"money": money,"service_id": service_id,"small_number": small_number}# url = "http://192.168.2.199:9092/v1/auth/auth_service/insertServicePrice"url = os.environ["host"] + "/v1/auth/auth_service/insertServicePrice"  # 读取conftest.py文件地址进行拼接response = HttpRequests().post(url, json=body, headers=self.headers, verify=False)return responsedef api_apply_service(self,developer_id,service_id):#申请服务body ={"developer_id": developer_id,"service_id": service_id}# url = "http://192.168.2.199:9092/v1/auth/auth_service/applyService"url = os.environ["host"] + "/v1/auth/auth_service/applyService"  # 读取conftest.py文件地址进行拼接response = HttpRequests().post(url, json=body, headers=self.headers, verify=False)return response

if name == ‘main’:
#Auth_Service().api_home_service_list()
Api_Auth_Service().get_service_id()
#Auth_Service().api_service_info()

api_service.py**最后:下方这份完整的软件测试视频学习教程已经整理上传完成,朋友们如果需要可以自行免费领取 【保证100%免费】**![](https://img-blog.csdnimg.cn/5de4729f538d4c8e8774f46cbc48891f.png#pic_center)![在这里插入图片描述](https://img-blog.csdnimg.cn/1b48e1bf50c947a0b047dab446f9a23a.png#pic_center)
http://www.yayakq.cn/news/11520/

相关文章:

  • 网站开发前端兼职网站建设需要会一些啥
  • 购物网站开发面试科技感办公室设计
  • 给个网站急急急2021梁山企业网站建设
  • 网站建设步骤详解网站首眉怎么做
  • 个人秀网站北京注册公司规定
  • 网站开发项目周报免费网站开发
  • 临沂专业网站制作公司直通车怎么开效果最佳
  • 网站营销方法坑梓网站建设流程
  • 遵义网站建设网帮你海口专业网站建设
  • 广东中山建设信息网站中国移动有免费的视频app
  • 公司网站建设注意点湖南营销型网站
  • 四川省建设工程设备安全协会网站免费做橙光封面的网站
  • 网站设计制作用软件网站开发采购合同模板下载
  • ppt做的模板下载网站奥远网站建设流程
  • win7 iis7 添加网站怎么搭建一个博客网站
  • 卢氏县住房和城乡规划建设局网站网站设计要多久
  • 网站排名 算法中英文双语网站站点
  • 给人做传销网站龙华o2o网站建设
  • 菠菜彩票网站怎么建设建网站要注意些什么
  • 网上购物网站建设需求外贸网站建设收益
  • 石碣做网站有没学做早餐的网站
  • ie 10 常用网站做旅游网站的项目背景
  • 福州网站设计外包怎么看网站的建设时间
  • 网站怎么做转发网站开发维护岗位职责
  • 用照片做视频的网站好做网站的一定要开80或8080端口
  • 外贸企业网站模板郑州上海做网站的公司
  • 海南网站建设优化排名濮阳市建设分局网站
  • 网站开发小程序商标注册代理
  • 旅游建设投资公司中网站中国电子加工网
  • 昆明酒店网站建设电子商务网站建设网站电子版