Commit 2629b0c6 authored by 林颖's avatar 林颖

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

parents ca5c338b 79afc43c
......@@ -71,5 +71,5 @@ if __name__ == '__main__':
print(web2_request().artemis_ad_add_shopping_cart_info())
print(web2_request().artemis_add_value_order_id_detail())
print("---11233353667----")
#print(web2_request().artemis_ad_packageorder_detail("685529883901"))
print(web2_request().artemis_ad_packageorder_detail("685529883901"))
......@@ -86,7 +86,7 @@ artemis_ad_packageorder_detail:
method: get
url: /api/web2/artemis/ad/packageorder/detail
params:
package_order_id:${package_order_id}
package_order_id: ${package_order_id}
data: {}
json: {}
isLogin: 1 #需要登录
\ No newline at end of file
......@@ -72,6 +72,9 @@ class web_request(BaseRequest):
def artemis_order_id_detail(self):
"上线中订单详情页"
return self.api_send(self.ACCOUNT_URL["artemis_order_id_detail"])
def cpc_community_homepage(self):
"点点通-内容-概览"
return self.api_send(self.ACCOUNT_URL["cpc_community_homepage"])
......@@ -96,4 +99,5 @@ if __name__ == '__main__':
print(web_request().artemis_order_list(0, 1))
print(web_request().artemis_order_list(1, 1))
print(web_request().artemis_order_list(2, 1))
print(web_request().artemis_order_id_detail())
\ No newline at end of file
print(web_request().artemis_order_id_detail())
print(web_request().cpc_community_homepage())
\ No newline at end of file
......@@ -153,4 +153,12 @@ artemis_order_id_detail:
params: {}
data: {}
json: {}
isLogin: 1 #需要登录
cpc_community_homepage:
method: get
url: /api/web/cpc_community/homepage
params: {}
data: {}
json: {}
isLogin: 1 #需要登录
\ No newline at end of file
develop_host:
backend: http://backend.paas-develop.env
# om: http://om.paas-develop.env
# doctor: http://doctor.paas-develop.env
# backend: https://backend.igengmei.com
om: http://om.paas-develop.env
doctor: http://doctor.paas-develop.env
# backend_online: https://backend.igengmei.com
......@@ -59,7 +59,7 @@ class BaseRequest:
s = requests
if req.get('isLogin'):
s = LoginFunction().get_session()
s = LoginFunction().get_session(host_service)
# 调用具体case的url
r = s.request(
......
......@@ -15,56 +15,20 @@ class LoginFunction:
with open(path, encoding='utf-8') as f:
return yaml.safe_load(f)
def get_session(self):
hostList = self.host['develop_host']
for key in hostList:
if 'backend' == key:
return self.get_develop_session()
if 'doctor' == key:
return self.get_doctor_session()
elif 'om' == key:
return self.get_om_session()
def get_develop_session(self):
url = self.host["develop_host"]["backend"] + self.params["backend_login"]["url"]
def get_session(self, host_service):
project_login = host_service + "_login"
url = self.host["develop_host"][host_service] + self.params[project_login]["url"]
s = requests.session()
r = s.request(
self.params["backend_login"]["method"],
self.params[project_login]["method"],
url=url,
params=self.params["backend_login"]["params"],
data=self.params["backend_login"]["data"],
params=self.params[project_login]["params"],
data=self.params[project_login]["data"],
headers={'Connection': 'close'},
# verify=False
)
return s
def get_doctor_session(self):
url = self.host["develop_host"]["doctor"] + self.params["doctor_login"]["url"]
s = requests.session()
r = s.request(
self.params["doctor_login"]["method"],
url=url,
params=self.params["doctor_login"]["params"],
data=self.params["doctor_login"]["data"],
headers={'Connection': 'close'}
)
return s
def get_om_session(self):
url = self.host["develop_host"]["om"] + self.params["om_login"]["url"]
s = requests.session()
r = s.request(
self.params["om_login"]["method"],
url=url,
params=self.params["om_login"]["params"],
data=self.params["om_login"]["data"],
headers={'Connection': 'close'}
)
return s
if __name__ == '__main__':
LoginFunction().get_session()
\ No newline at end of file
......@@ -431,8 +431,12 @@ ORDERLIST=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "arte
ORDERIDDETAIL=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "artemis_order_id_detail.yaml")
#医生后台-我的服务订单-已购买订单
VALUEORDERIDDETAIL=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web2_data", "artemis_add_value_order_id_detail.yaml")
#医生后台-我的服务订单-已购买广告包
ADPACKAGEORDERDETAIL=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web2_data", "artemis_ad_packageorder_detail.yaml")
#医生后台-点点通商品-概览
CPCHOMEPAGE=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "cpc_homepage.yaml")
#医生后台-点点通内容-概览
CPCCOMMUNITYHOMEPAGE=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "cpc_community_homepage.yaml")
#更美次卡橱窗组件商品
VISUAL_BEAUTY_CARD_SERVICES_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "visual_beauty_card.yaml")
......
......@@ -3,7 +3,7 @@ reply_create:
beuzhu: '# 备注: 这个文件有冲突的话,那个版本都行不会影响,回退/接受当前版本都行,因为每次运行content都会改变'
case: 日记贴一级评论创建--正常校验&创建二级评论--正常校验
channel: benzhan
content: ces测试+2021-06-23 11:41:50
content: ces测试+2021-06-28 16:25:25
message: 请勿回复重复内容
message1: 回复成功
message2: 你的回复有点频繁,稍后再来
......
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_doctor_api.web2_request import web2_request
class TestArtemisAdPackageorderDetail:
data = BaseRequest().api_load(path_setting.ADPACKAGEORDERDETAIL)
adpackageorderdetail_case, adpackageorderdetail_data = get_ids(data, "artemis_ad_packageorder_detail")
@pytest.mark.parametrize("param",adpackageorderdetail_data,ids=adpackageorderdetail_case)
def test_artemis_ad_packageorder_detail(self, param):
'''我的服务订单-已支付广告包'''
r = web2_request().artemis_ad_packageorder_detail(param["package_order_id"])
print(r)
if r["error"] == 0:
advertise_source = r.get("data").get("info").get("advertise_source", [])
#ExtendValue["info"] = json.loads(ExtendValue["info"])
assert len(advertise_source) > param["assert"]
......@@ -18,4 +18,6 @@ class TestArtemisOrderList:
if r["error"] == 0:
orders = r.get("data").get("orders", [])
assert len(orders) >= param["assert"]
if r["error"] == 300002:
assert r["message"] == param["assert_message"]
......@@ -6,7 +6,7 @@ from in_common.base_request import BaseRequest
from all_doctor_api.web_request import web_request
class TestService:
class TestConversationCoupon:
data = BaseRequest().api_load(path_setting.CONVERSATIONCOUPON)
conversationcoupon_case, conversationcoupon_data = get_ids(data, "conversation_coupon")
......
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_doctor_api.web_request import web_request
class TestCpcCommunityHomepage:
data = BaseRequest().api_load(path_setting.CPCCOMMUNITYHOMEPAGE)
cpccommunityhomepage_case, cpccommunityhomepage_data = get_ids(data, "cpc_community_homepage")
@pytest.mark.parametrize("param",cpccommunityhomepage_data,ids=cpccommunityhomepage_case)
def test_cpc_community_homepage(self, param):
'''点点通-概览'''
r = web_request().cpc_community_homepage()
if r["error"] == 0:
if r["data"]["account"] <= "0":
assert r["data"]["is_cpc"] == param["assert"]
else:
assert r["data"]["is_cpc"] == param["assert1"]
artemis_ad_packageorder_detail:
#我的服务订单-已支付广告包
-
case: "我的服务订单-已支付广告包"
package_order_id: "685529883901"
assert: 0
artemis_order_list:
#我的服务订单case
-
case: "我的服务订单请求失败case"
case: "我的服务订单参数错误case"
status: ""
page: 1
assert: 0
assert_message: "错误参数: status"
-
case: "我的服务订单-待支付广告包case"
status: 0
......
......@@ -5,7 +5,7 @@ conversation_coupon:
doctor_user_id: "602329"
assert: 0
-
case: "点击私信发送优惠券按钮接口报错"
case: "点击私信发送优惠券按钮缺少参数case"
doctor_user_id: "602329"
assert: 0
assert_message: '缺少参数: doctor_user_id'
......
......@@ -10,7 +10,7 @@ conversation_user_id:
assert_message: "消息发送成功"
assert_name: "露露2"
- case: "发送失败"
- case: "权限校验case:没有权限"
type: 0
content: 您好
doctor_user_id: 6023291
......
cpc_community_homepage:
#点点通内容-概览case
-
case: "点点通内容概览"
#doctor_user_id: "602329"
assert: False
assert_account: 0
assert1: True
\ No newline at end of file
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