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:
parent
d1218645ea
commit
983faa8168
|
@ -89,7 +89,7 @@
|
||||||
<template v-slot:button v-if="!ifFromVariableAdvance">
|
<template v-slot:button v-if="!ifFromVariableAdvance">
|
||||||
<el-tooltip :content="$t('api_test.run')" placement="top" v-if="!request.testing">
|
<el-tooltip :content="$t('api_test.run')" placement="top" v-if="!request.testing">
|
||||||
<el-button
|
<el-button
|
||||||
:disabled="!request.enable"
|
:disabled="!request.enable || request.deleted"
|
||||||
@click="run"
|
@click="run"
|
||||||
icon="el-icon-video-play"
|
icon="el-icon-video-play"
|
||||||
class="ms-btn"
|
class="ms-btn"
|
||||||
|
|
|
@ -75,7 +75,7 @@
|
||||||
<template v-slot:button v-if="!ifFromVariableAdvance">
|
<template v-slot:button v-if="!ifFromVariableAdvance">
|
||||||
<el-tooltip :content="$t('api_test.run')" placement="top" v-if="!scenario.run">
|
<el-tooltip :content="$t('api_test.run')" placement="top" v-if="!scenario.run">
|
||||||
<el-button
|
<el-button
|
||||||
:disabled="!scenario.enable"
|
:disabled="stepDisabled()"
|
||||||
@click="run"
|
@click="run"
|
||||||
icon="el-icon-video-play"
|
icon="el-icon-video-play"
|
||||||
style="padding: 5px"
|
style="padding: 5px"
|
||||||
|
@ -160,11 +160,13 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.isShowNum = this.scenario.num ? true : false;
|
this.isShowNum = !!this.scenario.num;
|
||||||
if (this.scenario.id && this.scenario.referenced === 'REF' && !this.scenario.loaded && this.scenario.hashTree) {
|
if (
|
||||||
|
(this.scenario.id && this.scenario.referenced === 'REF' && !this.scenario.loaded && this.scenario.hashTree) ||
|
||||||
|
this.refStepDeleted
|
||||||
|
) {
|
||||||
this.scenario.disabled = true;
|
this.scenario.disabled = true;
|
||||||
this.scenario.showExtend =
|
this.scenario.showExtend = !(this.node.parent && this.node.parent.data && this.node.parent.data.disabled);
|
||||||
this.node.parent && this.node.parent.data && this.node.parent.data.disabled ? false : true;
|
|
||||||
this.recursiveEnable(this.scenario.hashTree);
|
this.recursiveEnable(this.scenario.hashTree);
|
||||||
}
|
}
|
||||||
if (this.scenario.id && this.scenario.referenced === 'Copy' && !this.scenario.isCopy && !this.scenario.disabled) {
|
if (this.scenario.id && this.scenario.referenced === 'Copy' && !this.scenario.isCopy && !this.scenario.disabled) {
|
||||||
|
@ -191,8 +193,14 @@ export default {
|
||||||
isDeletedOrRef() {
|
isDeletedOrRef() {
|
||||||
return (this.scenario.referenced && this.scenario.referenced === 'Deleted') || this.scenario.referenced === 'REF';
|
return (this.scenario.referenced && this.scenario.referenced === 'Deleted') || this.scenario.referenced === 'REF';
|
||||||
},
|
},
|
||||||
|
refStepDeleted() {
|
||||||
|
return this.scenario.referenced === 'REF' && !this.isShowNum;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
stepDisabled() {
|
||||||
|
return !this.scenario.enable || this.refStepDeleted || this.scenario.deleted === 'Deleted';
|
||||||
|
},
|
||||||
run() {
|
run() {
|
||||||
if (!this.scenario.enable) {
|
if (!this.scenario.enable) {
|
||||||
this.$warning(this.$t('api_test.automation.debug_message'));
|
this.$warning(this.$t('api_test.automation.debug_message'));
|
||||||
|
@ -283,6 +291,7 @@ export default {
|
||||||
for (let i in arr) {
|
for (let i in arr) {
|
||||||
arr[i].disabled = true;
|
arr[i].disabled = true;
|
||||||
arr[i].caseEnable = true;
|
arr[i].caseEnable = true;
|
||||||
|
arr[i].deleted = this.refStepDeleted;
|
||||||
if (arr[i].hashTree && arr[i].hashTree.length > 0) {
|
if (arr[i].hashTree && arr[i].hashTree.length > 0) {
|
||||||
this.recursiveEnable(arr[i].hashTree);
|
this.recursiveEnable(arr[i].hashTree);
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,7 @@
|
||||||
|
|
||||||
<template v-slot:button>
|
<template v-slot:button>
|
||||||
<el-button
|
<el-button
|
||||||
:disabled="!controller.enable"
|
:disabled="!controller.enable || controller.deleted"
|
||||||
:tip="$t('api_test.run')"
|
:tip="$t('api_test.run')"
|
||||||
@click="conn"
|
@click="conn"
|
||||||
icon="el-icon-video-play"
|
icon="el-icon-video-play"
|
||||||
|
@ -177,17 +177,13 @@
|
||||||
<span
|
<span
|
||||||
class="ms-step-debug-code"
|
class="ms-step-debug-code"
|
||||||
:class="'ms-req-error-report'"
|
:class="'ms-req-error-report'"
|
||||||
v-if="
|
v-if="!loading && !node.data.testing && node.data.debug && node.data.code === 'FAKE_ERROR'">
|
||||||
!loading && !node.data.testing && node.data.debug &&
|
|
||||||
node.data.code === 'FAKE_ERROR'
|
|
||||||
">
|
|
||||||
FakeError
|
FakeError
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
class="ms-step-debug-code"
|
class="ms-step-debug-code"
|
||||||
:class="node.data.code && node.data.code.toUpperCase() === 'ERROR' ? 'ms-req-error' : 'ms-req-success'"
|
:class="node.data.code && node.data.code.toUpperCase() === 'ERROR' ? 'ms-req-error' : 'ms-req-success'"
|
||||||
v-if="!loading && !node.data.testing && node.data.debug &&
|
v-if="!loading && !node.data.testing && node.data.debug && node.data.code !== 'FAKE_ERROR'">
|
||||||
node.data.code !== 'FAKE_ERROR'">
|
|
||||||
{{ getCode() }}
|
{{ getCode() }}
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
|
@ -348,9 +344,11 @@ export default {
|
||||||
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';
|
this.node.data.code = 'SUCCESS';
|
||||||
}
|
}
|
||||||
if ((this.node.data.code ==='SUCCESS' ||
|
if (
|
||||||
this.node.data.code === 'FAKE_ERROR') &&
|
(this.node.data.code === 'SUCCESS' || this.node.data.code === 'FAKE_ERROR') &&
|
||||||
data.status && data.status === 'FAKE_ERROR') {
|
data.status &&
|
||||||
|
data.status === 'FAKE_ERROR'
|
||||||
|
) {
|
||||||
this.node.data.code = 'FAKE_ERROR';
|
this.node.data.code = 'FAKE_ERROR';
|
||||||
}
|
}
|
||||||
if (data.status && data.status === 'ERROR') {
|
if (data.status && data.status === 'ERROR') {
|
||||||
|
|
|
@ -105,7 +105,7 @@
|
||||||
<template v-slot:button v-if="allSampler.indexOf(request.type) !== -1">
|
<template v-slot:button v-if="allSampler.indexOf(request.type) !== -1">
|
||||||
<el-tooltip :content="$t('api_test.run')" placement="top" v-if="!loading">
|
<el-tooltip :content="$t('api_test.run')" placement="top" v-if="!loading">
|
||||||
<el-button
|
<el-button
|
||||||
:disabled="!request.enable"
|
:disabled="!request.enable || request.deleted"
|
||||||
@click="run"
|
@click="run"
|
||||||
icon="el-icon-video-play"
|
icon="el-icon-video-play"
|
||||||
style="padding: 5px"
|
style="padding: 5px"
|
||||||
|
|
Loading…
Reference in New Issue