Commit 3d12f8fa authored by 张伟男's avatar 张伟男

Merge branch 'common_dev' into zwn_dev

parents 021fb573 0e8407e2
import path_setting
from in_common.base_request import BaseRequest
class gmai_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.GMAI_SKIN_NEWREPORT_CONFIG)
# 测颜值结果页
def skin_newReport(self,version,image_url):
self.params["version"] = version
self.params["image_url"] = image_url
return self.api_send(self.data["skin_newReport"])
if __name__ == '__main__':
print(gmai_request().skin_newReport("7.43.0","https://pic.igengmei.com/2021/05/11/1440/25e4bf45673f-s"))
\ No newline at end of file
skin_newReport:
method: post
url: /gm_ai/skin/new_report
params:
version: ${version}
data:
image_url: ${image_url}
......@@ -50,6 +50,10 @@ ONEIMAGE_SHARE_V4_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/
# 测颜值根据五官推荐美购
ONEIMAGE_RECOMEND_SERVICES_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/oneimage_data", "recomend_services.yaml")
# 测肤结果页
GMAI_SKIN_NEWREPORT_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "gmai_request.yaml")
GMAI_SKIN_NEWREPORT_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/gmai_data", "skin_newReport.yaml")
LOGIN_PASSWD = os.path.join(BASE_DIR, "backend_auto/test_backend_data/accounts_data", "login_passwd.yaml")
LOGIN_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "accounts_request.yaml")
......
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.gmai_request import gmai_request
# 测肤结果页
class TestSkinNewReport:
data = BaseRequest().api_load(path_setting.GMAI_SKIN_NEWREPORT_DATA)
skinnewReport_case, skinnewReport_data = get_ids(data, "skin_newReport")
@pytest.mark.parametrize("param",skinnewReport_data,ids=skinnewReport_case)
def test_skinnewReport(self,param):
r = gmai_request().skin_newReport(param["version"], param["image_url"])
if r["error"] == 0:
data = r.get("data")
# 大家都在买
packages = data.get("packages")
assert len(packages) == 6
# 皮肤检测结果
disadvantage_tabs = data.get("disadvantage_tabs")
result_word = disadvantage_tabs[0].get("result_word")
assert result_word == "色素型黑眼圈"
skin_newReport:
#测颜值根据五官推荐美购
-
case: "请求成功"
version: "7.43.0"
image_url: "https://pic.igengmei.com/2021/05/11/1440/25e4bf45673f-s"
assert: 1
\ 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