# Test plans for interfaces

Note: Creating and modifying test plans through third party interfaces only supports custom test tasks; other types are configured on the cloud test page.

# Establish a common test program

Added Test Plan to support onlyMiniummissions

# Request URL
  • https://minitest.weixin.qq.com/thirdapi/case_plan
# How to request
  • POST
# parameter
Parameter Name Required type
Introductions
token yes string You can get it from "My Token" in the drop-down menu to the right of the avatar 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_plan_name yes string Name of the test program
test_plan_config yes string Refer to for instructions on writing . Note that this field requires a Json serialization into a String pass (using json.dumps)
# Reference code
import json
import requests

test_plan_config ={
  'pkg_list': [
    {
      'case_list': ['test_*'], 
      'pkg': '__test_Home',
    }
  ]
}  # 可根据自己的minium用例适配修改

data = {
  'token': 'xxx',
  'group_en_id': 'xxx',
  'test_plan_name': 'api自定义Minium',     # 测试计划名称
  'test_plan_config': json.dumps(test_plan_config)
}

resp = requests.post(url='https://minitest.weixin.qq.com/thirdapi/case_plan', json=data)
# Return an example
{
	"data": {
		"test_plan_id": xx,
	},
	"msg": "添加测试计划成功",
	"rtn": 0,
	"timestamp": 1614861228.1035924
}

# A new AI-based custom test plan has been added.

# Request URL
  • https://minitest.weixin.qq.com/thirdapi/ai_case_plan
# How to request
  • POST
# parameter
Parameter Name Required type
Introductions
token yes string You can get it from "My Token" in the drop-down menu to the right of the avatar 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_plan_name yes string Name of the test program
case_ids yes string AI use case ID, which needs to be converted to a string using json.dumps, for example:json.dumps([1])
priority no string Priority, only in 'P0', 'P1', 'P2', 'P3', 'P4', 'P5', 'Others'
# Reference code
import requests
import json

data = {
  'token': 'xxx',
  'group_en_id': 'xxx',
  'test_plan_name': 'ai_plan_api',     # 测试计划名称
  'case_ids': json.dumps([1,2,3])  # 替换成你自己的AI用例ID
}

resp = requests.post(url='https://minitest.weixin.qq.com/thirdapi/ai_case_plan', data=data)
# Return an example
{
	"data": {
		"test_plan_id": xx,
	},
	"msg": "添加成功",
	"rtn": 0,
	"timestamp": 1614861228.1035924
}

# Query a test plan

Query test plan, only supportMonkey,MiniumOrrecording playback

Note: The AI testing plan falls under theMiniumtask type.

# Request URL
  • https://minitest.weixin.qq.com/thirdapi/case_plan_list
# How to request
  • GET
# parameter
Parameter Name Required type
Introductions
token yes string You can get it from "My Token" in the drop-down menu to the right of the avatar 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 int Type of test,1: Monkey2:Minium3:Record playback
# Return an example
{
	"data": [
		{"case_detail": {}, "case_num": 2, "config": {}, "id": 0, "name": "", "test_type_info": "Minium"}
	],
	"msg": "OK",
	"rtn": 0,
	"timestamp": 1614937564.4042642
}

# Modify the general test plan

Only support to modify theMiniumtest plan, and only support to modify the name, config

# Request URL
  • https://minitest.weixin.qq.com/thirdapi/case_plan
# How to request
  • PUT
# parameter
Parameter Name Required type
Introductions
token yes string You can get it from "My Token" in the drop-down menu to the right of the avatar 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_plan_id yes int Test plan id, which can be obtained by querying the test plan api or by the test plan page id column
test_plan_name yes string Name of the test program
description yes string Refer to for instructions on writing . Note that this field needs to be serialized as a Json String passed in (use json.dumps ())
# Return an example
{
	"msg": "修改测试计划成功",
	"rtn": 0,
	"timestamp": 1614861228.1035924
}

# Modify the AI custom test plan

This interface can only modify the test plans for AI-customized tests.

# Request URL
  • https://minitest.weixin.qq.com/thirdapi/ai_case_plan
# How to request
  • PUT
# parameter
Parameter Name Required type
Introductions
token yes string You can get it from "My Token" in the drop-down menu to the right of the avatar 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_plan_id no int Test plan id, which can be obtained by querying the test plan api or by the test plan page id column
test_plan_name no string Name of the test program
priority no string P0, P1, P2, P3, P4, P5, Others'
case_ids no string AI use case ID, which needs to be converted to a string using json.dumps, for example:json.dumps([1])
# Reference code
import requests
import json
data = {
  'token': 'xxx',
  'group_en_id': 'xxx',
  'test_plan_id': 111,  # 填要修改的测试计划ID 
  'test_plan_name': 'ai_plan_api_modify',     # 测试计划名称
  "case_ids": json.dumps([1,2]),  # 填要修改的ID
}

resp = requests.put(url='https://minitest.weixin.qq.com/thirdapi/ai_case_plan', data=data)
# Return an example
{
	"msg": "修改测试计划成功",
	"data": {
		"test_plan_id": 111,
	},
	"rtn": 0,
	"timestamp": 1614861228.1035924
}

# Delete the test plan

Delete the test plan

# Request URL
  • https://minitest.weixin.qq.com/thirdapi/case_plan/delete
# How to request
  • POST
# parameter
Parameter Name Required type
Introductions
token yes string You can get it from "My Token" in the drop-down menu to the right of the avatar 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_plan_id yes int Test plan id, which can be obtained by querying the test plan api or by the test plan page id column

# Return value

Pay attention to whether thertnreturn value is 0 ,If and only if the deletion is successful** 0** , otherwise please pay attention tomsgfield content.