Merge remote-tracking branch 'origin/master'

This commit is contained in:
song.tianyang 2020-12-22 20:12:02 +08:00
commit 128f98849c
8 changed files with 32 additions and 25 deletions

View File

@ -41,13 +41,13 @@ public class ApiDefinitionExecResultService {
saveResult.setStartTime(item.getStartTime());
saveResult.setType(type);
saveResult.setEndTime(item.getResponseResult().getResponseTime());
saveResult.setStatus(item.getResponseResult().getResponseCode().equals("200") ? "success" : "error");
saveResult.setStatus(item.isSuccess() ? "success" : "error");
apiDefinitionExecResultMapper.insert(saveResult);
});
}
public void deleteByResourceId(String resourceId) {
ApiDefinitionExecResultExample example = new ApiDefinitionExecResultExample();
ApiDefinitionExecResultExample example = new ApiDefinitionExecResultExample();
example.createCriteria().andResourceIdEqualTo(resourceId);
apiDefinitionExecResultMapper.deleteByExample(example);
}
@ -64,10 +64,10 @@ public class ApiDefinitionExecResultService {
Date firstTime = startAndEndDateInWeek.get("firstTime");
Date lastTime = startAndEndDateInWeek.get("lastTime");
if(firstTime==null || lastTime == null){
return 0;
}else {
return extApiDefinitionExecResultMapper.countByProjectIDAndCreateInThisWeek(projectId,firstTime.getTime(),lastTime.getTime());
if (firstTime == null || lastTime == null) {
return 0;
} else {
return extApiDefinitionExecResultMapper.countByProjectIDAndCreateInThisWeek(projectId, firstTime.getTime(), lastTime.getTime());
}
}
@ -79,18 +79,18 @@ public class ApiDefinitionExecResultService {
public List<ExecutedCaseInfoResult> findFaliureCaseInfoByProjectIDAndLimitNumberInSevenDays(String projectId, int limitNumber) {
//获取7天之前的日期
Date startDay = DateUtils.dateSum(new Date(),-6);
Date startDay = DateUtils.dateSum(new Date(), -6);
//将日期转化为 00:00:00 的时间戳
Date startTime = null;
try{
try {
startTime = DateUtils.getDayStartTime(startDay);
}catch (Exception e){
} catch (Exception e) {
}
if(startTime==null){
return new ArrayList<>(0);
}else {
return extApiDefinitionExecResultMapper.findFaliureCaseInfoByProjectIDAndExecuteTimeAndLimitNumber(projectId,startTime.getTime(),limitNumber);
if (startTime == null) {
return new ArrayList<>(0);
} else {
return extApiDefinitionExecResultMapper.findFaliureCaseInfoByProjectIDAndExecuteTimeAndLimitNumber(projectId, startTime.getTime(), limitNumber);
}
}
}

View File

@ -129,9 +129,13 @@
if (response.data) {
Object.assign(this.request, JSON.parse(response.data.request));
this.request.name = response.data.name;
this.request.path = response.data.path;
this.request.method = response.data.method;
this.request.url = response.data.path;
if (response.data.path && response.data.path != null) {
this.request.path = response.data.path;
this.request.url = response.data.path;
}
if (response.data.method && response.data.method != null) {
this.request.method = response.data.method;
}
this.request.requestResult = requestResult;
this.request.id = response.data.id;
this.reload();

View File

@ -31,7 +31,7 @@
<el-col :span="20" class="script-content">
<ms-code-edit v-if="isCodeEditAlive" :mode="jsr223ProcessorData.scriptLanguage"
:read-only="isReadOnly"
:data.sync="jsr223ProcessorData.script" theme="eclipse" :modes="['java','python']"
:data.sync="jsr223ProcessorData.script" theme="eclipse" :modes="[]"
ref="codeEdit"/>
</el-col>
<el-col :span="4" class="script-index">
@ -94,10 +94,10 @@
],
isCodeEditAlive: true,
languages: [
'java', "python"
'beanshell', "python"
],
codeEditModeMap: {
beanshell: 'java',
beanshell: 'beanshell',
python: 'python'
}
}

View File

@ -1,5 +1,5 @@
<template>
<input-tag v-model="data"></input-tag>
<input-tag v-model="data" placeholder="输入回车添加"></input-tag>
</template>
<script>
@ -13,7 +13,6 @@
if (!this.currentScenario.tags) {
this.currentScenario.tags = [];
}
console.log(this.currentScenario.tags)
this.data = this.currentScenario.tags;
},
data() {

View File

@ -183,6 +183,8 @@
let bodyFiles = this.getBodyUploadFiles(row);
row.projectId = getCurrentProjectID();
row.active = true;
row.request.path = this.api.path;
row.request.method = this.api.method;
row.apiDefinitionId = row.apiDefinitionId || this.api.id;
let url = "/api/testcase/create";
if (row.id) {

View File

@ -7,7 +7,7 @@
<ms-environment-select v-if="isRelevanceModel" :project-id="relevanceProjectId" :is-read-only="isReadOnly" @setEnvironment="setEnvironment"/>
<el-input v-if="!isPlanModel" placeholder="搜索" @blur="search" class="search-input" size="small" v-model="condition.name"/>
<el-input v-if="!isPlanModel" placeholder="搜索" @blur="search" @keyup.enter.native="search" class="search-input" size="small" v-model="condition.name"/>
<template v-slot:header>
<test-plan-case-list-header

View File

@ -318,6 +318,7 @@
this.selectRows.clear();
this.initTable();
this.$success(this.$t('commons.delete_success'));
this.$refs.caseList.apiCaseClose();
});
}
}
@ -368,6 +369,7 @@
this.$post('/api/definition/removeToGc/', ids, () => {
this.$success(this.$t('commons.delete_success'));
this.initTable();
this.$refs.caseList.apiCaseClose();
});
}
}

View File

@ -30,7 +30,7 @@
<el-col :span="20" class="script-content">
<ms-code-edit v-if="isCodeEditAlive" :mode="jsr223ProcessorData.scriptLanguage"
:read-only="isReadOnly"
:data.sync="jsr223ProcessorData.script" theme="eclipse" :modes="['java','python']"
:data.sync="jsr223ProcessorData.script" theme="eclipse" :modes="[]"
ref="codeEdit"/>
</el-col>
<el-col :span="4" class="script-index">
@ -95,10 +95,10 @@
],
isCodeEditAlive: true,
languages: [
'java', "python"
'beanshell', "python"
],
codeEditModeMap: {
beanshell: 'java',
beanshell: 'beanshell',
python: 'python'
}
}