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
8344667d
Commit
8344667d
authored
May 20, 2024
by
zhanhuasheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增用例
parent
ad6e5121
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
0 deletions
+56
-0
TestCase/automation/test_02_robot.py
TestCase/automation/test_02_robot.py
+13
-0
TestData/automation/robot_test_data.py
TestData/automation/robot_test_data.py
+8
-0
YamlCase/automation/robot.yaml
YamlCase/automation/robot.yaml
+35
-0
No files found.
TestCase/automation/test_02_robot.py
0 → 100644
View file @
8344667d
import
pytest
from
Utils
import
yaml_handler
from
Utils
import
req_handler
from
TestData.automation.robot_test_data
import
robotData
class
TestRobot
:
yaml_path
=
r
'automation/robot.yaml'
yaml_data
=
yaml_handler
.
yaml_handler
.
get_case
(
yaml_path
)
@
pytest
.
mark
.
flaky
(
reruns
=
robotData
.
rerun
,
reruns_delay
=
robotData
.
rerun_delay
)
@
pytest
.
mark
.
parametrize
(
'case'
,
yaml_data
)
def
test_robot
(
self
,
case
):
req_handler
.
ReqHandler
.
send_requests
(
case
=
case
,
var_class
=
robotData
)
TestData/automation/robot_test_data.py
0 → 100644
View file @
8344667d
from
Utils.global_variate
import
Global
from
Utils.mockData_handler
import
data_handler
class
robotData
(
Global
):
robot_name
=
'autotest_robot_name%s'
%
data_handler
.
random_id
()
robot_icon
=
'https://img.willdesk.com/test/avatar/6052/2024/05/20/4636f3223b79044c10c37d8ddf66ccfajpg图片Z64×64.jpg'
robot_origin_name
=
'Chatbot'
robot_origin_icon
=
'https://img.willdesk.com/test/avatar/6052/2024/05/20/6d406271b1dfae312e796f701dc44f9apng图片W1024×1024.png'
\ No newline at end of file
YamlCase/automation/robot.yaml
0 → 100644
View file @
8344667d
api1
:
title
:
更新robot信息
url
:
/api/v1/autoanswer/updateRobotInfo
method
:
post
data
:
{
"
brandId"
:
"
${brandId}"
,
"
robotIcon"
:
"
${robot_icon}"
,
"
robotName"
:
"
${robot_name}"
,
"
v"
:
"
${v}"
}
expected
:
-
eq
:
{
"
$.code"
:
0
}
api2
:
title
:
检查是否更新成功
url
:
/api/v1/autoanswer/robotInfo?v=${v}
method
:
get
expected
:
-
eq
:
{
"
$.code"
:
0
}
-
eq
:
{
"
$.data.robotName"
:
"
${robot_name}"
}
-
eq
:
{
"
$.data.robotIcon"
:
"
${robot_icon}"
}
-
eq
:
{
"
$.data.brandId"
:
"
${brandId}"
}
api3
:
title
:
恢复机器人信息
url
:
/api/v1/autoanswer/updateRobotInfo
method
:
post
data
:
{
"
brandId"
:
"
${brandId}"
,
"
robotIcon"
:
"
${robot_origin_icon}"
,
"
robotName"
:
"
${robot_origin_name}"
,
"
v"
:
"
${v}"
}
expected
:
-
eq
:
{
"
$.code"
:
0
}
api4
:
title
:
检查是否恢复
url
:
/api/v1/autoanswer/robotInfo?v=${v}
method
:
get
expected
:
-
eq
:
{
"
$.code"
:
0
}
-
eq
:
{
"
$.data.robotName"
:
"
${robot_origin_name}"
}
-
eq
:
{
"
$.data.robotIcon"
:
"
${robot_origin_icon}"
}
-
eq
:
{
"
$.data.brandId"
:
"
${brandId}"
}
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