Commit 36e19729 authored by admin's avatar admin

Merge branch 'common_dev' of http://git.wanmeizhensuo.com/dengyingying/backend_auto into common_dev

parents b7a3e587 808e73ea
......@@ -4,7 +4,7 @@ from in_common.base_request import BaseRequest
class account_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.APYAML_CONFIG)
self.loginvfc = self.api_load(path_setting.APYAML_CONFIG)
def login_vfc(self,current_city_id,phone_num,vfc_code,vfc_type="",face_token=""):
self.params["current_city_id"] = current_city_id
......@@ -12,7 +12,8 @@ class account_request(BaseRequest):
self.params["vfc_code"] = vfc_code
self.params["vfc_type"] = vfc_type
self.params["face_token"] = face_token
return self.api_send(self.data["login_vfc"])
return self.api_send(self.loginvfc["login_vfc"])
if __name__ == '__main__':
......
......@@ -6,3 +6,5 @@ def pytest_collection_modifyitems(items):
for item in items:
item.name = item.name.encode("utf-8").decode("unicode_escape")
item._nodeid = item.nodeid.encode("utf-8").decode("unicode_escape")
develop_host:
url: http://backend.paas-develop.env
# url: http://doctor.paas-develop.env/
......@@ -4,6 +4,7 @@ BASE_DIR = os.path.dirname(os.path.dirname(__file__))
sys.path.append(BASE_DIR)
HOSTYAML_CONFIG = os.path.join(BASE_DIR, "backend_auto", "host.yaml")
APYAML_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "account_request.yaml")
LOGIN_VFC = os.path.join(BASE_DIR, "backend_auto/test_backend_data/account_data", "login_vfc.yaml")
......
......@@ -6,7 +6,9 @@
- 公共分支 common_dev
- 其他分支 参与项目的人每人创建一个已自己名字命名的分支,格式 dyy_dev
### 提交代码规范
### 提交代码及编写规范
- !!!切记一,在本地写代码时,一定要再三确认是在自己的分支进行改动,不要在master分支修改
- !!!切记二:提交代码,Git add时,不要添加in_common文件里面的文件,这个是公共方法,不能随意改动,如果本地误改动了,提交后,会影响整个流程
- 为了便于项目的管理维护,参与者可以将自己的代码确保运行成功的前提下,提交到自己分支,然后每周往commo_dev
分支提交代码,负责人会将common_dev分支每周往master分支合并,参与者可每周一更新本地代码,确保自己的代码是最新的
- 本地代码提交Git仓库时,避免已经上传的代码被覆盖,请Git push之前,先操作git pull,在本地解决好冲突后,再Git push
......@@ -47,15 +49,21 @@
```
![](.readme_images/request请求方法.png)
- 然后在account_request.yaml中写请求数据,结构如图
- 并且需要在该类中,读取path_setting路径中,配置的接口的yaml数据文件
![](.readme_images/接口yaml数据读取.png)
- 然后在account_request.yaml中写接口请求数据(接口路径,传参),结构如图
![](.readme_images/yaml文件.png)
- 然后写test_data,在test_backend_data目录下,找到account_data文件,创建yaml文件,yaml文件格式介绍,如图
![](.readme_images/yaml.png)
- 将用例的路径放到path_setting.py下
- 将用例的路径放到path_setting.py下,这里面有2个路径需要放到里面,第一个是all_backend_api下创建的XXX_request.yaml文件
第二个是test_backend_case下创建的XXX.yaml文件
![](.readme_images/路径.png)
......
import pytest
import path_setting
@pytest.fixture()
def login():
self.data = self.api_load(path_setting.APYAML_CONFIG)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment