+
{{ $t('loop.loops') }}
@@ -40,7 +41,7 @@
-
+
@@ -58,7 +59,7 @@
-
+
@@ -95,7 +96,6 @@ export default {
components: {ApiBaseComponent, ApiResponseComponent, MsRun},
props: {
controller: {},
- currentEnvironmentId: String,
currentScenario: {},
node: {},
message: String,
@@ -254,11 +254,16 @@ export default {
this.$warning("当前循环下没有请求,不能执行");
return;
}
- if(!this.controller.enable){
+ if (!this.controller.enable) {
this.$warning(this.$t('api_test.automation.debug_message'));
return;
}
this.loading = true;
+ let currentEnvironmentId;
+ if (this.$store.state.scenarioEnvMap && this.$store.state.scenarioEnvMap instanceof Map
+ && this.$store.state.scenarioEnvMap.has((this.currentScenario.id + "_" + this.controller.projectId))) {
+ currentEnvironmentId = this.$store.state.scenarioEnvMap.get((this.currentScenario.id + "_" + this.controller.projectId));
+ }
this.debugData = {
id: this.currentScenario.id,
name: this.currentScenario.name,
@@ -267,7 +272,7 @@ export default {
headers: this.currentScenario.headers,
referenced: "Created",
enableCookieShare: this.enableCookieShare,
- environmentId: this.currentEnvironmentId,
+ environmentId: currentEnvironmentId,
hashTree: [this.controller],
};
if (this.node && this.node.data) {
@@ -307,6 +312,9 @@ export default {
runRefresh() {
this.initMessageSocket();
},
+ errorRefresh() {
+ this.loading = false;
+ },
setResult(hashTree) {
if (hashTree) {
hashTree.forEach((item) => {
diff --git a/frontend/src/business/components/api/automation/scenario/component/PluginComponent.vue b/frontend/src/business/components/api/automation/scenario/component/PluginComponent.vue
index fc84e38ea4..167a08b7d0 100644
--- a/frontend/src/business/components/api/automation/scenario/component/PluginComponent.vue
+++ b/frontend/src/business/components/api/automation/scenario/component/PluginComponent.vue
@@ -43,7 +43,7 @@
{{ request.preSize }}
-
+
@@ -52,7 +52,7 @@
{{ request.postSize }}
-
+
@@ -62,7 +62,7 @@
-
+
@@ -302,30 +302,20 @@ export default {
}
},
run() {
- if (this.isApiImport || this.request.isRefEnvironment) {
- if (this.request.type && (this.request.type === "HTTPSamplerProxy" || this.request.type === "JDBCSampler" || this.request.type === "TCPSampler")) {
- if (!this.envMap || this.envMap.size === 0) {
- this.$warning(this.$t('api_test.automation.env_message'));
- return false;
- } else if (this.envMap && this.envMap.size > 0) {
- const env = this.envMap.get(this.request.projectId);
- if (!env) {
- this.$warning(this.$t('api_test.automation.env_message'));
- return false;
- }
- }
- }
- }
this.request.debug = true;
this.loading = true;
this.runData = [];
this.runData.projectId = this.request.projectId;
- this.request.useEnvironment = this.currentEnvironmentId;
this.request.customizeReq = this.isCustomizeReq;
+ let currentEnvironmentId;
+ if (this.$store.state.scenarioEnvMap && this.$store.state.scenarioEnvMap instanceof Map
+ && this.$store.state.scenarioEnvMap.has((this.currentScenario.id + "_" + this.request.projectId))) {
+ currentEnvironmentId = this.$store.state.scenarioEnvMap.get((this.currentScenario.id + "_" + this.request.projectId));
+ }
let debugData = {
id: this.currentScenario.id, name: this.currentScenario.name, type: "scenario",
variables: this.currentScenario.variables, referenced: 'Created', headers: this.currentScenario.headers,
- enableCookieShare: this.enableCookieShare, environmentId: this.currentEnvironmentId, hashTree: [this.request],
+ enableCookieShare: this.enableCookieShare, environmentId: currentEnvironmentId, hashTree: [this.request],
};
this.runData.push(debugData);
this.request.requestResult = [];
diff --git a/frontend/src/business/components/api/automation/scenario/maximize/MaximizeScenario.vue b/frontend/src/business/components/api/automation/scenario/maximize/MaximizeScenario.vue
index d585c43d0c..f0ba2ff706 100644
--- a/frontend/src/business/components/api/automation/scenario/maximize/MaximizeScenario.vue
+++ b/frontend/src/business/components/api/automation/scenario/maximize/MaximizeScenario.vue
@@ -98,7 +98,6 @@
:scenario="data"
:response="response"
:currentScenario="currentScenario"
- :currentEnvironmentId="currentEnvironmentId"
:node="node"
:project-list="projectList"
:env-map="projectEnvMap"
@@ -146,7 +145,6 @@
:scenario="selectedTreeNode"
:response="response"
:currentScenario="currentScenario"
- :currentEnvironmentId="currentEnvironmentId"
:node="selectedNode"
:project-list="projectList"
:env-map="projectEnvMap"
@@ -165,7 +163,6 @@
:scenario="item"
:response="response"
:currentScenario="currentScenario"
- :currentEnvironmentId="currentEnvironmentId"
:project-list="projectList"
:env-map="projectEnvMap"
:draggable="false"
@@ -287,7 +284,6 @@ export default {
},
environments: [],
projectEnvMap: Map,
- currentEnvironmentId: "",
maintainerOptions: [],
value: API_STATUS[0].id,
options: API_STATUS,
@@ -696,16 +692,6 @@ export default {
this.environments.forEach(environment => {
parseEnvironment(environment);
});
- let hasEnvironment = false;
- for (let i in this.environments) {
- if (this.environments[i].id === this.currentEnvironmentId) {
- hasEnvironment = true;
- break;
- }
- }
- if (!hasEnvironment) {
- this.currentEnvironmentId = '';
- }
//检查场景是否需要先进行保存
this.checkDataIsCopy();
});
diff --git a/frontend/src/business/components/api/definition/components/request/database/BasisParameters.vue b/frontend/src/business/components/api/definition/components/request/database/BasisParameters.vue
index 9cfedd4b60..5dc3abf04b 100644
--- a/frontend/src/business/components/api/definition/components/request/database/BasisParameters.vue
+++ b/frontend/src/business/components/api/definition/components/request/database/BasisParameters.vue
@@ -41,7 +41,7 @@
{{ $t('api_test.request.refer_to_environment') }}
@@ -73,7 +73,7 @@
{{ request.preSize }}
-