fix(接口测试): 修复全局断言选择响应时间配置后添加不生效的缺陷

--bug=1024639 --user=王孝刚 github #22929 测试云环境,环境设置:全局断言选择响应时间配置后添加不生效
(1.20 存在,2.8正常) https://www.tapd.cn/55049933/s/1352989
This commit is contained in:
wxg0103 2023-03-20 17:09:29 +08:00 committed by wxg0103
parent 635754078e
commit 56ce900f48
7 changed files with 19 additions and 18 deletions

View File

@ -40,8 +40,8 @@ export default {
methods: {
add() {
if (this.validate()) {
this.duration.value = this.value;
this.duration.enable = true;
this.$set(this.duration, "value", this.value);
this.$set(this.duration, "enable", true);
this.callback();
}
},
@ -71,7 +71,7 @@ export default {
<style scoped>
.assertion-btn {
text-align: center;
width: 80px;
text-align: right;
width: 120px;
}
</style>

View File

@ -124,7 +124,7 @@ export default {
}
.assertion-btn {
text-align: center;
width: 80px;
text-align: right;
width: 120px;
}
</style>

View File

@ -115,7 +115,7 @@ export default {
}
.assertion-btn {
text-align: center;
width: 80px;
text-align: right;
width: 120px;
}
</style>

View File

@ -60,7 +60,7 @@ export default {
<style scoped>
.assertion-btn {
text-align: center;
width: 80px;
text-align: right;
width: 120px;
}
</style>

View File

@ -176,7 +176,7 @@ export default {
}
.assertion-remove-btn {
text-align: center;
width: 80px;
text-align: right;
width: 120px;
}
</style>

View File

@ -33,11 +33,10 @@ export default {
default: false
}
},
methods: {
add() {
let obj = new AssertionDocument({id: "root"});
if (this.document.type === "JSON" && this.document.data.json.length === 0) {
if (this.document.type === "JSON" || this.document.type === "json" && this.document.data.json.length === 0) {
this.document.data.json.push(obj);
}
if (this.document.type === "XML" && this.document.data.xml.length === 0) {

View File

@ -231,13 +231,14 @@ export default {
this.environment.config.authManager.hashTree = [];
}
if (!this.environment.config.assertions) {
this.$set(this.environment.config, "assertions", {});
this.environment.config.assertions = {
duration: {duration: 0},
duration: {value: 0},
regex: [],
jsonPath: [],
xpath2: [],
jsr223: [],
document: {type: "json", data: {json: [], xml: []}},
document: {type: "JSON", data: {json: [], xml: []}, enable: true},
};
}
},
@ -280,13 +281,14 @@ export default {
this.environment.config.authManager.hashTree = [];
}
if (!this.environment.config.assertions) {
this.$set(this.environment.config, "assertions", {});
this.environment.config.assertions = {
duration: {duration: 0},
duration: {value: 0},
regex: [],
jsonPath: [],
xpath2: [],
jsr223: [],
document: {type: "json", data: {json: [], xml: []}},
document: {type: "JSON", data: {json: [], xml: []}, enable: true},
};
}