fix(接口测试): 修复执行复制的场景,新增的接口拿不到场景变量的缺陷
--bug=1031752 --user=王孝刚 【接口测试】github#27044,接口自动化,复制的场景新增接口后,执行这个场景,新增接口无法拿到场景变量中的值 https://www.tapd.cn/55049933/s/1426644
This commit is contained in:
parent
6abf461f4f
commit
98a8ec1a29
|
@ -517,4 +517,8 @@ fieldset {
|
|||
.is-text {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
:deep(.el-tabs__nav-wrap) {
|
||||
width: calc(100% - 50px);
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -742,8 +742,4 @@ export default {
|
|||
font-size: 15px;
|
||||
color: #de9d1c;
|
||||
}
|
||||
|
||||
:deep(.el-tabs__nav-wrap) {
|
||||
width: calc(100% - 50px);
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -213,19 +213,20 @@ export default {
|
|||
// 合并自身依赖场景变量
|
||||
if (runScenario && runScenario.variableEnable && runScenario.variables) {
|
||||
if (variables) {
|
||||
// 同名合并
|
||||
runScenario.variables.forEach((data) => {
|
||||
variables.forEach((item) => {
|
||||
if (data.type === item.type && data.name === item.name) {
|
||||
Object.assign(data, item);
|
||||
runScenario.variables = [...runScenario.variables, ...variables].reduce((acc, cur) => {
|
||||
const index = acc.findIndex(item => item.name === cur.name && item.type === cur.type);
|
||||
if (index !== -1) {
|
||||
acc[index] = cur;
|
||||
} else {
|
||||
acc.push(cur);
|
||||
}
|
||||
});
|
||||
});
|
||||
return acc;
|
||||
}, []);
|
||||
}
|
||||
} else {
|
||||
runScenario.variables = variables;
|
||||
}
|
||||
|
||||
runScenario.id = this.currentScenario.id;
|
||||
runScenario.hashTree = [this.scenario];
|
||||
runScenario.stepScenario = true;
|
||||
this.$emit('runScenario', runScenario);
|
||||
|
|
Loading…
Reference in New Issue