feat(接口测试): 场景CSV变量增加 是否允许引号选项 #1005136

--bug=1005136 --user=赵勇 【github#4657】接口自... https://www.tapd.cn/55049933/s/1025495
This commit is contained in:
fit2-zhao 2021-07-15 17:15:44 +08:00 committed by fit2-zhao
parent a89b86ac6b
commit 307e063a49
7 changed files with 24 additions and 8 deletions

View File

@ -207,6 +207,7 @@ public abstract class MsTestElement {
csvDataSet.setProperty("shareMode", shareMode); csvDataSet.setProperty("shareMode", shareMode);
csvDataSet.setProperty("recycle", true); csvDataSet.setProperty("recycle", true);
csvDataSet.setProperty("delimiter", item.getDelimiter()); csvDataSet.setProperty("delimiter", item.getDelimiter());
csvDataSet.setProperty("quotedData", item.isQuotedData());
csvDataSet.setComment(StringUtils.isEmpty(item.getDescription()) ? "" : item.getDescription()); csvDataSet.setComment(StringUtils.isEmpty(item.getDescription()) ? "" : item.getDescription());
tree.add(csvDataSet); tree.add(csvDataSet);
}); });

View File

@ -27,6 +27,7 @@ public class ScenarioVariable {
*/ */
private List<BodyFile> files; private List<BodyFile> files;
private String delimiter; private String delimiter;
private boolean quotedData;
private String encoding; private String encoding;
/** /**
* counter * counter

View File

@ -15,18 +15,18 @@
<el-tabs v-model="activeName" @tab-click="handleClick" style="margin-left: 40px"> <el-tabs v-model="activeName" @tab-click="handleClick" style="margin-left: 40px">
<el-tab-pane :label="$t('variables.config')" name="config"> <el-tab-pane :label="$t('variables.config')" name="config">
<el-row> <el-row>
<el-col :span="4" style="margin-top: 5px"> <el-col :span="5" style="margin-top: 5px">
<span>{{$t('variables.add_file')}}</span> <span>{{$t('variables.add_file')}}</span>
</el-col> </el-col>
<el-col :span="20"> <el-col :span="19">
<ms-csv-file-upload :parameter="editData"/> <ms-csv-file-upload :parameter="editData"/>
</el-col> </el-col>
</el-row> </el-row>
<el-row style="margin-top: 10px"> <el-row style="margin-top: 10px">
<el-col :span="4" style="margin-top: 5px"> <el-col :span="5" style="margin-top: 5px">
<span>Encoding</span> <span>Encoding</span>
</el-col> </el-col>
<el-col :span="20"> <el-col :span="19">
<el-autocomplete <el-autocomplete
size="small" size="small"
style="width: 100%" style="width: 100%"
@ -37,14 +37,24 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row style="margin-top: 10px"> <el-row style="margin-top: 10px">
<el-col :span="4" style="margin-top: 5px"> <el-col :span="5" style="margin-top: 5px">
<span>{{$t('variables.delimiter')}}</span> <span>{{$t('variables.delimiter')}}</span>
</el-col> </el-col>
<el-col :span="20"> <el-col :span="19">
<el-input v-model="editData.delimiter" size="small"/> <el-input v-model="editData.delimiter" size="small"/>
</el-col> </el-col>
</el-row> </el-row>
<el-row style="margin-top: 10px">
<el-col :span="5" style="margin-top: 5px">
<span>{{$t('variables.quoted_data')}}</span>
</el-col>
<el-col :span="19">
<el-select v-model="editData.quotedData" size="small">
<el-option label="True" :value="true"/>
<el-option label="False" :value="false"/>
</el-select>
</el-col>
</el-row>
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="$t('schema.preview')" name="preview"> <el-tab-pane :label="$t('schema.preview')" name="preview">
<el-table <el-table

View File

@ -215,7 +215,7 @@ export default {
} }
}, },
handleClick(command) { handleClick(command) {
this.editData = {delimiter: ","}; this.editData = {delimiter: ",",quotedData: 'false'};
this.editData.type = command; this.editData.type = command;
this.addParameters(this.editData); this.addParameters(this.editData);
}, },
@ -235,6 +235,7 @@ export default {
v.id = getUUID(); v.id = getUUID();
if (v.type === 'CSV') { if (v.type === 'CSV') {
v.delimiter = ","; v.delimiter = ",";
v.quotedData = false;
} }
this.variables.push(v); this.variables.push(v);
let index = 1; let index = 1;

View File

@ -1902,6 +1902,7 @@ export default {
add_file: "Add file", add_file: "Add file",
delimiter: "Delimiter", delimiter: "Delimiter",
format: "Output format", format: "Output format",
quoted_data: "Whether to allow quotes",
}, },
auth_source: { auth_source: {
delete_prompt: 'This operation will delete the authentication source, do you want to continue? ', delete_prompt: 'This operation will delete the authentication source, do you want to continue? ',

View File

@ -1909,6 +1909,7 @@ export default {
add_file: "添加文件", add_file: "添加文件",
delimiter: "分隔符", delimiter: "分隔符",
format: "输出格式", format: "输出格式",
quoted_data: "是否允许带引号",
}, },
auth_source: { auth_source: {
delete_prompt: '此操作会删除认证源,是否继续?', delete_prompt: '此操作会删除认证源,是否继续?',

View File

@ -1909,6 +1909,7 @@ export default {
add_file: "添加文件", add_file: "添加文件",
delimiter: "分隔符", delimiter: "分隔符",
format: "輸出格式", format: "輸出格式",
quoted_data: "是否允许带引号",
}, },
auth_source: { auth_source: {
delete_prompt: '此操作會刪除認證源,是否繼續?', delete_prompt: '此操作會刪除認證源,是否繼續?',