refactor(接口自动化): 调试时环境检查问题
--bug=1008520 --user=lyh 【github#6612】jmeter调试好的场景,有环境变量,导入MS还提示要选择场景变量。并且还识别不到HTTP请求头中的端口 https://www.tapd.cn/55049933/s/1077469
This commit is contained in:
parent
309ab806a6
commit
0c6dfef88d
|
@ -933,7 +933,7 @@ public class ApiAutomationService {
|
||||||
// 校验是否是全路径
|
// 校验是否是全路径
|
||||||
MsHTTPSamplerProxy httpSamplerProxy = (MsHTTPSamplerProxy) tr;
|
MsHTTPSamplerProxy httpSamplerProxy = (MsHTTPSamplerProxy) tr;
|
||||||
if (httpSamplerProxy.isEnable()) {
|
if (httpSamplerProxy.isEnable()) {
|
||||||
if (StringUtils.isBlank(httpSamplerProxy.getUrl()) || !ElementUtil.isURL(httpSamplerProxy.getUrl())) {
|
if (StringUtils.isBlank(httpSamplerProxy.getUrl()) || (httpSamplerProxy.getIsRefEnvironment() != null && httpSamplerProxy.getIsRefEnvironment())) {
|
||||||
env.setFullUrl(false);
|
env.setFullUrl(false);
|
||||||
env.getProjectIds().add(httpSamplerProxy.getProjectId());
|
env.getProjectIds().add(httpSamplerProxy.getProjectId());
|
||||||
}
|
}
|
||||||
|
|
|
@ -135,15 +135,23 @@ export default {
|
||||||
},
|
},
|
||||||
checkEnv(data) {
|
checkEnv(data) {
|
||||||
return new Promise((resolve => {
|
return new Promise((resolve => {
|
||||||
if (this.environmentType === ENV_TYPE.JSON) {
|
if (data) {
|
||||||
let res = this.$refs.envSelect.checkEnv(data);
|
// 所有请求全路径不检查环境
|
||||||
resolve(res);
|
resolve(true);
|
||||||
} else if (this.environmentType === ENV_TYPE.GROUP) {
|
} else {
|
||||||
let res = !this.hasOptionGroup ? this.$refs.envGroup.checkEnv() :
|
if (!this.environmentType) {
|
||||||
this.$refs.envOptionGroup.checkEnv();
|
this.$warning("请选择环境!");
|
||||||
res.then(r => {
|
resolve(false);
|
||||||
resolve(r);
|
} else if (this.environmentType === ENV_TYPE.JSON) {
|
||||||
})
|
let res = this.$refs.envSelect.checkEnv(data);
|
||||||
|
resolve(res);
|
||||||
|
} else if (this.environmentType === ENV_TYPE.GROUP) {
|
||||||
|
let res = !this.hasOptionGroup ? this.$refs.envGroup.checkEnv() :
|
||||||
|
this.$refs.envOptionGroup.checkEnv();
|
||||||
|
res.then(r => {
|
||||||
|
resolve(r);
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue