# Upload test cases
# Brief description
- Upload the test case interface. The interface background will perform the use case analysis operation, which takes a long time, please increase the request timeout parameter appropriately (it is recommended to set to 30 s).Note that the use case needs to be packaged as a zip file .
# Request URL
https://minitest.weixin.qq.com/thirdapi/case/upload
# How to request
- POST
# parameter
| Parameter Name | Required | type | Introductions |
|---|---|---|---|
| token | yes | string | You can obtain it from "My Information" in the drop-down menu on the right-hand side of your profile in the upper right corner of the page |
| group_en_id | yes | string | Project ID in English, available on item management / product management page |
| test_type | no | integer | Minium use case package 2, record playback use case package 3, do not pass default to minium use case |
| file | yes | FileStorage | Case use case file,.zip package |
# Python Request Instance Code
data = {
'token': xxx,
'group_en_id': xxx,
'test_type': 2, # 2 Minium;3 录制回放
}
case_files = {'file': open('${path_to_the_.zip}', 'rb')}
resp = requests.post(url='https://minitest.weixin.qq.com/thirdapi/case/upload', data=data, files=case_files, timeout=30)
# Return an example
{
"data": null,
"msg": "ok",
"rtn": 0,
"timestamp": 1614861228.1035924
}
# Download Test Examples
# Brief description
- Download Test Case Interface
# Request URL
https://minitest.weixin.qq.com/thirdapi/case/download
# How to request
- GET
# parameter
| Parameter Name | Required | type | Introductions |
|---|---|---|---|
| token | yes | string | You can obtain it from "My Information" in the drop-down menu on the right-hand side of your profile in the upper right corner of the page |
| group_en_id | yes | string | Project ID in English, available on item management / product management page |
| test_type | yes | integer | Minium use case package 2, record playback use case package 3, do not pass default to minium use case |
# Python Request Instance Code
import requests
params = {
'token': 'xxx',
'group_en_id': 'xxx',
'test_type': 3, # 2 Minium;3 录制回放
}
req = requests.get('https://minitest.weixin.qq.com/thirdapi/case/download', params=params, timeout=30)
with open('case.zip', 'wb') as f:
f.write(req.content)
# Return an example
Writes the returned content directly to a zip file package
# Delete test case files
# Brief description
- Delete the test case file, only supports minium
# Request URL
https://minitest.weixin.qq.com/thirdapi/case/api/case_file
# How to request
- DELETE
# parameter
| Parameter Name | Required | type | Introductions |
|---|---|---|---|
| token | yes | string | You can obtain it from "My Information" in the drop-down menu on the right-hand side of your profile in the upper right corner of the page |
| group_en_id | yes | string | Project ID in English, available on item management / product management page |
| file_path | yes | string | File Path |
# Python Request Instance Code
import requests
params = {
'token': 'xxx',
'group_en_id': 'xxx',
'file_path': "test/first_test.py", # 删除文件的路径
}
req = requests.delete('https://minitest.weixin.qq.com/thirdapi/case/api/case_file', params=params, timeout=30)
print(req.json().get('msg'))
# Return an example
Return valuertnA value of 0 indicates a successful deletion. A value not 0 indicates the deletion failed. The reason for the failure is reflected inmsg
{
"msg": "delete file success",
"rtn": 0,
"timestamp": 1614861228.1035924
}
# View all Minium use cases
# Brief description
View all Minium use cases
# Request URL
https://minitest.weixin.qq.com/thirdapi/minium_case_list
# How to request
- GET
# parameter
| Parameter Name | Required | type | Introductions |
|---|---|---|---|
| token | yes | string | You can obtain it from "My Information" in the drop-down menu on the right-hand side of your profile in the upper right corner of the page |
| group_en_id | yes | string | Project ID in English, available on item management / product management page |
# Return an example
Return valuertnA value of 0 indicates a successful deletion. A value not 0 indicates the deletion failed. The reason for the failure is reflected inmsg
{
"data": {
"pkg_to_case_list": {
"xx.xx": [
"test_1",
"test_2"
]
},
"total_case_num": 10
},
"rtn": 0
}
# Connect to upload test plan interface
If you need to query a list of use cases, use the API interface to create a new test plan , and change the format slightly.The example code is as follows:
# Python sample code
import requests
import json
params = {
'token': 'xxx', # 换成自己的token
'group_en_id': 'xxx', # 换成项目的token
}
resp = requests.get('https://minitest.weixin.qq.com/thirdapi/minium_case_list', params=params)
test_plan = resp.json().get("data", {}).get("pkg_to_case_list", {}) # 获取minium用例
test_plan_config = {'pkg_list': []} # 组成测试计划
for each_pkg, each_cases in test_plan.items():
# 示例中全部用例都加入了测试计划。这里可根据项目自身情况调整
test_plan_config['pkg_list'].append({
'case_list': each_cases,
'pkg': each_pkg,
})
data = {
'token': 'xxx', # 换成自己的token
'group_en_id': 'xxx', # 换成项目的token
'test_plan_name': 'api自定义Minium', # 测试计划名称
'test_plan_config': json.dumps(test_plan_config)
}
# 提交新建测试计划API
resp = requests.post(url='https://minitest.weixin.qq.com/thirdapi/case_plan', json=data)
print(resp.text)
# See all record playback use cases
# Brief description
See all record playback use cases
# Request URL
https://minitest.weixin.qq.com/thirdapi/replay_case_list
# How to request
- GET
# parameter
| Parameter Name | Required | type | Introductions |
|---|---|---|---|
| token | yes | string | You can obtain it from "My Information" in the drop-down menu on the right-hand side of your profile in the upper right corner of the page |
| group_en_id | yes | string | Project ID in English, available on item management / product management page |
# Return an example
Return valuertnA value of 0 indicates a successful deletion. A value not 0 indicates the deletion failed. The reason for the failure is reflected inmsg
{
"data": {
"account_to_case_list": {
"xx": [
{"case_name": "xx1"},
{"case_name": "xx2"}
]
},
"total_case_num": 10
},
"rtn": 0
# View all AI use cases
# Brief description
View all AI use cases
# Request URL
https://minitest.weixin.qq.com/thirdapi/ai_case
# How to request
- GET
# parameter
| Parameter Name | Required | type | Introductions |
|---|---|---|---|
| token | yes | string | You can obtain it from "My Information" in the drop-down menu on the right-hand side of your profile in the upper right corner of the page |
| group_en_id | yes | string | Project ID in English, available on item management / product management page |
| name | no | string | Filter option, which can filter for use case names with fuzzy matches, is not required |
| description | no | string | Filter option, which can filter for ambiguous matching of use case descriptions, is not required |
# Return an example
Return valuertnA value of 0 indicates a successful deletion. A value not 0 indicates the deletion failed. The reason for the failure is reflected inmsg
{
"data": [
{
"case_desc": "xx",
"case_priority": "P1",
"id": 1,
"name": "xx",
"update_time": "2025-09-22 20:23:00.847506",
"user_name": "xx"
}
],
"rtn": 0
}
# Add an AI use case
# Brief description
Add an AI use case
# Request URL
https://minitest.weixin.qq.com/thirdapi/ai_case
# How to request
- POST
# parameter
| Parameter Name | Required | type | Introductions |
|---|---|---|---|
| token | yes | string | You can obtain it from "My Information" in the drop-down menu on the right-hand side of your profile in the upper right corner of the page |
| group_en_id | yes | string | Project ID in English, available on item management / product management page |
| name | yes | string | Use case names. Note that use case names in the same project cannot be repeated |
| description | yes | string | Use case Description |
| priority | yes | string | Modify the priority, only in 'P0', 'P1', 'P2', 'P3', 'P4', 'P5', 'Others' |
# Return an example
Return valuertnA value of 0 indicates a successful deletion. A value not 0 indicates the deletion failed. The reason for the failure is reflected inmsg
{
"data": {
"case_desc": "xx",
"case_priority": "P1",
"id": 1,
"name": "xx",
"update_time": "2025-09-22 20:23:00.847506",
"user_name": "xx"
},
"msg": "添加成功",
"rtn": 0
}
# Modify the AI use case
# Brief description
Modify the AI use case
# Request URL
https://minitest.weixin.qq.com/thirdapi/ai_case
# How to request
- PUT
# parameter
| Parameter Name | Required | type | Introductions |
|---|---|---|---|
| token | yes | string | You can obtain it from "My Information" in the drop-down menu on the right-hand side of your profile in the upper right corner of the page |
| group_en_id | yes | string | Project ID in English, available on item management / product management page |
| case_id | yes | string | Modified Use Case ID, required |
| name | no | string | Modify the name of the use case, noting that the name of a use case in the same project cannot be duplicated |
| description | no | string | Modify Use Case Description |
| priority | no | string | Modify the priority, only in 'P0', 'P1', 'P2', 'P3', 'P4', 'P5', 'Others' |
# Return an example
Return valuertnA value of 0 indicates a successful deletion. A value not 0 indicates the deletion failed. The reason for the failure is reflected inmsg
{
"data": {
"case_desc": "xx",
"case_priority": "P1",
"id": 1,
"name": "xx",
"update_time": "2025-09-22 20:23:00.847506",
"user_name": "xx"
},
"rtn": 0
}