更新测试管理的用例和用例脚本
功能介绍
更新测试管理的用例和用例脚本
调用方法
请参见如何调用API。
URI
PUT /v4/{project_id}/testcase/{tmss_case_uri}
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
project_id |
是 |
String |
参数解释 项目UUID,项目唯一标识,固定长度32位字符(字母和数字)。获取方式请参见获取项目唯一标识。 约束限制 不涉及 取值范围 32个字符组成的字符串 默认取值 不涉及 |
tmss_case_uri |
是 |
String |
测试管理用例uri |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
turn_on_awmapping |
否 |
Boolean |
新组合关键字开关 |
请求参数
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
X-Auth-Token |
是 |
String |
参数解释: 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 约束限制: 必传。 取值范围: 字符串长度不少于1,不超过10万。 默认取值: 不涉及。 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
activity_id |
否 |
String |
活动唯一标识 |
addToPlan |
否 |
Boolean |
是否添加到计划 |
aw_cata_list |
否 |
Array of BasicAwCata objects |
创建时可选择导入的关键字目录直接产生测试步骤 |
aw_instance |
否 |
CaseAwInstance object |
关键字实例 |
case_type |
否 |
Integer |
用例类型:0商用现有类型,1从内部导过来的用例类型 |
case_variable_list |
否 |
Array of AwVariable objects |
用例局部变量 |
demoFlag |
否 |
String |
演示标志 |
errorStep |
否 |
Array of integers |
错误测试阶段 |
id |
否 |
String |
唯一标识 |
import_info_list |
否 |
Array of strings |
导入信息集合 |
isKeyWord |
否 |
Integer |
是否设置为关键字操作 |
isSync |
否 |
Boolean |
是否同步 |
issueId |
否 |
String |
问题唯一标识 |
name |
否 |
String |
名称 |
old_tmss_case_uri |
否 |
String |
被复制用例的测试管理用例uri |
old_tmss_case_uri_list |
否 |
Array of strings |
被复制用例的测试管理用例uri列表,内部使用 |
package_name |
否 |
String |
包名 |
planId |
否 |
String |
计划唯一标识 |
project_id |
否 |
String |
工程唯一标识 |
releaseDev |
否 |
String |
新服务新建用例版本号 |
script_name |
否 |
String |
脚本名(类名) |
script_path |
否 |
String |
脚本路径 |
source |
否 |
String |
来源 |
sourceWay |
否 |
String |
来源的方式 |
src_tmss_case_uri |
否 |
String |
选择用例中测试步骤生成关键字时的原用例 测试管理CaseUri |
tmss_case_uri |
否 |
String |
测试管理用例uri |
tmss_feature_uri |
否 |
String |
测试管理用例uri |
tmss_property |
否 |
TmssTestcase object |
测试管理的测试用例 |
type |
否 |
String |
类型 |
variableGroupId |
否 |
String |
环境参数分组唯一标识 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
aw_dir |
否 |
String |
关键字归属目录信息 |
cata_type |
否 |
Integer |
目录层级 |
create_time |
否 |
String |
创建时间 |
create_user |
否 |
String |
创建人 |
create_user_id |
否 |
String |
创建人唯一标识 |
desc |
否 |
String |
目录描述 |
extra_info |
否 |
String |
引用次数 |
id |
否 |
String |
唯一标识 |
is_folder |
否 |
String |
判断是否为文件夹的标识 |
name |
否 |
String |
名称 |
nameView |
否 |
String |
关键字在页面上显示的名字 |
parent_id |
否 |
String |
关键字目录父编号 |
project_id |
否 |
String |
工程唯一标识 |
refCnt |
否 |
Integer |
引用次数 |
region |
否 |
String |
区域名称 |
update_time |
否 |
String |
更新时间 |
update_user |
否 |
String |
更新人 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
setup_aw_list |
否 |
Array of AwInstance objects |
测试用例前置步骤 |
teardown_aw_list |
否 |
Array of AwInstance objects |
测试用例后置步骤 |
test_aw_list |
否 |
Array of AwInstance objects |
测试步骤 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
alias_runaw |
否 |
String |
关键字内容描述字段 |
authentication_info |
否 |
AuthInfo object |
认证信息 |
authentication_type |
否 |
String |
认证类型,0-无认证;1-aksk认证 |
aw_description |
否 |
String |
脚本模板描述信息,在用例更新时添加 |
aw_id |
否 |
String |
关键字唯一标识 |
aw_type |
否 |
Integer |
关键字类型 0-setup;1-test;2-teardown |
basic_aw |
否 |
BasicAw object |
关键字 |
body_param_type |
否 |
String |
关键字实例的参数body体类型:form/text |
by_order |
否 |
Integer |
顺序 |
changeSign |
否 |
Integer |
变化标志 |
check_point_list |
否 |
Array of CheckPoint objects |
检查点集合 |
children |
否 |
Array of AwInstance objects |
关键字实例 |
condition_statement |
否 |
String |
条件语句 |
condition_type |
否 |
Integer |
条件类型 0-not condition;1-if begin;2-if |
create_time |
否 |
String |
创建时间 |
create_time_stamp |
否 |
Long |
创建时间戳 |
create_time_string |
否 |
String |
创建时间字符串 |
create_user |
否 |
String |
创建人 |
custom_header |
否 |
Array of AwParam objects |
测试步骤自定义请求头集合;后续自定义URL请求头不再使用该字段 |
description |
否 |
String |
描述 |
error_info |
否 |
ErrorInfo object |
执行的错误日志内容列表 |
extra_info |
否 |
ExtraInfo object |
补充信息 |
from_outside |
否 |
Integer |
该关键字是否来自外部工程 0-no;1-yes |
hasLevel |
否 |
Integer |
层级 |
header_array |
否 |
Object |
请求头列表 |
his_script |
否 |
String |
值不为null表示老的IF判断语句;值为null表示新的IF判断语句 |
id |
否 |
String |
唯一标识 |
is_basic |
否 |
Integer |
是否模板类型测试步骤 0:自定义URL配置类型;1:模板类型测试步骤 |
is_contract_aw |
否 |
Integer |
是否是契约关键字 0-否;1-yes |
is_disabled |
否 |
Integer |
是否被禁用 0-否;1-yes |
is_sectest_aw |
否 |
Integer |
是否是安全测试关键字 |
level |
否 |
Integer |
用例级别 |
name |
否 |
String |
名称 |
param_dependent |
否 |
String |
参数依赖 |
param_dependent_enabled |
否 |
Integer |
是否启用参数依赖 |
param_type_and_value |
否 |
Array of AwParam objects |
参数类型和参数值对应集合 |
projectId |
否 |
String |
工程唯一标识 |
region |
否 |
String |
区域名称 |
relation |
否 |
String |
关键字唯一标识层级关系 |
relation_id |
否 |
String |
层级关系唯一标识 |
relation_type |
否 |
Integer |
映射类型 1-反向删除映射;2-用例自动添加的方向删除步骤 |
retry_interval |
否 |
String |
重试间隔时间 (ms) 为空表示不等待 |
retry_times |
否 |
String |
重试次数 |
scriptName |
否 |
String |
获取脚本生成时,要使用的步骤名称 |
service_and_stage |
否 |
String |
关键字所来自工程的服务名和阶段名 fromOutside为1时该值有效 |
special_type |
否 |
Integer |
测试步骤来源 |
update_time |
否 |
String |
更新时间 |
update_time_stamp |
否 |
Long |
更新时间戳 |
update_time_string |
否 |
String |
更新时间字符串 |
update_user |
否 |
String |
更新人 |
user_id |
否 |
String |
用户唯一标识 |
variable_list |
否 |
Array of AwVariable objects |
用例局部变量 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
aw_code |
否 |
String |
关键字代码, hasCode为1时有效 |
aw_description |
否 |
String |
脚本模板描述信息,在用例更新时添加 |
aw_ins_list |
否 |
Array of AwInstance objects |
组合关键字包含的关键字实例信息,关键字类型为2时该字段有效 |
aw_mark |
否 |
Integer |
关键字标记 0-normal;1-new;2-update 3-delete |
aw_operationid |
否 |
String |
接口的唯一标识 |
aw_tags |
否 |
String |
接口的标签 |
aw_type |
否 |
Integer |
关键字类型1-普通关键字,2-组合关键字,3-导入关键字 |
aw_uniqueid |
否 |
String |
关键字唯一标识和标签的拼接 |
by_order |
否 |
Integer |
顺序 |
create_time |
否 |
String |
创建时间 |
create_time_stamp |
否 |
Long |
创建时间戳 |
create_time_string |
否 |
String |
创建时间字符串 |
create_user |
否 |
String |
创建人 |
create_user_id |
否 |
String |
创建人唯一标识 |
custom_aw_libs |
否 |
Array of UploadFile objects |
关键字库的文件列表 |
delete_time |
否 |
String |
删除时间 |
delete_user |
否 |
String |
删除人 |
description |
否 |
String |
描述 |
dft_check_point_list |
否 |
Array of CheckPoint objects |
默认检查点集合 |
dft_custom_header |
否 |
Array of AwParam objects |
默认请求头参数对象 |
dft_retry_interval |
否 |
String |
重试间隔时间 (ms) 为空表示不等待 |
dft_retry_times |
否 |
String |
重试次数 |
dft_variable_list |
否 |
Array of AwVariable objects |
定义的变量信息 |
extra_info |
否 |
Object |
补充信息 |
group_name |
否 |
String |
组名 |
has_code |
否 |
Integer |
是否自带代码 0-不自带代码,该关键字依赖source字段中的源;1-自带代码 |
id |
否 |
String |
唯一标识 |
import_package |
否 |
Array of strings |
导入的包 |
interface_label |
否 |
String |
接口的x-extend |
is_favorite |
否 |
Integer |
是否是当前工程的收藏关键字,该字段不存数据库,每次获取时实时判断 |
keyword_variable_value |
否 |
Array of AwVariable objects |
关键字局部变量 |
method |
否 |
String |
方法 |
name |
否 |
String |
名称 |
nameView |
否 |
String |
关键字在页面上显示的名字 |
origin_project |
否 |
String |
源工程信息,如果该关键字是从其他工程过来的(继承或者copy to local) |
output_param_list |
否 |
Array of AwVariable objects |
组合关键字的输出参数信息,该字段不存数据库,实时获取 |
param_type_and_dft_value |
否 |
Array of AwParam objects |
参数类型和参数默认值对应集合 |
project_id |
否 |
String |
工程唯一标识 |
protocol_type |
否 |
String |
协议类型 (http/dsf/other) |
public_aw_lib |
否 |
PublicAwLib object |
公共关键字信息 |
public_aw_lib_id |
否 |
String |
所属公共关键字库唯一标识 |
region |
否 |
String |
区域名称 |
return_type |
否 |
String |
返回类型 |
root_id |
否 |
String |
root唯一标识 |
source |
否 |
String |
来源 |
special_type |
否 |
Integer |
测试步骤来源 |
tmssCaseNumber |
否 |
String |
关键字管理的用例编号 |
tmss_case_id |
否 |
String |
关键字管理的用例唯一标识 |
update_time |
否 |
DateTime |
更新时间 |
update_time_stamp |
否 |
Long |
更新时间戳 |
update_time_string |
否 |
String |
更新时间字符串 |
update_user |
否 |
String |
更新人 |
warningMsg |
否 |
String |
警告信息 |
yamlName |
否 |
String |
所属yaml文件名称,该字段不存库,用来记录从哪个yaml文件导入 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
awInsId |
否 |
String |
所属的关键字实例的唯一标识 |
create_time |
否 |
String |
创建时间 |
create_time_stamp |
否 |
Long |
创建时间戳 |
create_time_string |
否 |
String |
创建时间字符串 |
create_user |
否 |
String |
创建人 |
current_size |
否 |
Long |
当前大小 |
filePath |
否 |
String |
文件路径 |
id |
否 |
String |
唯一标识 |
name |
否 |
String |
名称 |
originName |
否 |
String |
文件的原名 |
projectId |
否 |
String |
项目唯一标识 |
region |
否 |
String |
区域名称 |
testcase_id |
否 |
String |
测试用例的唯一标识符 |
update_time |
否 |
String |
更新时间 |
update_time_stamp |
否 |
Long |
更新时间戳 |
update_time_string |
否 |
String |
更新时间字符串 |
update_user |
否 |
String |
更新人 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
create_time |
否 |
DateTime |
创建时间 |
create_time_stamp |
否 |
Long |
创建时间戳 |
create_time_string |
否 |
String |
创建时间字符串 |
create_user |
否 |
String |
创建人 |
document_link |
否 |
String |
文档链接 |
id |
否 |
String |
唯一标识 |
name |
否 |
String |
名称 |
net_area |
否 |
Array of strings |
蓝区:Blue,绿区:Green,黄区:Yellow |
obs_temp_url |
否 |
String |
obs临时url |
product_line |
否 |
String |
产品线 |
repo_branch |
否 |
String |
仓库分支 |
repo_lib_path |
否 |
String |
存公共关键字依赖jar包的目录 |
repo_password |
否 |
String |
仓库密码 |
repo_private_key |
否 |
String |
仓库秘钥 |
repo_url |
否 |
String |
仓库地址 |
repo_username |
否 |
String |
仓库用户名 |
update_time |
否 |
DateTime |
更新时间 |
update_time_stamp |
否 |
Long |
更新时间戳 |
update_time_string |
否 |
String |
更新时间字符串 |
update_user |
否 |
String |
更新人 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
comparison |
否 |
String |
参数解释 比较符 |
description |
否 |
String |
参数解释 描述信息 |
function_arg |
否 |
String |
参数解释 类型值 |
function_type |
否 |
String |
参数解释 高级提取类型 |
property |
否 |
String |
参数解释 属性名称 |
value |
否 |
String |
参数解释 目标值 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
error_content |
否 |
String |
错误内容的描述 |
error_index |
否 |
String |
错误索引的描述 |
error_point |
否 |
String |
错误点的描述 |
high_light |
否 |
Boolean |
是否高亮标识 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
childImportPackage |
否 |
Array of strings |
子级导入的包 |
document_link |
否 |
String |
文档链接 |
http_method |
否 |
String |
http请求方法 |
http_url |
否 |
String |
HTTP请求的URL |
importPackage |
否 |
Array of strings |
导入的包 |
mock |
否 |
MockInfo object |
关键字实例中的mock信息 |
outputParam |
否 |
Array of AwVariable objects |
输出参数 |
param_dependent |
否 |
String |
参数依赖 |
summary |
否 |
String |
摘要 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
basic_value |
否 |
AwParamBasicValue object |
参数解释 关键字参数基本类型取值类 |
basic_value_list |
否 |
Array of AwParamBasicValue objects |
参数解释 关键字参数, valueType为1时该值有效 |
custom_body |
否 |
String |
参数解释 自定义requestBody内容,inType为2且isBodyCustom为1时有效 |
defaultValue |
否 |
String |
参数解释 默认值 |
description |
否 |
String |
参数解释 关键字参数描述 |
disabled |
否 |
Boolean |
参数解释 是否禁用,只有非必需参数才能被禁用 |
drop_down_value |
否 |
String |
参数解释 用于存储下拉菜单的值 |
enum_type |
否 |
String |
参数解释 枚举类型 |
enum_type_selected |
否 |
String |
参数解释 当前选中的枚举类型 |
format |
否 |
String |
参数解释 num和String有效 |
in_type |
否 |
Integer |
参数解释 rest接口输入参数类型: 0-query 1-path 2-body 3-header 4-formdata 5-config |
isChecked |
否 |
Boolean |
参数解释 是否是被选中参数 |
is_big_field |
否 |
Boolean |
参数解释 是否是大字段参数 |
is_body_custom |
否 |
Integer |
参数解释 requestBody是否自定义,inType为2时有效。0-非自定义,用原有逻辑;1-自定义body,requestBody直接使用字段customBody |
is_contract_param |
否 |
Integer |
参数解释 是否是契约关键字 0-否;1-yes |
is_sensitive |
否 |
Boolean |
参数解释 是否敏感参数,0 是, 1 不是 |
item |
否 |
ItemParam object |
参数解释 关键字基本参数 |
maxItems |
否 |
Integer |
参数解释 Array类型最大元素数 |
maxLength |
否 |
Long |
参数解释 String类型最大长度 |
maximum |
否 |
Object |
参数解释 Number类型最大值 |
minItems |
否 |
Integer |
参数解释 Array类型最小元素数 |
minLength |
否 |
Long |
参数解释 String类型最小长度 |
minimum |
否 |
Object |
参数解释 Number类型最小值 |
mock |
否 |
MockInfo object |
参数解释 关键字实例中的mock信息 |
name |
否 |
String |
参数解释 参数名 |
object_value |
否 |
Array of AwParam objects |
参数解释 valueType为2时该值有效。valueType为3时,该值用来表示数组中单个结构体 |
object_value_list |
否 |
Array<Array<AwParam>> |
参数解释 valueType为3时该值有效 |
pattern |
否 |
String |
参数解释 num和String有效 |
required |
否 |
Boolean |
参数解释 是否必需参数 |
type |
否 |
String |
参数解释 参数类型 |
validate_rule |
否 |
ValidateRule object |
参数解释 校验规则 |
value_type |
否 |
Integer |
参数解释 参数值类型 |
xChoiceValue |
否 |
String |
参数解释 choice选择关系 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
value |
否 |
String |
参数解释 参数默认值,用例有效 |
value_range |
否 |
String |
参数解释 参数值范围,逻辑用例有效 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
basic_value |
否 |
AwParamBasicValue object |
参数解释 关键字参数基本类型取值类 |
defaultValue |
否 |
String |
参数解释 默认值 |
enum_type |
否 |
String |
参数解释 枚举类型 |
enum_type_selected |
否 |
String |
参数解释 当前选中的枚举类型 |
format |
否 |
String |
参数解释 num和String有效 |
is_big_field |
否 |
Boolean |
参数解释 是否是大字段参数 |
maxItems |
否 |
Integer |
参数解释 Array类型最大元素数 |
maxLength |
否 |
Long |
参数解释 String类型最大长度 |
maximum |
否 |
Object |
Number类型最大值 |
minItems |
否 |
Integer |
参数解释 Array类型最小元素数 |
minLength |
否 |
Long |
参数解释 String类型最小长度 |
minimum |
否 |
Object |
参数解释 Number类型最小值 |
pattern |
否 |
String |
参数解释 num和String有效 |
type |
否 |
String |
参数解释 参数类型 |
validate_rule |
否 |
ValidateRule object |
参数解释 校验规则 |
value_type |
否 |
Integer |
参数解释 参数值类型 |
xChoiceValue |
否 |
String |
参数解释 choice选择关系 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
mock_id |
否 |
String |
参数解释 mock唯一标识 |
mock_switch |
否 |
Boolean |
参数解释 mock开关 |
mock_url |
否 |
String |
参数解释 mock地址 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
dependent_info |
否 |
Array of ConditionInstance objects |
参数解释 依赖信息列表 |
enabled |
否 |
Boolean |
参数解释 是否启用的标识符 |
is_configDep |
否 |
Boolean |
参数解释 配置依赖的标识符 |
is_dependent |
否 |
Boolean |
参数解释 是否依赖的标识符 |
message |
否 |
String |
参数解释 消息 |
result |
否 |
String |
参数解释 结果 |
special_char |
否 |
String |
参数解释 特殊字符 |
special_char_valid |
否 |
String |
参数解释 特殊字符的有效性 |
x_example |
否 |
String |
参数解释 示例 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
conditionIndex |
否 |
Integer |
参数解释 条件索引,用于标识当前处理的是哪个条件 |
conditionMap |
否 |
Map<String,Array<String>> |
参数解释 条件映射,键为整数,值为字符串列表,用于存储各个条件的信息 |
depParamMap |
否 |
Map<String,DepParamInstance> |
参数解释 依赖参数实例的映射 |
statementIndex |
否 |
Integer |
参数解释 声明索引,用于标识当前处理的是哪个声明 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
compareValue |
否 |
String |
参数解释 比较值 |
comparison |
否 |
String |
参数解释 比较符 |
condition |
否 |
Boolean |
参数解释 条件 |
inValidValues |
否 |
Array of strings |
参数解释 无效值列表 |
name |
否 |
String |
参数解释 名称 |
nullInfo |
否 |
String |
参数解释 空值信息 |
relationMap |
否 |
Map<String,String> |
参数解释 关系映射,key为整数,value为字符串 |
relationNum |
否 |
Integer |
参数解释 关系数量 |
values |
否 |
Array of strings |
参数解释 值列表 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
by_order |
否 |
Integer |
参数解释 节点顺序 |
currentPermission |
否 |
String |
参数解释 当前人员权限 |
description |
否 |
String |
参数解释 参数描述 |
dynamicParam |
否 |
String |
参数解释 动态参数名称 |
dynamicParamFlag |
否 |
Boolean |
参数解释 动态参数标志,默认为false. true代表动态参数; false代表非动态参数 |
functionParams |
否 |
String |
参数解释 变量参数([]:空参、[a]:一参,[a,b]:两参) |
function_arg |
否 |
String |
参数解释 提取类型的类型值 |
function_type |
否 |
String |
参数解释 高级提取类型,响应提取时要使用什么方法处理参数 |
isSensitiveInfo |
否 |
Boolean |
参数解释 是否是敏感字段 |
isSensitiveModified |
否 |
Boolean |
参数解释 敏感字段是否被修改,不敏感字段不关注此值 |
is_out_put |
否 |
Boolean |
参数解释 是否是组合关键字的输出参数,只有组合关键字下awInstance的关键字变量有该字段 |
name |
否 |
String |
参数解释 参数名称 |
node_id |
否 |
String |
参数解释 节点id |
node_type |
否 |
Integer |
参数解释 0/null-变量节点; 1-目录节点 |
oldName |
否 |
String |
参数解释 旧名称 |
parent_node_id |
否 |
String |
参数解释 父节点唯一标识 |
property |
否 |
String |
参数解释 属性 |
regex |
否 |
String |
参数解释 内置函数枚举 |
sensitiveInfoSetterTime |
否 |
String |
参数解释 敏感参数设置时间 |
sensitiveInfoSetterUser |
否 |
String |
参数解释 敏感参数设置者名称 |
type |
否 |
String |
参数解释 类型 |
variableType |
否 |
Integer |
参数解释 变量类型(0:text,10-16:分别对应7个内置函数) |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
activity_id |
否 |
String |
活动唯一标识 |
applied_product |
否 |
String |
应用产品 |
author |
否 |
String |
创建人 |
auto_type |
否 |
String |
自动化类型 |
cataId |
否 |
String |
用例分类唯一标识 |
creation_date |
否 |
String |
创建日期 |
custom_field_1 |
否 |
String |
自定义字段1 |
custom_field_10 |
否 |
String |
自定义字段10 |
custom_field_11 |
否 |
String |
自定义字段11 |
custom_field_12 |
否 |
String |
自定义字段12 |
custom_field_13 |
否 |
String |
自定义字段13 |
custom_field_14 |
否 |
String |
自定义字段14 |
custom_field_15 |
否 |
String |
自定义字段15 |
custom_field_16 |
否 |
String |
自定义字段16 |
custom_field_17 |
否 |
String |
自定义字段17 |
custom_field_18 |
否 |
String |
自定义字段18 |
custom_field_19 |
否 |
String |
自定义字段19 |
custom_field_2 |
否 |
String |
自定义字段2 |
custom_field_20 |
否 |
String |
自定义字段20 |
custom_field_21 |
否 |
String |
自定义字段21 |
custom_field_22 |
否 |
String |
自定义字段22 |
custom_field_23 |
否 |
String |
自定义字段23 |
custom_field_24 |
否 |
String |
自定义字段24 |
custom_field_25 |
否 |
String |
自定义字段25 |
custom_field_3 |
否 |
String |
自定义字段3 |
custom_field_4 |
否 |
String |
自定义字段4 |
custom_field_5 |
否 |
String |
自定义字段5 |
custom_field_6 |
否 |
String |
自定义字段6 |
custom_field_7 |
否 |
String |
自定义字段7 |
custom_field_8 |
否 |
String |
自定义字段8 |
custom_field_9 |
否 |
String |
自定义字段9 |
description |
否 |
String |
描述 |
dr_relationid |
否 |
String |
dr关系唯一标识 |
env_type |
否 |
String |
环境类型 |
exe_platform |
否 |
String |
执行平台 |
expect_output |
否 |
String |
内部预期输出 |
feature_path |
否 |
String |
特性路径 |
isKeyWord |
否 |
Integer |
是否为关键字 |
is_contract_testcase |
否 |
String |
是否为合同测试用例 |
is_paraValidator_testcase |
否 |
String |
是否为参数校验测试用例 |
labelId |
否 |
Array of strings |
标签唯一标识列表 |
last_modified |
否 |
String |
最后修改时间 |
last_modifier |
否 |
String |
最后修改人 |
last_result |
否 |
String |
最后的结果 |
level |
否 |
Integer |
用例级别 |
market |
否 |
String |
市场 |
moduleId |
否 |
String |
模块唯一标识 |
name |
否 |
String |
用例名称 |
networkScriptName |
否 |
String |
公共关键字和项目的关联关系 |
node_name |
否 |
String |
节点名称 |
number |
否 |
String |
用例编号 |
originUri |
否 |
String |
原始的uri |
owner |
否 |
String |
测试的所有者 |
ownerId |
否 |
String |
所有者唯一标识 |
preparation |
否 |
String |
测试前置条件 |
releaseDev |
否 |
String |
新服务新建用例版本号 |
releaseId |
否 |
String |
发布唯一标识 |
remark |
否 |
String |
备注 |
stage |
否 |
String |
阶段 |
steps |
否 |
Array of TmssStep objects |
存储测试步骤和预期结果值对象 |
svnScriptPath |
否 |
String |
脚本路径 |
tags |
否 |
String |
标签 |
test_feature |
否 |
String |
测试特性 |
test_step |
否 |
String |
内部测试步骤 |
test_type |
否 |
Integer |
测试类型 |
uri |
否 |
String |
用例基线Uri(BAM 接口覆盖率迭代下用例信息获取用) |
expectOutput |
否 |
String |
预期输出 |
testStep |
否 |
String |
测试步骤 |
响应参数
状态码:200
参数 |
参数类型 |
描述 |
---|---|---|
error |
CommonResponseErrorOfobject object |
统一错误返回 |
reason |
String |
错误原因 |
result |
Object |
结果 |
status |
String |
状态值,如success、error |
状态码:201
Created
状态码:401
参数 |
参数类型 |
描述 |
---|---|---|
error_code |
String |
参数解释 接口调用失败错误码 取值范围 12-18个字符组成的字符串 |
error_msg |
String |
参数解释 接口调用失败错误信息 取值范围 3-1000个字符组成的字符串 |
状态码:403
参数 |
参数类型 |
描述 |
---|---|---|
error_code |
String |
参数解释 接口调用失败错误码 取值范围 12-18个字符组成的字符串 |
error_msg |
String |
参数解释 接口调用失败错误信息 取值范围 3-1000个字符组成的字符串 |
状态码:404
参数 |
参数类型 |
描述 |
---|---|---|
error_code |
String |
参数解释 接口调用失败错误码 取值范围 12-18个字符组成的字符串 |
error_msg |
String |
参数解释 接口调用失败错误信息 取值范围 3-1000个字符组成的字符串 |
请求示例
put https://{endpoint}/v4/09645c1f3f954a8d9ab29174857cffc5/testcase/v91j0000vl6b2b2e
{
"id" : "ebfa6ceb72df4c19ae52642845edcd04",
"tmss_feature_uri" : "",
"name" : "88888888",
"project_id" : "23c1c5ba3b3c4e92b8adaab3529913c4",
"aw_instance" : {
"setup_aw_list" : [ ],
"test_aw_list" : [ {
"id" : "17189566437246831",
"aw_id" : "",
"alias_runaw" : "",
"aw_description" : "",
"name" : "",
"description" : "",
"check_point_list" : [ ],
"children" : [ ],
"condition_statement" : "1000",
"condition_type" : 20,
"custom_header" : [ ],
"header_array" : [ ],
"is_disabled" : 0,
"param_type_and_value" : [ ],
"projectId" : "23c1c5ba3b3c4e92b8adaab3529913c4",
"retry_interval" : "",
"retry_times" : "",
"variable_list" : [ ],
"relation" : ""
} ],
"teardown_aw_list" : [ ]
},
"case_variable_list" : [ ],
"script_name" : "106",
"script_path" : "src/scripts/user/Case_ebfa6ceb72df4c19ae52642845edcd04_1.java",
"tmss_case_uri" : "v91k0000vl6er6ue",
"tmss_property" : {
"name" : "88888888",
"number" : "106",
"cataId" : "v91k0000vl6eobbq",
"level" : 2,
"node_name" : "123",
"test_type" : 1,
"exe_platform" : "apitest",
"auto_type" : "1",
"test_feature" : "09645c1f3f954a8d9ab29174857cffc5_32559725_defaultFeature",
"last_modified" : "2024-06-21 15:16:06",
"last_modifier" : "efdb403066474ab08836b9eeaaa23bca",
"author" : "1_devcloud_devcloud_s00314720",
"creation_date" : "2024-06-21 15:16:06",
"activity_id" : "1",
"steps" : [ { } ]
},
"activity_id" : "1",
"import_info_list" : [ ]
}
响应示例
状态码:200
OK
{
"status" : "success",
"result" : "success"
}
SDK代码示例
SDK代码示例如下。
Java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
package com.huaweicloud.sdk.test;
import com.huaweicloud.sdk.core.auth.ICredential;
import com.huaweicloud.sdk.core.auth.BasicCredentials;
import com.huaweicloud.sdk.core.exception.ConnectionException;
import com.huaweicloud.sdk.core.exception.RequestTimeoutException;
import com.huaweicloud.sdk.core.exception.ServiceResponseException;
import com.huaweicloud.sdk.cloudtest.v1.region.CloudtestRegion;
import com.huaweicloud.sdk.cloudtest.v1.*;
import com.huaweicloud.sdk.cloudtest.v1.model.*;
import java.util.List;
import java.util.ArrayList;
public class UpdateTestCaseAndScriptSolution {
public static void main(String[] args) {
// The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
// In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
String ak = System.getenv("CLOUD_SDK_AK");
String sk = System.getenv("CLOUD_SDK_SK");
ICredential auth = new BasicCredentials()
.withAk(ak)
.withSk(sk);
CloudtestClient client = CloudtestClient.newBuilder()
.withCredential(auth)
.withRegion(CloudtestRegion.valueOf("<YOUR REGION>"))
.build();
UpdateTestCaseAndScriptRequest request = new UpdateTestCaseAndScriptRequest();
request.withTmssCaseUri("{tmss_case_uri}");
request.withProjectId("{project_id}");
CreateTestCaseReq body = new CreateTestCaseReq();
List<TmssStep> listTmssPropertySteps = new ArrayList<>();
TmssTestcase tmssPropertybody = new TmssTestcase();
tmssPropertybody.withActivityId("1")
.withAuthor("1_devcloud_devcloud_s00314720")
.withAutoType("1")
.withCataId("v91k0000vl6eobbq")
.withCreationDate("2024-06-21 15:16:06")
.withExePlatform("apitest")
.withLastModified("2024-06-21 15:16:06")
.withLastModifier("efdb403066474ab08836b9eeaaa23bca")
.withLevel(2)
.withName("88888888")
.withNodeName("123")
.withNumber("106")
.withSteps(listTmssPropertySteps)
.withTestFeature("09645c1f3f954a8d9ab29174857cffc5_32559725_defaultFeature")
.withTestType(1);
List<AwInstance> listAwInstanceTestAwList = new ArrayList<>();
listAwInstanceTestAwList.add(
new AwInstance()
.withAliasRunaw("")
.withAwDescription("")
.withAwId("")
.withCheckPointList()
.withChildren()
.withConditionStatement("1000")
.withConditionType(20)
.withCustomHeader()
.withDescription("")
.withHeaderArray()
.withId("17189566437246831")
.withIsDisabled(0)
.withName("")
.withParamTypeAndValue()
.withProjectId("23c1c5ba3b3c4e92b8adaab3529913c4")
.withRelation("")
.withRetryInterval("")
.withRetryTimes("")
.withVariableList()
);
CaseAwInstance awInstancebody = new CaseAwInstance();
awInstancebody.withTestAwList(listAwInstanceTestAwList);
body.withTmssProperty(tmssPropertybody);
body.withTmssFeatureUri("");
body.withTmssCaseUri("v91k0000vl6er6ue");
body.withScriptPath("src/scripts/user/Case_ebfa6ceb72df4c19ae52642845edcd04_1.java");
body.withScriptName("106");
body.withProjectId("23c1c5ba3b3c4e92b8adaab3529913c4");
body.withName("88888888");
body.withId("ebfa6ceb72df4c19ae52642845edcd04");
body.withAwInstance(awInstancebody);
body.withActivityId("1");
request.withBody(body);
try {
UpdateTestCaseAndScriptResponse response = client.updateTestCaseAndScript(request);
System.out.println(response.toString());
} catch (ConnectionException e) {
e.printStackTrace();
} catch (RequestTimeoutException e) {
e.printStackTrace();
} catch (ServiceResponseException e) {
e.printStackTrace();
System.out.println(e.getHttpStatusCode());
System.out.println(e.getRequestId());
System.out.println(e.getErrorCode());
System.out.println(e.getErrorMsg());
}
}
}
|
Python
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# coding: utf-8
import os
from huaweicloudsdkcore.auth.credentials import BasicCredentials
from huaweicloudsdkcloudtest.v1.region.cloudtest_region import CloudtestRegion
from huaweicloudsdkcore.exceptions import exceptions
from huaweicloudsdkcloudtest.v1 import *
if __name__ == "__main__":
# The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
# In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
ak = os.environ["CLOUD_SDK_AK"]
sk = os.environ["CLOUD_SDK_SK"]
credentials = BasicCredentials(ak, sk)
client = CloudtestClient.new_builder() \
.with_credentials(credentials) \
.with_region(CloudtestRegion.value_of("<YOUR REGION>")) \
.build()
try:
request = UpdateTestCaseAndScriptRequest()
request.tmss_case_uri = "{tmss_case_uri}"
request.project_id = "{project_id}"
listStepsTmssProperty = []
tmssPropertybody = TmssTestcase(
activity_id="1",
author="1_devcloud_devcloud_s00314720",
auto_type="1",
cata_id="v91k0000vl6eobbq",
creation_date="2024-06-21 15:16:06",
exe_platform="apitest",
last_modified="2024-06-21 15:16:06",
last_modifier="efdb403066474ab08836b9eeaaa23bca",
level=2,
name="88888888",
node_name="123",
number="106",
steps=listStepsTmssProperty,
test_feature="09645c1f3f954a8d9ab29174857cffc5_32559725_defaultFeature",
test_type=1
)
listTestAwListAwInstance = [
AwInstance(
alias_runaw="",
aw_description="",
aw_id="",
condition_statement="1000",
condition_type=20,
description="",
id="17189566437246831",
is_disabled=0,
name="",
project_id="23c1c5ba3b3c4e92b8adaab3529913c4",
relation="",
retry_interval="",
retry_times="",
)
]
awInstancebody = CaseAwInstance(
test_aw_list=listTestAwListAwInstance
)
request.body = CreateTestCaseReq(
tmss_property=tmssPropertybody,
tmss_feature_uri="",
tmss_case_uri="v91k0000vl6er6ue",
script_path="src/scripts/user/Case_ebfa6ceb72df4c19ae52642845edcd04_1.java",
script_name="106",
project_id="23c1c5ba3b3c4e92b8adaab3529913c4",
name="88888888",
id="ebfa6ceb72df4c19ae52642845edcd04",
aw_instance=awInstancebody,
activity_id="1"
)
response = client.update_test_case_and_script(request)
print(response)
except exceptions.ClientRequestException as e:
print(e.status_code)
print(e.request_id)
print(e.error_code)
print(e.error_msg)
|
Go
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
package main
import (
"fmt"
"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
cloudtest "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/cloudtest/v1"
"github.com/huaweicloud/huaweicloud-sdk-go-v3/services/cloudtest/v1/model"
region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/cloudtest/v1/region"
)
func main() {
// The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
// In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
ak := os.Getenv("CLOUD_SDK_AK")
sk := os.Getenv("CLOUD_SDK_SK")
auth := basic.NewCredentialsBuilder().
WithAk(ak).
WithSk(sk).
Build()
client := cloudtest.NewCloudtestClient(
cloudtest.CloudtestClientBuilder().
WithRegion(region.ValueOf("<YOUR REGION>")).
WithCredential(auth).
Build())
request := &model.UpdateTestCaseAndScriptRequest{}
request.TmssCaseUri = "{tmss_case_uri}"
request.ProjectId = "{project_id}"
}
activityIdTmssProperty:= "1"
authorTmssProperty:= "1_devcloud_devcloud_s00314720"
autoTypeTmssProperty:= "1"
cataIdTmssProperty:= "v91k0000vl6eobbq"
creationDateTmssProperty:= "2024-06-21 15:16:06"
exePlatformTmssProperty:= "apitest"
lastModifiedTmssProperty:= "2024-06-21 15:16:06"
lastModifierTmssProperty:= "efdb403066474ab08836b9eeaaa23bca"
levelTmssProperty:= int32(2)
nameTmssProperty:= "88888888"
nodeNameTmssProperty:= "123"
numberTmssProperty:= "106"
testFeatureTmssProperty:= "09645c1f3f954a8d9ab29174857cffc5_32559725_defaultFeature"
testTypeTmssProperty:= int32(1)
tmssPropertybody := &model.TmssTestcase{
ActivityId: &activityIdTmssProperty,
Author: &authorTmssProperty,
AutoType: &autoTypeTmssProperty,
CataId: &cataIdTmssProperty,
CreationDate: &creationDateTmssProperty,
ExePlatform: &exePlatformTmssProperty,
LastModified: &lastModifiedTmssProperty,
LastModifier: &lastModifierTmssProperty,
Level: &levelTmssProperty,
Name: &nameTmssProperty,
NodeName: &nodeNameTmssProperty,
Number: &numberTmssProperty,
Steps: &listStepsTmssProperty,
TestFeature: &testFeatureTmssProperty,
TestType: &testTypeTmssProperty,
}
aliasRunawTestAwList:= ""
awDescriptionTestAwList:= ""
awIdTestAwList:= ""
conditionStatementTestAwList:= "1000"
conditionTypeTestAwList:= int32(20)
descriptionTestAwList:= ""
idTestAwList:= "17189566437246831"
isDisabledTestAwList:= int32(0)
nameTestAwList:= ""
projectIdTestAwList:= "23c1c5ba3b3c4e92b8adaab3529913c4"
relationTestAwList:= ""
retryIntervalTestAwList:= ""
retryTimesTestAwList:= ""
var listTestAwListAwInstance = []model.AwInstance{
{
AliasRunaw: &aliasRunawTestAwList,
AwDescription: &awDescriptionTestAwList,
AwId: &awIdTestAwList,
ConditionStatement: &conditionStatementTestAwList,
ConditionType: &conditionTypeTestAwList,
Description: &descriptionTestAwList,
Id: &idTestAwList,
IsDisabled: &isDisabledTestAwList,
Name: &nameTestAwList,
ProjectId: &projectIdTestAwList,
Relation: &relationTestAwList,
RetryInterval: &retryIntervalTestAwList,
RetryTimes: &retryTimesTestAwList,
},
}
awInstancebody := &model.CaseAwInstance{
TestAwList: &listTestAwListAwInstance,
}
tmssFeatureUriCreateTestCaseReq:= ""
tmssCaseUriCreateTestCaseReq:= "v91k0000vl6er6ue"
scriptPathCreateTestCaseReq:= "src/scripts/user/Case_ebfa6ceb72df4c19ae52642845edcd04_1.java"
scriptNameCreateTestCaseReq:= "106"
projectIdCreateTestCaseReq:= "23c1c5ba3b3c4e92b8adaab3529913c4"
nameCreateTestCaseReq:= "88888888"
idCreateTestCaseReq:= "ebfa6ceb72df4c19ae52642845edcd04"
activityIdCreateTestCaseReq:= "1"
request.Body = &model.CreateTestCaseReq{
TmssProperty: tmssPropertybody,
TmssFeatureUri: &tmssFeatureUriCreateTestCaseReq,
TmssCaseUri: &tmssCaseUriCreateTestCaseReq,
ScriptPath: &scriptPathCreateTestCaseReq,
ScriptName: &scriptNameCreateTestCaseReq,
ProjectId: &projectIdCreateTestCaseReq,
Name: &nameCreateTestCaseReq,
Id: &idCreateTestCaseReq,
AwInstance: awInstancebody,
ActivityId: &activityIdCreateTestCaseReq,
}
response, err := client.UpdateTestCaseAndScript(request)
if err == nil {
fmt.Printf("%+v\n", response)
} else {
fmt.Println(err)
}
}
|
更多
更多编程语言的SDK代码示例,请参见API Explorer的代码示例页签,可生成自动对应的SDK代码示例。
状态码
状态码 |
描述 |
---|---|
200 |
OK |
201 |
Created |
401 |
Unauthorized |
403 |
Forbidden |
404 |
Not Found |
错误码
请参见错误码。