Commit b1322255 authored by zhanhuasheng's avatar zhanhuasheng

bugfix

parent 49fe1438
import pytest
from Utils import yaml_handler
from Utils import req_handler
from TestData.automation.ai_test_data import AiTestData
class TestAi:
yaml_path = r'automation/ai.yaml'
yaml_data = yaml_handler.yaml_handler.get_case(yaml_path)
@pytest.mark.flaky(reruns=AiTestData.rerun, reruns_delay=AiTestData.rerun_delay)
@pytest.mark.parametrize('case',yaml_data)
def test_ai(self,case):
req_handler.ReqHandler.send_requests(case=case,var_class=AiTestData)
# import pytest
# from Utils import yaml_handler
# from Utils import req_handler
# from TestData.automation.ai_test_data import AiTestData
#
# class TestAi:
#
# yaml_path = r'automation/ai.yaml'
# yaml_data = yaml_handler.yaml_handler.get_case(yaml_path)
# @pytest.mark.flaky(reruns=AiTestData.rerun, reruns_delay=AiTestData.rerun_delay)
# @pytest.mark.parametrize('case',yaml_data)
# def test_ai(self,case):
# req_handler.ReqHandler.send_requests(case=case,var_class=AiTestData)
from Utils.sql_handler import test_env_conn
from TestData.setting.team_test_data import teamData
team_select_sql = f'select * from `resource_item` where brand_id = {teamData.brandId} and resource_id = 1'
team_select_sql = f'select * from `resource_item` where brand_id = {teamData.brandId} and resource_id = 1 and is_delete = 0'
team_select_result = test_env_conn.select_many_value(sql=team_select_sql)
if team_select_result:
team_num = len(team_select_result)
......
......@@ -23,7 +23,7 @@ api2:
- eq: {"$.data.brandList[?(@.macroId == '${macro_id}')].createByName" : "${macro_create_by_name}"}
- exec: {"code" : "assert len(res.json()['data']['brandList']) == ${brand_macro_num}"}
- exec: {"code" : "assert len(res.json()['data']['userList']) == ${user_macro_num}"}
- exec: {"code" : "assert len(res.json()['data']['teamList']) == ${team_macro_num}"}
- exec: {"code" : "assert len(res.json()['data']['teamList']) + len(res.json()['data']['orphanList']) == ${team_macro_num}"}
api3:
title: 检查inbox处快捷回复列表
......@@ -94,16 +94,8 @@ api9:
expected:
- eq: {"$.code": 0}
- not_in: {"$.data.brandList[*].macroId": "${append_macro_id}"}
- not_in: {"$.data.userList[*].macroId": "${append_macro_id}"}
# - not_in: {"$.data.userList[*].macroId": "${append_macro_id}"}
- not_in: {"$.data.teamList[*].macroId": "${append_macro_id}"}
- not_in: { "$.data.orphanList[*].macroId": "${append_macro_id}" }
api10:
title: 检查快捷回复是否删除成功 - inbox页快捷回复列表
url: /api/v1/macro/getList?v=${v}
method: get
expected:
- eq: {"$.code": 0}
- not_in: {"$.data.brandList[*].macroId": "${append_macro_id}"}
- not_in: {"$.data.userList[*].macroId": "${append_macro_id}"}
- not_in: {"$.data.teamList[*].macroId": "${append_macro_id}"}
......@@ -61,19 +61,6 @@ api6:
- eq: {"$.data.list[?(@.id=='${team_id}')].picture":""}
- exec: {"code": "assert len(res.json()['data']['list']) == ${team_num}"}
api7:
title: 检查团队信息 + 检查团队是否新增成功
url: /api/v1/resource/getResourceItemList
method: post
data: {"resourceType":"team","v":"${v}"}
expected:
- eq: {"$.code": 0}
- in_list: {"$.data.list[*].id": "${team_id}"}
- eq: {"$.data.list[?(@.id=='${team_id}')].name":"${team_name}"}
- eq: {"$.data.list[?(@.id=='${team_id}')].members": []}
- eq: {"$.data.list[?(@.id=='${team_id}')].picture":""}
- exec: {"code" :"assert len(res.json()['data']['list']) == ${team_num}"}
api8:
title: 新增团队成员
url: /api/v1/resource/addResourceItemMember
......
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