diff --git a/TestData/billing/buyPlan_test_data.py b/TestData/billing/buyPlan_test_data.py index 7cd9e6e6de9f8395756b643cdc41b01382e7b124..c16708d2371ababd6317a426acfb91a2c7753c3a 100644 --- a/TestData/billing/buyPlan_test_data.py +++ b/TestData/billing/buyPlan_test_data.py @@ -5,3 +5,4 @@ class buyPlanData(Global): numItem = [1,2,10] #有额度限制的服务 today = str(datetime.datetime.now().date()) next_month = str(datetime.date.today() + datetime.timedelta(days=30)) + ProPlanId = 12 \ No newline at end of file diff --git a/YamlCase/automation/ai.yaml b/YamlCase/automation/ai.yaml index 6923c58a02c5fc7c0dafccc640966b0f67ea71cf..64e8276e26102559f8c79fae7a1ecbd64c53b064 100644 --- a/YamlCase/automation/ai.yaml +++ b/YamlCase/automation/ai.yaml @@ -75,28 +75,21 @@ api8: - eq: {"$.code": 0} - exec: {"code": "assert res.json()['data']['total'] == str(int('${url_num}') + 1)"} -api9: - title: 编辑url - url: api/v1/willai/local/editAiUrl - method: post - data: {"shopId":"${shopId}","url":"${edit_url}","id":"${url_id}","v":"${v}"} - expected: - - eq: {"$.code": 0} api10: title: 查询url接口 url: api/v1/willai/local/aiUrlList method: post - data: {"page":1,"pageSize":100,"shopId":"${shopId}","v":"${v}","category": 1} + data: {"page":1,"pageSize":100,"shopId":"${shopId}","v":"${v}","category": 1,"search": "","sortType": 0} expected: - eq: {"$.code": 0} - eq: {"$.data.list[?(@.id == '${url_id}')].url": "${edit_url}"} api11: title: 刷新url - url: api/v1/willai/local/reloadAiUrl + url: api/v1/willai/local/operateAiUrl method: post - data: {"shopId":"${shopId}","id":["${url_id}"],"v":"${v}"} + data: {"shopId":"${shopId}","idList":["${url_id}"],"v":"${v}","selectAll": false,"status": 1,"excludeIdList": []} expected: - eq: {"$.code": 0} @@ -104,7 +97,7 @@ api12: title: 删除url url: api/v1/willai/local/deleteAiUrl method: post - data: {"shopId":"${shopId}","id":["${url_id}"],"v":"${v}"} + data: {"shopId":"${shopId}","idList":["${url_id}"],"v":"${v}","selectAll": false,"status": 2,"excludeIdList": []} expected: - eq: {"$.code": 0} @@ -112,7 +105,7 @@ api13: title: 查询url接口 url: api/v1/willai/local/aiUrlList method: post - data: {"page":1,"pageSize":100,"shopId":"${shopId}","v":"${v}","category": 1} + data: {"page":1,"pageSize":100,"shopId":"${shopId}","v":"${v}","category": 1,"sortType": 0} expected: - eq: {"$.code": 0} - not_in_list: {"$.data.list[*].id": "${url_id}"} diff --git a/YamlCase/billing/buyPlan.yaml b/YamlCase/billing/buyPlan.yaml index 8bceb31799a68f3739dff1f3f71dfa99cfce6e92..aff3de3b13d469610396752c8f9dcf193000607d 100644 --- a/YamlCase/billing/buyPlan.yaml +++ b/YamlCase/billing/buyPlan.yaml @@ -2,7 +2,7 @@ api1: title: 查询当前月度套餐种类 url: /api/v1/businessPlan/getBasicPlan?planType=1&v=${v} method: get - set_value: {"ProPlanId" : "$.data.basicPlanList[?(@.name == 'Pro')].id" , "FreePlanId" : "$.data.basicPlanList[?(@.name == 'Free')].id"} + set_value: {"FreePlanId" : "$.data.basicPlanList[?(@.name == 'Free')].id"} expected: - eq: {"$.code": 0} diff --git a/main.py b/main.py index 06fbf6f806bd56680829ea759cbd5c0cf74e56ca..16f44f8d25eef9f0729a7df178232440ad2b5aa0 100644 --- a/main.py +++ b/main.py @@ -1,11 +1,10 @@ import pytest -from Utils.webhook_handler import webhook from Utils.sql_handler import test_env_conn if __name__ == '__main__': try: # pytest.main(['-vs',r'C:\Users\rd71\PycharmProjects\willdesk_api_auto\TestCase\inbox\test_06_channel.py',f'--alluredir=./allureReports/json','--clean-alluredir']) - pytest.main(['-vs','./TestCase',f'--html=./report.html']) #allure报告一直生成不了,改用pytest自带报告 + pytest.main(['-vs','TestCase/billing',f'--html=./report.html']) #allure报告一直生成不了,改用pytest自带报告 finally: test_env_conn.close_db() #关闭数据库链接