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;
|
||||
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.getProjectIds().add(httpSamplerProxy.getProjectId());
|
||||
}
|
||||
|
|
|
@ -135,15 +135,23 @@ export default {
|
|||
},
|
||||
checkEnv(data) {
|
||||
return new Promise((resolve => {
|
||||
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);
|
||||
})
|
||||
if (data) {
|
||||
// 所有请求全路径不检查环境
|
||||
resolve(true);
|
||||
} else {
|
||||
if (!this.environmentType) {
|
||||
this.$warning("请选择环境!");
|
||||
resolve(false);
|
||||
} 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