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
e4895f41
Commit
e4895f41
authored
Nov 15, 2024
by
zhanhuasheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
兼容ai
parent
b1322255
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
87 additions
and
66 deletions
+87
-66
TestCase/automation/test_06_ai.py
TestCase/automation/test_06_ai.py
+13
-13
YamlCase/automation/ai.yaml
YamlCase/automation/ai.yaml
+74
-53
No files found.
TestCase/automation/test_06_ai.py
View file @
e4895f41
#
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
)
YamlCase/automation/ai.yaml
View file @
e4895f41
...
...
@@ -119,10 +119,10 @@ api13:
-
exec
:
{
"
code"
:
"
assert
res.json()['data']['total']
==
str(${url_num})"
}
api14
:
title
:
查询QA接口
title
:
查询
in this knowledge中的
QA接口
url
:
api/v1/willai/local/aiQAList
method
:
post
data
:
{
"
page"
:
1
,
"
pageSize"
:
10
,
"
shopId"
:
"
${shopId}"
,
"
v"
:
"
${v}"
,
"
category"
:
2
}
data
:
{
"
shopId"
:
"
${shopId}"
,
"
page"
:
1
,
"
pageSize"
:
15
,
"
status"
:
2
,
"
search"
:
"
"
,
"
lastDayType"
:
2
,
"
searchType"
:
1
,
"
timeZone"
:
"
Asia/Shanghai"
,
"
v"
:
"
${v}"
}
set_value
:
{
"
qa_num"
:
"
$.data.total"
}
expected
:
-
eq
:
{
"
$.code"
:
0
}
...
...
@@ -131,16 +131,16 @@ api15:
title
:
新增QA
url
:
api/v1/willai/local/addAiQa
method
:
post
data
:
{
"
category"
:
2
,
"
shopId"
:
"
${shopId}"
,
"
question"
:
"
${new_question}"
,
"
answer"
:
"
${new_answer}"
,
"
v"
:
"
${v}"
}
data
:
{
"
docType"
:
3
,
"
shopId"
:
"
${shopId}"
,
"
question"
:
"
${new_question}"
,
"
answer"
:
"
${new_answer}"
,
"
v"
:
"
${v}"
}
set_value
:
{
"
qa_id"
:
"
$.data.id"
}
expected
:
-
eq
:
{
"
$.code"
:
0
}
api16
:
title
:
查询QA接口
title
:
查询
in this knowledge中的
QA接口
url
:
api/v1/willai/local/aiQAList
method
:
post
data
:
{
"
page"
:
1
,
"
pageSize"
:
100
,
"
shopId"
:
"
${shopId}"
,
"
v"
:
"
${v}"
,
"
category"
:
2
}
set_value
:
{
"
qa_id"
:
"
$.data.list[?(@.question
==
'${new_question}')].id"
,
"
qa_num"
:
"
$.data.total"
}
data
:
{
"
shopId"
:
"
${shopId}"
,
"
page"
:
1
,
"
pageSize"
:
15
,
"
status"
:
2
,
"
search"
:
"
"
,
"
lastDayType"
:
2
,
"
searchType"
:
1
,
"
timeZone"
:
"
Asia/Shanghai"
,
"
v"
:
"
${v}"
}
expected
:
-
eq
:
{
"
$.code"
:
0
}
-
exec
:
{
"
code"
:
"
assert
res.json()['data']['total']
==
str(int('${qa_num}')
+
1)"
}
...
...
@@ -149,7 +149,7 @@ api17:
title
:
编辑QA
url
:
api/v1/willai/local/modifyAiQa
method
:
post
data
:
{
"
category"
:
2
,
"
shopId"
:
"
${shopId}"
,
"
question"
:
"
${edit_question}"
,
"
answer"
:
"
${edit_answer}"
,
"
id"
:
"
${qa_id}"
,
"
v"
:
"
${v}"
}
data
:
{
"
docType"
:
3
,
"
shopId"
:
"
${shopId}"
,
"
question"
:
"
${edit_question}"
,
"
answer"
:
"
${edit_answer}"
,
"
id"
:
"
${qa_id}"
,
"
v"
:
"
${v}"
}
expected
:
-
eq
:
{
"
$.code"
:
0
}
...
...
@@ -157,17 +157,17 @@ api18:
title
:
查询QA接口
url
:
api/v1/willai/local/aiQAList
method
:
post
data
:
{
"
page"
:
1
,
"
pageSize"
:
100
,
"
shopId"
:
"
${shopId}"
,
"
v"
:
"
${v}"
,
"
category"
:
2
}
data
:
{
"
shopId"
:
"
${shopId}"
,
"
page"
:
1
,
"
pageSize"
:
15
,
"
status"
:
2
,
"
search"
:
"
"
,
"
lastDayType"
:
2
,
"
searchType"
:
1
,
"
timeZone"
:
"
Asia/Shanghai"
,
"
v"
:
"
${v}"
}
expected
:
-
eq
:
{
"
$.code"
:
0
}
-
eq
:
{
"
$.data.list[?(@.id
==
'${qa_id}')].question"
:
"
${edit_question}"
}
-
eq
:
{
"
$.data.list[?(@.id
==
'${qa_id}')].answer"
:
"
${edit_answer}"
}
api19
:
title
:
删除
QA
url
:
api/v1/willai/local/
dele
teAiQa
title
:
关闭
QA
url
:
api/v1/willai/local/
opera
teAiQa
method
:
post
data
:
{
"
shopId"
:
"
${shopId}"
,
"
qas"
:[{
"
id"
:
"
${qa_id}"
,
"
category"
:
2
}],
"
v"
:
"
${v}"
}
data
:
{
"
id"
:
"
${qa_id}"
,
"
shopId"
:
"
${shopId}"
,
"
brandId"
:
"
${brandId}"
,
"
status"
:
3
,
"
v"
:
"
${v}"
}
expected
:
-
eq
:
{
"
$.code"
:
0
}
...
...
@@ -175,84 +175,106 @@ api20:
title
:
查询QA接口
url
:
api/v1/willai/local/aiQAList
method
:
post
data
:
{
"
page"
:
1
,
"
pageSize"
:
100
,
"
shopId"
:
"
${shopId}"
,
"
v"
:
"
${v}"
,
"
category"
:
2
}
data
:
{
"
shopId"
:
"
${shopId}"
,
"
page"
:
1
,
"
pageSize"
:
15
,
"
status"
:
2
,
"
search"
:
"
"
,
"
lastDayType"
:
2
,
"
searchType"
:
1
,
"
timeZone"
:
"
Asia/Shanghai"
,
"
v"
:
"
${v}"
}
expected
:
-
eq
:
{
"
$.code"
:
0
}
-
not_in_list
:
{
"
$.data.list[*].id"
:
"
${qa_id}"
}
-
eq
:
{
"
$.data.list[?(@.id
==
'${qa_id}')].status"
:
3
}
api21
:
title
:
编辑Email和推荐问题开关
url
:
api/v1/
setting/local/updateShopSetting
title
:
打开QA
url
:
api/v1/
willai/local/operateAiQa
method
:
post
data
:
{
"
itemList"
:[{
"
shopId"
:
"
${shopId}"
,
"
itemId"
:
204
,
"
itemValue"
:
"
${new_email}"
,
"
itemName"
:
"
willAiShopEmail"
},{
"
shopId"
:
"
${shopId}"
,
"
itemId"
:
205
,
"
itemValue"
:
"
0"
,
"
itemName"
:
"
willAiEnableSuggestQuestions"
}],
"
brandId"
:
"
${brandId}"
,
"
v"
:
"
${v}"
}
data
:
{
"
id"
:
"
${qa_id}"
,
"
shopId"
:
"
${shopId}"
,
"
brandId"
:
"
${brandId}"
,
"
status"
:
2
,
"
v"
:
"
${v}"
}
expected
:
-
eq
:
{
"
$.code"
:
0
}
-
eq
:
{
"
$.code"
:
0
}
api22
:
title
:
检查Email和推荐问题开关是否编辑成功
url
:
api/v1/
setting/local/getShopSetting
title
:
查询QA接口
url
:
api/v1/
willai/local/aiQAList
method
:
post
data
:
{
"
v"
:
"
${v}"
}
data
:
{
"
shopId"
:
"
${shopId}"
,
"
page"
:
1
,
"
pageSize"
:
15
,
"
status"
:
2
,
"
search"
:
"
"
,
"
lastDayType"
:
2
,
"
searchType"
:
1
,
"
timeZone"
:
"
Asia/Shanghai"
,
"
v"
:
"
${v}"
}
expected
:
-
eq
:
{
"
$.code"
:
0
}
-
eq
:
{
"
$.data.settingInfoMap.mapList['${shopId}'].[?(@.itemId
==
204)].itemValue"
:
"
${new_email}"
}
-
eq
:
{
"
$.data.settingInfoMap.mapList['${shopId}'].[?(@.itemId
==
205)].itemValue"
:
"
0"
}
-
eq
:
{
"
$.code"
:
0
}
-
eq
:
{
"
$.data.list[?(@.id
==
'${qa_id}')].status"
:
2
}
api23
:
title
:
新增推荐问题
url
:
api/v1/willai/local/
add
AiQa
title
:
删除QA
url
:
api/v1/willai/local/
operate
AiQa
method
:
post
data
:
{
"
category"
:
2
,
"
shopId"
:
"
${shopId}"
,
"
question"
:
"
${new_suggest_question}"
,
"
answer"
:
"
${new_suggest_answer}"
,
"
v"
:
"
${v}"
}
sleep
:
3
data
:
{
"
id"
:
"
${qa_id}"
,
"
shopId"
:
"
${shopId}"
,
"
brandId"
:
"
${brandId}"
,
"
status"
:
4
,
"
v"
:
"
${v}"
}
expected
:
-
eq
:
{
"
$.code"
:
0
}
api24
:
title
:
查
看推荐问题列表
title
:
查
询dismiss的QA接口
url
:
api/v1/willai/local/aiQAList
method
:
post
data
:
{
"
shopId"
:
"
${shopId}"
,
"
category"
:
1
,
"
v"
:
"
${v}"
}
set_value
:
{
"
suggest_qa_id"
:
"
$.data.list[?(@.question
==
'${new_suggest_question}')].id"
}
data
:
{
"
shopId"
:
"
${shopId}"
,
"
page"
:
1
,
"
pageSize"
:
15
,
"
status"
:
3
,
"
lastDayType"
:
4
,
"
searchType"
:
1
,
"
timeZone"
:
"
Asia/Shanghai"
,
"
v"
:
"
${v}"
}
expected
:
-
eq
:
{
"
$.code"
:
0
}
-
eq
:
{
"
$.data.list[?(@.question
==
'${new_suggest_question}')].answer"
:
"
${new_suggest_answer
}"
}
-
in_list
:
{
"
$.data.list[*].id"
:
"
${qa_id
}"
}
api25
:
title
:
编辑推荐问题
url
:
api/v1/willai/local/
modify
AiQa
title
:
把qa添加回in this knowledge
url
:
api/v1/willai/local/
operate
AiQa
method
:
post
data
:
{
"
category"
:
1
,
"
shopId"
:
"
${shopId}"
,
"
question"
:
"
${edit_suggest_question}"
,
"
answer"
:
"
${edit_suggest_answer}"
,
"
id"
:
"
${suggest_qa_id}"
,
"
v"
:
"
${v}"
}
data
:
{
"
id"
:
"
${qa_id}"
,
"
shopId"
:
"
${shopId}"
,
"
brandId"
:
"
${brandId}"
,
"
status"
:
1
,
"
v"
:
"
${v}"
}
expected
:
-
eq
:
{
"
$.code"
:
0
}
-
eq
:
{
"
$.code"
:
0
}
api26
:
title
:
查
看推荐问题列表
title
:
查
询QA接口
url
:
api/v1/willai/local/aiQAList
method
:
post
data
:
{
"
shopId"
:
"
${shopId}"
,
"
category"
:
1
,
"
v"
:
"
${v}"
}
data
:
{
"
shopId"
:
"
${shopId}"
,
"
page"
:
1
,
"
pageSize"
:
15
,
"
status"
:
2
,
"
search"
:
"
"
,
"
lastDayType"
:
2
,
"
searchType"
:
1
,
"
timeZone"
:
"
Asia/Shanghai"
,
"
v"
:
"
${v}"
}
expected
:
-
eq
:
{
"
$.code"
:
0
}
-
eq
:
{
"
$.data.list[?(@.id
==
'${suggest_qa_id}')].answer"
:
"
${edit_suggest_answer}"
}
-
eq
:
{
"
$.data.list[?(@.id
==
'${suggest_qa_id}')].question"
:
"
${edit_suggest_question}"
}
-
in_list
:
{
"
$.data.list[*].id"
:
"
${qa_id}"
}
api27
:
title
:
删除推荐问题
url
:
api/v1/willai/local/
dele
teAiQa
title
:
把qa添加回in this knowledge
url
:
api/v1/willai/local/
opera
teAiQa
method
:
post
data
:
{
"
shopId"
:
"
${shopId}"
,
"
qas"
:[{
"
id"
:
"
${suggest_qa_id}"
,
"
category"
:
1
}],
"
v"
:
"
${v}"
}
data
:
{
"
id"
:
"
${qa_id}"
,
"
shopId"
:
"
${shopId}"
,
"
brandId"
:
"
${brandId}"
,
"
status"
:
5
,
"
v"
:
"
${v}"
}
expected
:
-
eq
:
{
"
$.code"
:
0
}
-
eq
:
{
"
$.code"
:
0
}
api28
:
title
:
查
看推荐问题列表
title
:
查
询in this knowledge的QA接口
url
:
api/v1/willai/local/aiQAList
method
:
post
data
:
{
"
shopId"
:
"
${shopId}"
,
"
category"
:
1
,
"
v"
:
"
${v}"
}
data
:
{
"
shopId"
:
"
${shopId}"
,
"
page"
:
1
,
"
pageSize"
:
15
,
"
status"
:
2
,
"
search"
:
"
"
,
"
lastDayType"
:
2
,
"
searchType"
:
1
,
"
timeZone"
:
"
Asia/Shanghai"
,
"
v"
:
"
${v}"
}
expected
:
-
eq
:
{
"
$.code"
:
0
}
-
not_in_list
:
{
"
$.data.list[*].id"
:
"
${
suggest_
qa_id}"
}
-
not_in_list
:
{
"
$.data.list[*].id"
:
"
${qa_id}"
}
api29
:
title
:
查询dismiss的QA接口
url
:
api/v1/willai/local/aiQAList
method
:
post
data
:
{
"
shopId"
:
"
${shopId}"
,
"
page"
:
1
,
"
pageSize"
:
15
,
"
status"
:
3
,
"
lastDayType"
:
4
,
"
searchType"
:
1
,
"
timeZone"
:
"
Asia/Shanghai"
,
"
v"
:
"
${v}"
}
expected
:
-
eq
:
{
"
$.code"
:
0
}
-
not_in_list
:
{
"
$.data.list[*].id"
:
"
${qa_id}"
}
api30
:
title
:
编辑Email
url
:
api/v1/setting/local/updateShopSetting
method
:
post
data
:
{
"
itemList"
:[{
"
shopId"
:
"
${shopId}"
,
"
itemId"
:
204
,
"
itemValue"
:
"
${new_email}"
,
"
itemName"
:
"
willAiShopEmail"
}],
"
brandId"
:
"
${brandId}"
,
"
v"
:
"
${v}"
}
expected
:
-
eq
:
{
"
$.code"
:
0
}
api31
:
title
:
检查Email是否编辑成功
url
:
api/v1/setting/local/getShopSetting
method
:
post
data
:
{
"
v"
:
"
${v}"
}
expected
:
-
eq
:
{
"
$.code"
:
0
}
-
eq
:
{
"
$.data.settingInfoMap.mapList['${shopId}'].[?(@.itemId
==
204)].itemValue"
:
"
${new_email}"
}
api32
:
title
:
AI训练页面聊天
url
:
api/v1/willai/local/knowledgeTestChat
method
:
post
...
...
@@ -260,15 +282,15 @@ api29:
expected
:
-
eq
:
{
"
$.code"
:
0
}
api3
0
:
title
:
编辑Email
和推荐问题开关
api3
3
:
title
:
编辑Email
url
:
api/v1/setting/local/updateShopSetting
method
:
post
data
:
{
"
itemList"
:[{
"
shopId"
:
"
${shopId}"
,
"
itemId"
:
204
,
"
itemValue"
:
"
"
,
"
itemName"
:
"
willAiShopEmail"
}
,{
"
shopId"
:
"
${shopId}"
,
"
itemId"
:
205
,
"
itemValue"
:
"
1"
,
"
itemName"
:
"
willAiEnableSuggestQuestions"
}
],
"
brandId"
:
"
${brandId}"
,
"
v"
:
"
${v}"
}
data
:
{
"
itemList"
:[{
"
shopId"
:
"
${shopId}"
,
"
itemId"
:
204
,
"
itemValue"
:
"
"
,
"
itemName"
:
"
willAiShopEmail"
}],
"
brandId"
:
"
${brandId}"
,
"
v"
:
"
${v}"
}
expected
:
-
eq
:
{
"
$.code"
:
0
}
api3
1
:
api3
44
:
title
:
检查Email和推荐问题开关是否编辑成功
url
:
api/v1/setting/local/getShopSetting
method
:
post
...
...
@@ -276,9 +298,8 @@ api31:
expected
:
-
eq
:
{
"
$.code"
:
0
}
-
eq
:
{
"
$.data.settingInfoMap.mapList['${shopId}'].[?(@.itemId
==
204)].itemValue"
:
"
"
}
-
eq
:
{
"
$.data.settingInfoMap.mapList['${shopId}'].[?(@.itemId
==
205)].itemValue"
:
"
1"
}
api3
2
:
api3
5
:
title
:
关闭AI开关
url
:
api/v1/setting/local/updateShopSetting
method
:
post
...
...
@@ -286,7 +307,7 @@ api32:
expected
:
-
eq
:
{
"
$.code"
:
0
}
api3
3
:
api3
6
:
title
:
检查AI开关状态
url
:
api/v1/setting/local/getShopSetting
method
:
post
...
...
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