优化用例步骤中备注字段为扩展用法字段,将模板保存移至扩展字段
This commit is contained in:
parent
337575f494
commit
fd698b613a
|
@ -331,7 +331,7 @@ create table project_casesteps
|
|||
steptype int(2) not null COMMENT '0 接口 1 UI',
|
||||
time VARCHAR(30) COMMENT '最后更新时间',
|
||||
operationer VARCHAR(20) COMMENT '最后更新人员',
|
||||
remark VARCHAR(200) COMMENT '备注',
|
||||
extend VARCHAR(200) COMMENT '扩展字段,可用于备注、存储HTTP模板等',
|
||||
primary key (ID)
|
||||
)default character set utf8;
|
||||
|
||||
|
|
|
@ -5,6 +5,11 @@ alter table project_protocoltemplate add column responsehead int(2) DEFAULT '0'
|
|||
alter table project_protocoltemplate add column responsecode int(2) DEFAULT '0' not null COMMENT '请求响应返回值是否带状态码 0不带 1带';
|
||||
alter table userinfo add column status varchar(2) DEFAULT '0' not null COMMENT '状态:(0:正常,1:注销)';
|
||||
/* 新增加项目ID字段*/
|
||||
alter table test_Taskexcute add column projectid int(10) not null COMMENT '项目ID';
|
||||
alter table test_taskexcute add column projectid int(10) not null COMMENT '项目ID';
|
||||
/*历史数据项目ID初始化*/
|
||||
update test_taskexcute t, test_jobs ts set t.projectid= ts.projectid where ts.id = t.jobid and t.projectid =0;
|
||||
/*修改步骤表中备注字段的用处,升级为扩展字段,暂时用于HTTP模板的存储*/
|
||||
ALTER TABLE project_casesteps change remark extend varchar(200) COMMENT '扩展字段,可用于备注、存储HTTP模板等';
|
||||
/*把在action中存储的模板信息移到EXTEND字段中进行管理*/
|
||||
update project_casesteps set extend=action where action like "【%" and action like "%】%";
|
||||
update project_casesteps set action="" where action like "【%" and action like "%】%";
|
|
@ -29,7 +29,7 @@ public class ProjectCasesteps implements java.io.Serializable{
|
|||
private int steptype;
|
||||
private String time;
|
||||
private String operationer;
|
||||
private String remark;
|
||||
private String extend;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
|
@ -104,10 +104,11 @@ public class ProjectCasesteps implements java.io.Serializable{
|
|||
public void setOperationer(String operationer) {
|
||||
this.operationer = operationer;
|
||||
}
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
public String getExtend() {
|
||||
return extend;
|
||||
}
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
public void setExtend(String extend) {
|
||||
this.extend = extend;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -125,7 +125,7 @@ public class ProjectCasestepsController {
|
|||
step.setExpectedresult("");
|
||||
step.setProjectid(prcase.getProjectid());
|
||||
step.setSteptype(prcase.getCasetype());
|
||||
step.setRemark("");
|
||||
step.setExtend("");
|
||||
steps.add(step);
|
||||
}
|
||||
|
||||
|
@ -211,7 +211,7 @@ public class ProjectCasestepsController {
|
|||
step.setParameters(step.getParameters().replace(""", "\""));
|
||||
step.setAction(step.getAction().replace(""", "\""));
|
||||
step.setExpectedresult(step.getExpectedresult().replace(""", "\""));
|
||||
step.setRemark(step.getRemark().replace(""", "\""));
|
||||
step.setExtend(step.getExtend().replace(""", "\""));
|
||||
casestepsservice.add(step);
|
||||
}
|
||||
projectcase.setOperationer(usercode);
|
||||
|
@ -485,6 +485,7 @@ public class ProjectCasestepsController {
|
|||
steps.setExpectedresult(expectedresult);
|
||||
steps.setProjectid(Integer.valueOf(projectid));
|
||||
steps.setSteptype(Integer.valueOf(steptype));
|
||||
steps.setExtend("");
|
||||
|
||||
Date currentTime = new Date();
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
|
|
@ -42,8 +42,8 @@
|
|||
<property name="operationer" type="java.lang.String">
|
||||
<column name="operationer" length="20" not-null="false" />
|
||||
</property>
|
||||
<property name="remark" type="java.lang.String">
|
||||
<column name="remark" length="200" not-null="false" />
|
||||
<property name="extend" type="java.lang.String">
|
||||
<column name="extend" length="200" not-null="false" />
|
||||
</property>
|
||||
</class>
|
||||
</hibernate-mapping>
|
|
@ -515,19 +515,8 @@
|
|||
field : 'operationer',
|
||||
title : '更新人员'
|
||||
}, {
|
||||
field : 'remark',
|
||||
title : '备注',
|
||||
editable : {
|
||||
type : 'text',
|
||||
title : '备注',
|
||||
emptytext : "【备注】为空",
|
||||
validate : function(value) {
|
||||
if (value.length > 200)
|
||||
return '备注不能超过200个字符';
|
||||
// if (value.length < 2)
|
||||
// return '备注不能小于2个字符';
|
||||
}
|
||||
}
|
||||
field : 'extend',
|
||||
title : '扩展字段',
|
||||
}, {
|
||||
field : 'id',
|
||||
title : 'id',
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
<th>步骤动作</th>
|
||||
<th>预期结果</th>
|
||||
<th>类型</th>
|
||||
<th>备注</th>
|
||||
<th>扩展字段</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
@ -95,10 +95,10 @@
|
|||
<sf:label class="form-control" path="stepnum" id="stepnum${i.count}" value="${t.stepnum}"/>
|
||||
</td>
|
||||
<td width="18%">
|
||||
<div class="form-group"><sf:input type="text" class="form-control" path="path" id="path${i.count}" value="${t.path}"/></div>
|
||||
<div class="form-group" style="margin-bottom:0px"><sf:input type="text" class="form-control" path="path" id="path${i.count}" value="${t.path}"/></div>
|
||||
</td>
|
||||
<td width="13%">
|
||||
<div class="form-group">
|
||||
<div class="form-group" style="margin-bottom:0px">
|
||||
<div class="input-group" style="width:100%;">
|
||||
<sf:input type="text" class="form-control" path="operation" id="operation${i.count}" value="${t.operation}"/>
|
||||
<div class="input-group-btn">
|
||||
|
@ -108,23 +108,24 @@
|
|||
</div>
|
||||
</td>
|
||||
<td width="17%">
|
||||
<div class="form-group"><sf:input type="text" class="form-control" path="parameters" id="parameters${i.count}" value="${t.parameters}"/></div>
|
||||
<div class="form-group" style="margin-bottom:0px"><sf:input type="text" class="form-control" path="parameters" id="parameters${i.count}" value="${t.parameters}"/></div>
|
||||
</td>
|
||||
<td width="10%">
|
||||
<div class="form-group">
|
||||
<div class="input-group" style="width:100%;">
|
||||
<div class="form-group" style="margin-bottom:0px">
|
||||
<sf:input type="text" class="form-control" path="action" id="action${i.count}" value="${t.action}"/>
|
||||
<%-- <div class="input-group" style="width:100%;">
|
||||
<sf:input type="text" class="form-control" path="action" id="action${i.count}" value="${t.action}"/>
|
||||
<div class="input-group-btn">
|
||||
<ul class="dropdown-menu dropdown-menu-right" role="menu"></ul>
|
||||
</div>
|
||||
</div>
|
||||
</div> --%>
|
||||
</div>
|
||||
</td>
|
||||
<td width="13%">
|
||||
<div class="form-group"><sf:input type="text" class="form-control" path="expectedresult" id="expectedresult${i.count}" value="${t.expectedresult}"/></div>
|
||||
<div class="form-group" style="margin-bottom:0px"><sf:input type="text" class="form-control" path="expectedresult" id="expectedresult${i.count}" value="${t.expectedresult}"/></div>
|
||||
</td>
|
||||
<td width="8%">
|
||||
<div class="form-group">
|
||||
<div class="form-group" style="margin-bottom:0px">
|
||||
<sf:select type="text" class="form-control" align-items="left" path="steptype" id="steptype${i.count}" onChange="getObIndex(this)">
|
||||
<option value="0" <c:if test="${t.steptype==0 }"> selected="selected"</c:if>>接口</option>
|
||||
<option value="1" <c:if test="${t.steptype==1 }"> selected="selected"</c:if>>Web UI</option>
|
||||
|
@ -135,7 +136,14 @@
|
|||
</div>
|
||||
</td>
|
||||
<td width="10%">
|
||||
<div class="form-group"><sf:input type="text" class="form-control" path="remark" id="remark${i.count}" value="${t.remark}"/></div>
|
||||
<div class="form-group" style="margin-bottom:0px">
|
||||
<div class="input-group" style="width:100%;">
|
||||
<sf:input type="text" class="form-control" path="extend" id="extend${i.count}" value="${t.extend}"/>
|
||||
<div class="input-group-btn">
|
||||
<ul class="dropdown-menu dropdown-menu-right" role="menu"></ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td width="8%" style="vertical-align: middle;">
|
||||
<a class="fa fa-plus-circle fa-5" style="font-size: 20px; cursor: pointer;" onclick="addsteps(this,0)"></a>
|
||||
|
@ -284,10 +292,10 @@
|
|||
message: '【步骤动作】无效!',
|
||||
validators: {
|
||||
stringLength: {
|
||||
min: 2,
|
||||
min: 0,
|
||||
max: 50,
|
||||
message: '【步骤动作】长度必须小于50个字符'
|
||||
},
|
||||
}/* ,
|
||||
callback: {
|
||||
message: '类型是HTTP,请选择协议模板',
|
||||
callback:function(value,validator,$field){
|
||||
|
@ -308,7 +316,7 @@
|
|||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
} */
|
||||
}
|
||||
},
|
||||
expectedresult: {
|
||||
|
@ -347,13 +355,34 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
remark: {
|
||||
message: '【备注】无效!',
|
||||
extend: {
|
||||
message: '【扩展字段】无效!',
|
||||
validators: {
|
||||
stringLength: {
|
||||
min: 0,
|
||||
max: 200,
|
||||
message: '【备注】长度必须小于200个字符'
|
||||
message: '【扩展字段】长度必须小于200个字符'
|
||||
},
|
||||
callback: {
|
||||
message: '类型是HTTP,请选择协议模板',
|
||||
callback:function(value,validator,$field){
|
||||
var num=$field.attr("id").substring(6);
|
||||
var steps;
|
||||
if(casesteps.steptype.size==0){
|
||||
steps=casesteps.steptype.value
|
||||
}else{
|
||||
steps=casesteps.steptype[num-1].value
|
||||
}
|
||||
|
||||
if(steps=="2" && value==""){
|
||||
return {
|
||||
valid: false,
|
||||
message: 'HTTP必须选择协议模板'
|
||||
};
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -415,7 +444,7 @@
|
|||
json = json + "\"id\":" + $("#id" + index).val() + ",";
|
||||
json = json + "\"caseid\":\"" + '${caseid}' + "\",";
|
||||
json = json + "\"projectid\":\"" + '${projectid}' + "\",";
|
||||
json = json + "\"remark\":\"" + $("#remark" + index).val().replaceAll("\"", """) + "\"}";
|
||||
json = json + "\"extend\":\"" + $("#extend" + index).val().replaceAll("\"", """) + "\"}";
|
||||
if (i !== oTable.rows.length - 1) {
|
||||
json = json + ",";
|
||||
}
|
||||
|
@ -474,15 +503,15 @@
|
|||
opob.children[1].setAttribute("id", "operation" + index);
|
||||
}
|
||||
oTable.rows[i].cells[3].children[0].children[0].setAttribute("id", "parameters" + index);
|
||||
var aob = oTable.rows[i].cells[4].children[0].children[0];
|
||||
if (aob.children[0].tagName.toLocaleLowerCase() === 'input') {
|
||||
aob.children[0].setAttribute("id", "action" + index);
|
||||
} else {
|
||||
aob.children[1].setAttribute("id", "action" + index);
|
||||
}
|
||||
oTable.rows[i].cells[4].children[0].children[0].setAttribute("id", "action" + index);
|
||||
oTable.rows[i].cells[5].children[0].children[0].setAttribute("id", "expectedresult" + index);
|
||||
oTable.rows[i].cells[6].children[0].children[0].setAttribute("id", "steptype" + index);
|
||||
oTable.rows[i].cells[7].children[0].children[0].setAttribute("id", "remark" + index);
|
||||
oTable.rows[i].cells[6].children[0].children[0].setAttribute("id", "steptype" + index);
|
||||
var eob = oTable.rows[i].cells[7].children[0].children[0];
|
||||
if (eob.children[0].tagName.toLocaleLowerCase() === 'input') {
|
||||
eob.children[0].setAttribute("id", "extend" + index);
|
||||
} else {
|
||||
eob.children[1].setAttribute("id", "extend" + index);
|
||||
}
|
||||
}
|
||||
initSuggest(begin + 1);
|
||||
if(iscopy==0){
|
||||
|
@ -518,15 +547,16 @@
|
|||
opob.children[1].setAttribute("id", "operation" + index);
|
||||
}
|
||||
oTable.rows[i].cells[3].children[0].children[0].setAttribute("id", "parameters" + index);
|
||||
var aob = oTable.rows[i].cells[4].children[0].children[0];
|
||||
if (aob.children[0].tagName.toLocaleLowerCase() === 'input') {
|
||||
aob.children[0].setAttribute("id", "action" + index);
|
||||
} else {
|
||||
aob.children[1].setAttribute("id", "action" + index);
|
||||
}
|
||||
oTable.rows[i].cells[4].children[0].children[0].setAttribute("id", "action" + index);
|
||||
oTable.rows[i].cells[5].children[0].children[0].setAttribute("id", "expectedresult" + index);
|
||||
oTable.rows[i].cells[6].children[0].children[0].setAttribute("id", "steptype" + index);
|
||||
oTable.rows[i].cells[7].children[0].children[0].setAttribute("id", "remark" + index);
|
||||
|
||||
var eob = oTable.rows[i].cells[7].children[0].children[0];
|
||||
if (eob.children[0].tagName.toLocaleLowerCase() === 'input') {
|
||||
eob.children[0].setAttribute("id", "extend" + index);
|
||||
} else {
|
||||
eob.children[1].setAttribute("id", "extend" + index);
|
||||
}
|
||||
}
|
||||
$('#casesteps').data('bootstrapValidator').resetForm();
|
||||
$('#casesteps').data('bootstrapValidator').validate();
|
||||
|
@ -554,15 +584,15 @@
|
|||
opob.children[1].setAttribute("id", "operation" + index);
|
||||
}
|
||||
oTable.rows[i].cells[3].children[0].children[0].setAttribute("id", "parameters" + index);
|
||||
var aob = oTable.rows[i].cells[4].children[0].children[0];
|
||||
if (aob.children[0].tagName.toLocaleLowerCase() === 'input') {
|
||||
aob.children[0].setAttribute("id", "action" + index);
|
||||
} else {
|
||||
aob.children[1].setAttribute("id", "action" + index);
|
||||
}
|
||||
oTable.rows[i].cells[4].children[0].children[0].setAttribute("id", "action" + index);
|
||||
oTable.rows[i].cells[5].children[0].children[0].setAttribute("id", "expectedresult" + index);
|
||||
oTable.rows[i].cells[6].children[0].children[0].setAttribute("id", "steptype" + index);
|
||||
oTable.rows[i].cells[7].children[0].children[0].setAttribute("id", "remark" + index);
|
||||
var eob = oTable.rows[i].cells[7].children[0].children[0];
|
||||
if (eob.children[0].tagName.toLocaleLowerCase() === 'input') {
|
||||
eob.children[0].setAttribute("id", "extend" + index);
|
||||
} else {
|
||||
eob.children[1].setAttribute("id", "extend" + index);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -589,15 +619,15 @@
|
|||
opob.children[1].setAttribute("id", "operation" + index);
|
||||
}
|
||||
oTable.rows[i].cells[3].children[0].children[0].setAttribute("id", "parameters" + index);
|
||||
var aob = oTable.rows[i].cells[4].children[0].children[0];
|
||||
if (aob.children[0].tagName.toLocaleLowerCase() === 'input') {
|
||||
aob.children[0].setAttribute("id", "action" + index);
|
||||
} else {
|
||||
aob.children[1].setAttribute("id", "action" + index);
|
||||
}
|
||||
oTable.rows[i].cells[4].children[0].children[0].setAttribute("id", "action" + index);
|
||||
oTable.rows[i].cells[5].children[0].children[0].setAttribute("id", "expectedresult" + index);
|
||||
oTable.rows[i].cells[6].children[0].children[0].setAttribute("id", "steptype" + index);
|
||||
oTable.rows[i].cells[7].children[0].children[0].setAttribute("id", "remark" + index);
|
||||
var eob = oTable.rows[i].cells[7].children[0].children[0];
|
||||
if (eob.children[0].tagName.toLocaleLowerCase() === 'input') {
|
||||
eob.children[0].setAttribute("id", "extend" + index);
|
||||
} else {
|
||||
eob.children[1].setAttribute("id", "extend" + index);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -615,7 +645,7 @@
|
|||
$("#parameters" + index).val('');
|
||||
$("#action" + index).val('');
|
||||
$("#expectedresult" + index).val('');
|
||||
$("#remark" + index).val('');
|
||||
$("#extend" + index).val('');
|
||||
}
|
||||
|
||||
function initSuggest(index) {
|
||||
|
@ -626,11 +656,11 @@
|
|||
initSuggestOperation(index, steptype);
|
||||
initSuggestAction(index, steptypetext);
|
||||
} else if (steptype === '1' || steptype === '4') {
|
||||
$("#action" + index).bsSuggest("destroy");
|
||||
$("#extend" + index).bsSuggest("destroy");
|
||||
initSuggestOperation(index, steptype);
|
||||
} else {
|
||||
$("#operation" + index).bsSuggest("destroy");
|
||||
$("#action" + index).bsSuggest("destroy");
|
||||
$("#extend" + index).bsSuggest("destroy");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -641,7 +671,7 @@
|
|||
casesteps.bootstrapValidator('addField', 'parameters');
|
||||
casesteps.bootstrapValidator('addField', 'action');
|
||||
casesteps.bootstrapValidator('addField', 'expectedresult');
|
||||
casesteps.bootstrapValidator('addField', 'remark');
|
||||
casesteps.bootstrapValidator('addField', 'extend');
|
||||
casesteps.data('bootstrapValidator').validate();
|
||||
}
|
||||
|
||||
|
@ -653,9 +683,9 @@
|
|||
}
|
||||
|
||||
function initSuggestAction(index, steptypetext) {
|
||||
var actionindex = $("#action" + index);
|
||||
actionindex.bsSuggest("destroy");
|
||||
actionindex.bsSuggest({
|
||||
var extendindex = $("#extend" + index);
|
||||
extendindex.bsSuggest("destroy");
|
||||
extendindex.bsSuggest({
|
||||
url: "/projectprotocolTemplate/cgetPTemplateList.do?projectid=${projectid}&steptype=" + steptypetext,
|
||||
/*effectiveFields: ["userName", "shortAccount"],
|
||||
searchFields: [ "shortAccount"],*/
|
||||
|
@ -670,7 +700,7 @@
|
|||
}).on('onDataRequestSuccess', function (e, result) {
|
||||
|
||||
}).on('onSetSelectValue', function (e, keyword, data) {
|
||||
$('#casesteps').data('bootstrapValidator').updateStatus(actionindex, 'NOT_VALIDATED', null).validateField(actionindex);
|
||||
$('#casesteps').data('bootstrapValidator').updateStatus(extendindex, 'NOT_VALIDATED', null).validateField(extendindex);
|
||||
}).on('onUnsetSelectValue', function () {
|
||||
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue