diff --git a/frontend/src/business/components/api/test/ApiTestConfig.vue b/frontend/src/business/components/api/test/ApiTestConfig.vue index 4c981189f43fbafa51e33d410b19b3f8ec028488..f3581e31f94beea7601e14be111f4d91861f87f4 100644 --- a/frontend/src/business/components/api/test/ApiTestConfig.vue +++ b/frontend/src/business/components/api/test/ApiTestConfig.vue @@ -16,9 +16,13 @@ {{$t('commons.save')}} - + {{$t('load_test.save_and_run')}} + + + {{$t('api_test.run')}} + {{$t('commons.cancel')}} @@ -91,29 +95,31 @@ } }); }, - saveTest: function () { - this.save(() => { - this.$success(this.$t('commons.save_success')); - }) - }, save: function (callback) { this.change = false; let url = this.create ? "/api/create" : "/api/update"; - this.result = this.$request(this.getOptions(url), response => { + this.result = this.$request(this.getOptions(url), () => { this.create = false; if (callback) callback(); }); }, + saveTest: function () { + this.save(() => { + this.$success(this.$t('commons.save_success')); + }) + }, runTest: function () { + this.result = this.$post("/api/run", {id: this.test.id}, () => { + this.$success(this.$t('api_test.running')); + }); + }, + saveRunTest: function () { this.change = false; this.save(() => { this.$success(this.$t('commons.save_success')); - this.result = this.$post("/api/run", {id: this.test.id}, response => { - this.$success(this.$t('api_test.running')); - }); + this.runTest(); }) - }, cancel: function () { this.$router.push('/api/test/list/all'); diff --git a/frontend/src/business/components/api/test/components/ApiScenarioConfig.vue b/frontend/src/business/components/api/test/components/ApiScenarioConfig.vue index 149b18264accd5057d0812685613fb2f9bace5bf..76b4d241fd6e1501bdd252840945a7eb257f7478 100644 --- a/frontend/src/business/components/api/test/components/ApiScenarioConfig.vue +++ b/frontend/src/business/components/api/test/components/ApiScenarioConfig.vue @@ -12,20 +12,20 @@ {{$t('api_test.scenario.config')}} - - - - - - - + + + + + + + - - + + @@ -90,9 +90,13 @@ } }, select: function (obj) { - this.selected = obj; + this.selected = null; + this.$nextTick(function () { + this.selected = obj; + }); }, reset: function () { + this.selected = null; this.$nextTick(function () { this.activeName = 0; this.select(this.scenarios[0]); diff --git a/frontend/src/common/js/message.js b/frontend/src/common/js/message.js index cb3d2fa2a844bfc47ab6d78f9957f79632acfc34..0b88ec7ed8b963b75124300ca068c1b7a130c0af 100644 --- a/frontend/src/common/js/message.js +++ b/frontend/src/common/js/message.js @@ -12,7 +12,7 @@ export default { message: message, type: "success", showClose: true, - duration: 1000 + duration: 1500 }) }; @@ -30,7 +30,7 @@ export default { message: message, type: "warning", showClose: true, - duration: 2000 + duration: 5000 }) }; diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index eda4519f39a74e2a1c3d1f867cd25c8e3c6a6e0f..b52c9cc38873f3a33a7163ad0a2f88ba9542c813 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -187,6 +187,7 @@ export default { }, api_test: { save_and_run: "保存并执行", + run: "执行", running: "正在执行", reset: "重置", input_name: "请输入测试名称",