Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
willdesk_apiauto
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
29
Issues
29
List
Boards
Labels
Service Desk
Milestones
Merge Requests
29
Merge Requests
29
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
桦生 詹
willdesk_apiauto
Commits
b1322255
Commit
b1322255
authored
Nov 13, 2024
by
zhanhuasheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix
parent
49fe1438
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
38 deletions
+17
-38
TestCase/automation/test_06_ai.py
TestCase/automation/test_06_ai.py
+13
-13
TestFile/setting/team/team_select.py
TestFile/setting/team/team_select.py
+1
-1
YamlCase/setting/macro.yaml
YamlCase/setting/macro.yaml
+3
-11
YamlCase/setting/team.yaml
YamlCase/setting/team.yaml
+0
-13
No files found.
TestCase/automation/test_06_ai.py
View file @
b1322255
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)
TestFile/setting/team/team_select.py
View file @
b1322255
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
)
...
...
YamlCase/setting/macro.yaml
View file @
b1322255
...
...
@@ -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}"
}
YamlCase/setting/team.yaml
View file @
b1322255
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment