Merge branch 'master' of https://github.com/metersphere/metersphere
This commit is contained in:
commit
12f6fa6c91
|
@ -0,0 +1,69 @@
|
|||
ALTER TABLE test_plan ADD api_ids varchar(1000) NULL COMMENT 'Api id list';
|
||||
ALTER TABLE test_plan ADD scenario_ids varchar(1000) NULL COMMENT 'Scenario id list';
|
||||
|
||||
CREATE TABLE `api_scenario` (
|
||||
`id` varchar(50) NOT NULL COMMENT 'Test ID',
|
||||
`project_id` varchar(50) NOT NULL COMMENT 'Project ID this test belongs to',
|
||||
`tag_id` varchar(800) DEFAULT NULL COMMENT 'tag id',
|
||||
`user_id` varchar(64) DEFAULT NULL COMMENT 'User ID',
|
||||
`api_scenario_module_id` varchar(64) DEFAULT NULL COMMENT 'User ID',
|
||||
`module_path` varchar(1000) DEFAULT NULL,
|
||||
`name` varchar(255) NOT NULL COMMENT 'api scenario name',
|
||||
`level` varchar(100) DEFAULT NULL COMMENT 'api scenario level ',
|
||||
`status` varchar(100) NOT NULL COMMENT 'api scenario status ',
|
||||
`principal` varchar(100) NOT NULL COMMENT 'api scenario principal ',
|
||||
`step_total` int(11) DEFAULT '0' COMMENT 'Step total ',
|
||||
`follow_people` varchar(100) DEFAULT NULL COMMENT 'api scenario Follow people ',
|
||||
`schedule` varchar(255) DEFAULT NULL COMMENT 'Test schedule (cron list)',
|
||||
`scenario_definition` longtext COMMENT 'Test scenario_definition json',
|
||||
`description` varchar(255) DEFAULT NULL COMMENT 'api scenario description',
|
||||
`create_time` bigint(13) NOT NULL COMMENT 'Create timestamp',
|
||||
`update_time` bigint(13) NOT NULL COMMENT 'Update timestamp',
|
||||
`pass_rate` varchar(100) DEFAULT NULL,
|
||||
`last_result` varchar(100) DEFAULT NULL,
|
||||
`report_id` varchar(50) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
|
||||
CREATE TABLE `api_scenario_module` (
|
||||
`id` varchar(50) NOT NULL COMMENT 'Test case node ID',
|
||||
`project_id` varchar(50) NOT NULL COMMENT 'Project ID this node belongs to',
|
||||
`name` varchar(64) NOT NULL COMMENT 'Node name',
|
||||
`parent_id` varchar(50) DEFAULT NULL COMMENT 'Parent node ID',
|
||||
`level` int(10) DEFAULT '1' COMMENT 'Node level',
|
||||
`create_time` bigint(13) NOT NULL COMMENT 'Create timestamp',
|
||||
`update_time` bigint(13) NOT NULL COMMENT 'Update timestamp',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
|
||||
CREATE TABLE `api_scenario_report` (
|
||||
`id` varchar(50) NOT NULL COMMENT 'Test report ID',
|
||||
`project_id` varchar(50) NOT NULL COMMENT 'scenario ID this test report belongs to',
|
||||
`name` varchar(64) NOT NULL COMMENT 'Test report name',
|
||||
`description` varchar(255) DEFAULT NULL COMMENT 'Test report name',
|
||||
`create_time` bigint(13) NOT NULL COMMENT 'Create timestamp',
|
||||
`update_time` bigint(13) NOT NULL COMMENT 'Update timestamp',
|
||||
`status` varchar(64) NOT NULL COMMENT 'Status of this test run',
|
||||
`user_id` varchar(64) DEFAULT NULL,
|
||||
`trigger_mode` varchar(64) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
CREATE TABLE `api_scenario_report_detail` (
|
||||
`report_id` varchar(64) NOT NULL COMMENT 'API Test Report ID',
|
||||
`project_id` varchar(64) NOT NULL COMMENT 'scenario ID',
|
||||
`content` longblob COMMENT 'Report Content',
|
||||
PRIMARY KEY (`report_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
CREATE TABLE `api_tag` (
|
||||
`id` varchar(50) NOT NULL COMMENT 'Test ID',
|
||||
`project_id` varchar(50) NOT NULL COMMENT 'Project ID this test belongs to',
|
||||
`name` varchar(200) NOT NULL COMMENT 'api tag',
|
||||
`user_id` varchar(64) DEFAULT NULL COMMENT 'User ID',
|
||||
`create_time` bigint(13) NOT NULL COMMENT 'Create timestamp',
|
||||
`update_time` bigint(13) NOT NULL COMMENT 'Update timestamp',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
|
@ -237,7 +237,7 @@
|
|||
|
||||
<!--接口列表-->
|
||||
<el-drawer :visible.sync="apiListVisible" :destroy-on-close="true" direction="ltr" :withHeader="false" :title="$t('api_test.automation.api_list_import')" :modal="false" size="90%">
|
||||
<ms-api-definition :visible="true" :currentRow="currentRow"/>
|
||||
<ms-api-definition :visible="visibleRef" :currentRow="currentRow"/>
|
||||
<el-button style="float: right;margin: 0px 20px 0px" type="primary" @click="copyApi('REF')">{{$t('api_test.scenario.reference')}}</el-button>
|
||||
<el-button style="float: right;" type="primary" @click="copyApi('Copy')">{{ $t('commons.copy') }}</el-button>
|
||||
</el-drawer>
|
||||
|
@ -348,6 +348,7 @@
|
|||
debugData: {},
|
||||
reportId: "",
|
||||
projectId: "",
|
||||
visibleRef: "",
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
@ -417,6 +418,7 @@
|
|||
this.reload();
|
||||
},
|
||||
apiListImport() {
|
||||
this.visibleRef = getUUID();
|
||||
this.apiListVisible = true;
|
||||
},
|
||||
recursiveSorting(arr) {
|
||||
|
|
|
@ -72,7 +72,7 @@
|
|||
<el-card style="margin-top: 5px">
|
||||
<el-row>
|
||||
<el-col :span="1">
|
||||
<el-checkbox v-if="visible" @change="caseChecked(item)"/>
|
||||
<el-checkbox v-model="item.checked" @change="caseChecked(item)"/>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<div class="el-step__icon is-text ms-api-col">
|
||||
|
@ -169,10 +169,8 @@
|
|||
api: {
|
||||
type: Object
|
||||
},
|
||||
createCase: String,
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
type: String,
|
||||
},
|
||||
loaded: Boolean,
|
||||
refreshSign: String,
|
||||
|
@ -202,7 +200,7 @@
|
|||
api() {
|
||||
this.getApiTest();
|
||||
},
|
||||
createCase() {
|
||||
visible() {
|
||||
this.getApiTest();
|
||||
}
|
||||
},
|
||||
|
@ -212,21 +210,6 @@
|
|||
this.getApiTest();
|
||||
},
|
||||
methods: {
|
||||
sysAddition() {
|
||||
let condition = {};
|
||||
condition.projectId = this.api.projectId;
|
||||
condition.apiDefinitionId = this.api.id;
|
||||
condition.priority = this.priorityValue;
|
||||
condition.name = this.name;
|
||||
this.$post("/api/testcase/list", condition, response => {
|
||||
for (let index in response.data) {
|
||||
let test = response.data[index];
|
||||
test.request = JSON.parse(test.request);
|
||||
}
|
||||
this.apiCaseList = response.data;
|
||||
this.addCase();
|
||||
});
|
||||
},
|
||||
getResult(data) {
|
||||
if (RESULT_MAP.get(data)) {
|
||||
return RESULT_MAP.get(data);
|
||||
|
@ -352,21 +335,27 @@
|
|||
return bodyUploadFiles;
|
||||
},
|
||||
getApiTest() {
|
||||
if (this.currentRow) {
|
||||
this.currentRow.cases = [];
|
||||
}
|
||||
let condition = {};
|
||||
condition.projectId = this.api.projectId;
|
||||
condition.apiDefinitionId = this.api.id;
|
||||
condition.priority = this.priorityValue;
|
||||
condition.name = this.name;
|
||||
this.$post("/api/testcase/list", condition, response => {
|
||||
for (let index in response.data) {
|
||||
let test = response.data[index];
|
||||
test.request = JSON.parse(test.request);
|
||||
if (this.api) {
|
||||
this.checkedCases = new Set();
|
||||
this.loading = true;
|
||||
if (this.currentRow) {
|
||||
this.currentRow.cases = [];
|
||||
}
|
||||
this.apiCaseList = response.data;
|
||||
});
|
||||
let condition = {};
|
||||
condition.projectId = this.projectId;
|
||||
condition.apiDefinitionId = this.api.id;
|
||||
condition.priority = this.priorityValue;
|
||||
condition.name = this.name;
|
||||
this.$post("/api/testcase/list", condition, response => {
|
||||
for (let index in response.data) {
|
||||
let test = response.data[index];
|
||||
test.checked = false;
|
||||
test.request = JSON.parse(test.request);
|
||||
}
|
||||
this.loading = false;
|
||||
this.apiCaseList = response.data;
|
||||
});
|
||||
}
|
||||
},
|
||||
validate(row) {
|
||||
if (!row.name) {
|
||||
|
@ -383,7 +372,7 @@
|
|||
});
|
||||
let hasEnvironment = false;
|
||||
for (let i in this.environments) {
|
||||
if (this.environments[i].id === this.api.environmentId) {
|
||||
if (this.api && this.environments[i].id === this.api.environmentId) {
|
||||
hasEnvironment = true;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -50,8 +50,7 @@
|
|||
},
|
||||
props: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
type: String,
|
||||
},
|
||||
currentRow: {
|
||||
type: Object,
|
||||
|
|
|
@ -142,8 +142,7 @@
|
|||
currentProtocol: String,
|
||||
currentModule: Object,
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
type: String,
|
||||
},
|
||||
currentRow: {
|
||||
type: Object,
|
||||
|
@ -161,6 +160,10 @@
|
|||
this.initApiTable();
|
||||
this.apiCaseClose();
|
||||
},
|
||||
visible() {
|
||||
this.initApiTable();
|
||||
this.apiCaseClose();
|
||||
},
|
||||
currentProtocol() {
|
||||
this.initApiTable();
|
||||
this.apiCaseClose();
|
||||
|
@ -321,8 +324,8 @@
|
|||
});
|
||||
},
|
||||
apiCaseClose() {
|
||||
this.selectApi = {};
|
||||
let h = window.screen.height;
|
||||
|
||||
let svgTop = document.getElementById("svgTop");
|
||||
svgTop.style.height = h - 200 + "px";
|
||||
|
||||
|
|
|
@ -25,6 +25,21 @@
|
|||
<pre>{{response.responseResult.vars}}</pre>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane :label="$t('api_report.request_body')" name="request_body" class="pane">
|
||||
<div>
|
||||
{{$t('api_test.request.address')}} : {{ response.url }}
|
||||
</div>
|
||||
<div>
|
||||
{{$t('api_test.scenario.headers')}} : {{ response.headers }}
|
||||
</div>
|
||||
<div>
|
||||
Cookies : {{response.cookies}}
|
||||
</div>
|
||||
<div>
|
||||
Body : {{response.body}}
|
||||
</div>
|
||||
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane v-if="activeName == 'body'" :disabled="true" name="mode" class="pane cookie">
|
||||
<template v-slot:label>
|
||||
|
|
Loading…
Reference in New Issue