fix(接口测试): 引用场景被删除后子步骤禁用执行

--bug=1029088 --user=赵勇 【接口测试】场景详情-引用原场景被删除-单步骤调试引用场景下子步骤-一直测试中-无法停止 https://www.tapd.cn/55049933/s/1408973

Signed-off-by: fit2-zhao <yong.zhao@fit2cloud.com>
This commit is contained in:
fit2-zhao 2023-08-28 16:24:16 +08:00 committed by fit2-zhao
parent d1218645ea
commit 983faa8168
4 changed files with 34 additions and 27 deletions

View File

@ -89,7 +89,7 @@
<template v-slot:button v-if="!ifFromVariableAdvance">
<el-tooltip :content="$t('api_test.run')" placement="top" v-if="!request.testing">
<el-button
:disabled="!request.enable"
:disabled="!request.enable || request.deleted"
@click="run"
icon="el-icon-video-play"
class="ms-btn"

View File

@ -75,7 +75,7 @@
<template v-slot:button v-if="!ifFromVariableAdvance">
<el-tooltip :content="$t('api_test.run')" placement="top" v-if="!scenario.run">
<el-button
:disabled="!scenario.enable"
:disabled="stepDisabled()"
@click="run"
icon="el-icon-video-play"
style="padding: 5px"
@ -160,11 +160,13 @@ export default {
},
},
created() {
this.isShowNum = this.scenario.num ? true : false;
if (this.scenario.id && this.scenario.referenced === 'REF' && !this.scenario.loaded && this.scenario.hashTree) {
this.isShowNum = !!this.scenario.num;
if (
(this.scenario.id && this.scenario.referenced === 'REF' && !this.scenario.loaded && this.scenario.hashTree) ||
this.refStepDeleted
) {
this.scenario.disabled = true;
this.scenario.showExtend =
this.node.parent && this.node.parent.data && this.node.parent.data.disabled ? false : true;
this.scenario.showExtend = !(this.node.parent && this.node.parent.data && this.node.parent.data.disabled);
this.recursiveEnable(this.scenario.hashTree);
}
if (this.scenario.id && this.scenario.referenced === 'Copy' && !this.scenario.isCopy && !this.scenario.disabled) {
@ -191,8 +193,14 @@ export default {
isDeletedOrRef() {
return (this.scenario.referenced && this.scenario.referenced === 'Deleted') || this.scenario.referenced === 'REF';
},
refStepDeleted() {
return this.scenario.referenced === 'REF' && !this.isShowNum;
},
},
methods: {
stepDisabled() {
return !this.scenario.enable || this.refStepDeleted || this.scenario.deleted === 'Deleted';
},
run() {
if (!this.scenario.enable) {
this.$warning(this.$t('api_test.automation.debug_message'));
@ -283,6 +291,7 @@ export default {
for (let i in arr) {
arr[i].disabled = true;
arr[i].caseEnable = true;
arr[i].deleted = this.refStepDeleted;
if (arr[i].hashTree && arr[i].hashTree.length > 0) {
this.recursiveEnable(arr[i].hashTree);
}

View File

@ -63,7 +63,7 @@
<template v-slot:button>
<el-button
:disabled="!controller.enable"
:disabled="!controller.enable || controller.deleted"
:tip="$t('api_test.run')"
@click="conn"
icon="el-icon-video-play"
@ -75,7 +75,7 @@
<el-row>
<el-col :span="9">
<span class="ms-span ms-radio">{{ $t('loop.loops') }}</span>
<el-input size="small" v-model="controller.countController.loops" style="width: auto"/>
<el-input size="small" v-model="controller.countController.loops" style="width: auto" />
<span class="ms-span ms-radio"></span>
</el-col>
<el-col :span="9">
@ -91,13 +91,13 @@
<span class="ms-span ms-radio">ms</span>
</el-col>
<el-col :span="6">
<el-switch
:inactive-text="$t('loop.proceed')"
:disabled="controller.disabled"
v-model="controller.countController.proceed"
class="ms-span ms-radio"
style="margin-top: 6px"
@change="switchChange" />
<el-switch
:inactive-text="$t('loop.proceed')"
:disabled="controller.disabled"
v-model="controller.countController.proceed"
class="ms-span ms-radio"
style="margin-top: 6px"
@change="switchChange" />
</el-col>
</el-row>
</div>
@ -177,17 +177,13 @@
<span
class="ms-step-debug-code"
:class="'ms-req-error-report'"
v-if="
!loading && !node.data.testing && node.data.debug &&
node.data.code === 'FAKE_ERROR'
">
v-if="!loading && !node.data.testing && node.data.debug && node.data.code === 'FAKE_ERROR'">
FakeError
</span>
<span
class="ms-step-debug-code"
:class="node.data.code && node.data.code.toUpperCase() === 'ERROR' ? 'ms-req-error' : 'ms-req-success'"
v-if="!loading && !node.data.testing && node.data.debug &&
node.data.code !== 'FAKE_ERROR'">
v-if="!loading && !node.data.testing && node.data.debug && node.data.code !== 'FAKE_ERROR'">
{{ getCode() }}
</span>
</template>
@ -345,12 +341,14 @@ export default {
if (!this.node.data.code) {
this.node.data.code = 'SUCCESS';
}
if (this.node.data.code ==='SUCCESS' && data.status && data.status === 'SUCCESS') {
if (this.node.data.code === 'SUCCESS' && data.status && data.status === 'SUCCESS') {
this.node.data.code = 'SUCCESS';
}
if ((this.node.data.code ==='SUCCESS' ||
this.node.data.code === 'FAKE_ERROR') &&
data.status && data.status === 'FAKE_ERROR') {
if (
(this.node.data.code === 'SUCCESS' || this.node.data.code === 'FAKE_ERROR') &&
data.status &&
data.status === 'FAKE_ERROR'
) {
this.node.data.code = 'FAKE_ERROR';
}
if (data.status && data.status === 'ERROR') {
@ -513,7 +511,7 @@ export default {
font-size: 13px;
font-weight: normal;
}
:deep(.el-switch__label *){
:deep(.el-switch__label *) {
color: #606266;
font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', Arial, sans-serif;
font-size: 13px;

View File

@ -105,7 +105,7 @@
<template v-slot:button v-if="allSampler.indexOf(request.type) !== -1">
<el-tooltip :content="$t('api_test.run')" placement="top" v-if="!loading">
<el-button
:disabled="!request.enable"
:disabled="!request.enable || request.deleted"
@click="run"
icon="el-icon-video-play"
style="padding: 5px"