{{$t("api_test.request.assertions.response_time")}}
@@ -31,6 +31,13 @@
props: {
assertions: Assertions
+ },
+
+ computed: {
+ isShow() {
+ let rt = this.assertions.responseTime;
+ return rt.responseInTime !== null && rt.responseInTime > 0;
+ }
}
}
diff --git a/frontend/src/business/components/api/test/components/ApiRequestConfig.vue b/frontend/src/business/components/api/test/components/ApiRequestConfig.vue
index 7e6f87a15d..b0eec2cbfa 100644
--- a/frontend/src/business/components/api/test/components/ApiRequestConfig.vue
+++ b/frontend/src/business/components/api/test/components/ApiRequestConfig.vue
@@ -80,10 +80,7 @@
},
created() {
- if (this.requests.length === 0) {
- this.createRequest();
- this.select(this.requests[0]);
- }
+ this.select(this.requests[0]);
}
}
diff --git a/frontend/src/business/components/api/test/components/ApiRequestForm.vue b/frontend/src/business/components/api/test/components/ApiRequestForm.vue
index 34b0791f57..3e200b564a 100644
--- a/frontend/src/business/components/api/test/components/ApiRequestForm.vue
+++ b/frontend/src/business/components/api/test/components/ApiRequestForm.vue
@@ -43,12 +43,13 @@
import MsApiKeyValue from "./ApiKeyValue";
import MsApiBody from "./ApiBody";
import MsApiAssertions from "./ApiAssertions";
+ import {Request} from "../model/ScenarioModel";
export default {
name: "MsApiRequestForm",
components: {MsApiAssertions, MsApiBody, MsApiKeyValue},
props: {
- request: Object
+ request: Request
},
data() {
diff --git a/frontend/src/business/components/api/test/components/ApiScenarioConfig.vue b/frontend/src/business/components/api/test/components/ApiScenarioConfig.vue
index 7b9d508e10..ca78d59c1c 100644
--- a/frontend/src/business/components/api/test/components/ApiScenarioConfig.vue
+++ b/frontend/src/business/components/api/test/components/ApiScenarioConfig.vue
@@ -6,7 +6,12 @@
- {{scenario.name}}
+
+ {{scenario.name}}
+
+ {{$t('api_test.scenario.config')}}
+
+
@@ -57,14 +62,13 @@
data() {
return {
activeName: 0,
- selected: Object
+ selected: [Scenario, Request]
}
},
methods: {
createScenario: function () {
- let scenario = new Scenario({name: "Scenario"});
- this.scenarios.push(scenario);
+ this.scenarios.push(new Scenario());
},
deleteScenario: function (index) {
this.scenarios.splice(index, 1);
@@ -85,6 +89,12 @@
},
select: function (obj) {
this.selected = obj;
+ },
+ reset: function () {
+ this.$nextTick(function () {
+ this.activeName = 0;
+ this.select(this.scenarios[0]);
+ });
}
},
@@ -98,10 +108,7 @@
},
created() {
- if (this.scenarios.length === 0) {
- this.createScenario();
- this.select(this.scenarios[0]);
- }
+ this.select(this.scenarios[0]);
}
}
@@ -131,6 +138,10 @@
width: 100%;
}
+ .scenario-name > #hint {
+ color: #8a8b8d;
+ }
+
.scenario-btn {
text-align: center;
padding: 13px;
diff --git a/frontend/src/business/components/api/test/components/ApiScenarioForm.vue b/frontend/src/business/components/api/test/components/ApiScenarioForm.vue
index 52c1d2769e..572a41cbe2 100644
--- a/frontend/src/business/components/api/test/components/ApiScenarioForm.vue
+++ b/frontend/src/business/components/api/test/components/ApiScenarioForm.vue
@@ -21,12 +21,13 @@