Merge branch 'master' of https://github.com/metersphere/metersphere
This commit is contained in:
commit
2d5982aac6
|
@ -6,11 +6,11 @@ ARG MS_VERSION=dev
|
|||
|
||||
RUN mkdir -p /opt/apps && mkdir -p /opt/jmeter
|
||||
|
||||
ADD backend/target/backend-1.3.jar /opt/apps
|
||||
ADD backend/target/backend-1.4.jar /opt/apps
|
||||
|
||||
ADD backend/target/classes/jmeter/ /opt/jmeter/
|
||||
|
||||
ENV JAVA_APP_JAR=/opt/apps/backend-1.3.jar
|
||||
ENV JAVA_APP_JAR=/opt/apps/backend-1.4.jar
|
||||
|
||||
ENV AB_OFF=true
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<artifactId>metersphere-server</artifactId>
|
||||
<groupId>io.metersphere</groupId>
|
||||
<version>1.3</version>
|
||||
<version>1.4</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
|
|
@ -100,6 +100,7 @@
|
|||
parameterType="io.metersphere.track.request.testcase.QueryTestPlanRequest">
|
||||
select test_plan.*, user.name as user_name from test_plan
|
||||
LEFT JOIN user ON user.id = test_plan.principal
|
||||
JOIN test_plan_project on test_plan.id = test_plan_id JOIN project on project.id = project_id
|
||||
<where>
|
||||
<if test="request.combine != null">
|
||||
<include refid="combine">
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
alter table message_task
|
||||
add identification varchar(255) not null;
|
||||
alter table message_task
|
||||
add result boolean not null;
|
||||
alter table message_task change result is_Set tinyint(1) not null;
|
||||
ALTER TABLE message_task
|
||||
ADD identification varchar(255) NOT NULL;
|
||||
ALTER TABLE message_task
|
||||
ADD is_set tinyint(1) NOT NULL;
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<artifactId>metersphere-server</artifactId>
|
||||
<groupId>io.metersphere</groupId>
|
||||
<version>1.3</version>
|
||||
<version>1.4</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
|
|
@ -58,10 +58,11 @@
|
|||
this.httpConfig.domain = decodeURIComponent(url.hostname);
|
||||
|
||||
this.httpConfig.port = url.port;
|
||||
let path = url.pathname === '/' ? '' : url.pathname;
|
||||
if (url.port) {
|
||||
this.httpConfig.socket = this.httpConfig.domain + ':' + url.port + url.pathname;
|
||||
this.httpConfig.socket = this.httpConfig.domain + ':' + url.port + path;
|
||||
} else {
|
||||
this.httpConfig.socket = this.httpConfig.domain + url.pathname;
|
||||
this.httpConfig.socket = this.httpConfig.domain + path;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<el-form-item :label="$t('commons.name')" prop="name">
|
||||
<el-input size="small" v-model="currentConfig.name" clearable show-word-limit/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('commons.project')" prop="description">
|
||||
<el-form-item :label="$t('commons.description')" prop="description">
|
||||
<el-input :disabled="readOnly" v-model="currentConfig.description"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 2, maxRows: 4}"
|
||||
|
|
|
@ -152,7 +152,7 @@ export class Test extends BaseConfig {
|
|||
constructor(options) {
|
||||
super();
|
||||
this.type = "MS API CONFIG";
|
||||
this.version = '1.3.0';
|
||||
this.version = '1.4.0';
|
||||
this.id = uuid();
|
||||
this.name = undefined;
|
||||
this.projectId = undefined;
|
||||
|
|
|
@ -166,6 +166,7 @@ export default {
|
|||
let data = response.data;
|
||||
this.total = data.itemCount;
|
||||
this.tableData = data.listObject;
|
||||
this.selectRows = new Set();
|
||||
});
|
||||
},
|
||||
search(combine) {
|
||||
|
|
|
@ -0,0 +1,118 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-row type="flex" justify="center">
|
||||
<el-col>
|
||||
<el-table class="basic-config" :data="tableData">
|
||||
<el-table-column
|
||||
prop="name"
|
||||
:label="$t('load_test.file_name')">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="size"
|
||||
:label="$t('load_test.file_size')">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="type"
|
||||
:label="$t('load_test.file_type')">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:label="$t('test_track.case.upload_time')">
|
||||
<template v-slot:default="scope">
|
||||
<i class="el-icon-time"/>
|
||||
<span class="last-modified">{{ scope.row.updateTime | timestampFormatDate }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:label="$t('commons.operating')">
|
||||
<template v-slot:default="scope">
|
||||
<el-button @click="preview(scope.row)" :disabled="!scope.row.id || readOnly" type="primary"
|
||||
v-if="isPreview(scope.row)"
|
||||
icon="el-icon-view"
|
||||
size="mini" circle/>
|
||||
<el-button @click="handleDownload(scope.row)" :disabled="!scope.row.id || readOnly" type="primary"
|
||||
icon="el-icon-download"
|
||||
size="mini" circle/>
|
||||
<el-button :disabled="readOnly || !isDelete" @click="handleDelete(scope.row, scope.$index)" type="danger"
|
||||
icon="el-icon-delete" size="mini"
|
||||
circle/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<test-case-file ref="testCaseFile"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TestCaseFile from "@/business/components/track/case/components/TestCaseFile";
|
||||
import {Message} from "element-ui";
|
||||
|
||||
export default {
|
||||
name: "TestCaseAttachment",
|
||||
components: {TestCaseFile},
|
||||
props: {
|
||||
tableData: Array,
|
||||
readOnly: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
isDelete: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
preview(row) {
|
||||
this.$refs.testCaseFile.open(row);
|
||||
},
|
||||
isPreview(row) {
|
||||
const fileType = row.type;
|
||||
return fileType === 'JPG' || fileType === 'JPEG' || fileType === 'PDF' || fileType === 'PNG';
|
||||
},
|
||||
handleDownload(file) {
|
||||
let data = {
|
||||
name: file.name,
|
||||
id: file.id,
|
||||
};
|
||||
let config = {
|
||||
url: '/test/case/file/download',
|
||||
method: 'post',
|
||||
data: data,
|
||||
responseType: 'blob'
|
||||
};
|
||||
this.result = this.$request(config).then(response => {
|
||||
const content = response.data;
|
||||
const blob = new Blob([content]);
|
||||
if ("download" in document.createElement("a")) {
|
||||
// 非IE下载
|
||||
// chrome/firefox
|
||||
let aTag = document.createElement('a');
|
||||
aTag.download = file.name;
|
||||
aTag.href = URL.createObjectURL(blob);
|
||||
aTag.click();
|
||||
URL.revokeObjectURL(aTag.href)
|
||||
} else {
|
||||
// IE10+下载
|
||||
navigator.msSaveBlob(blob, this.filename)
|
||||
}
|
||||
}).catch(e => {
|
||||
Message.error({message: e.message, showClose: true});
|
||||
});
|
||||
},
|
||||
handleDelete(file, index) {
|
||||
this.$emit("handleDelete", file, index);
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
|
@ -226,47 +226,15 @@
|
|||
<span slot="tip" class="el-upload__tip"> {{ $t('test_track.case.upload_tip') }} </span>
|
||||
</el-upload>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center">
|
||||
<el-col :span="20">
|
||||
<el-table class="basic-config" :data="tableData">
|
||||
<el-table-column
|
||||
prop="name"
|
||||
:label="$t('load_test.file_name')">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="size"
|
||||
:label="$t('load_test.file_size')">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="type"
|
||||
:label="$t('load_test.file_type')">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:label="$t('test_track.case.upload_time')">
|
||||
<template v-slot:default="scope">
|
||||
<i class="el-icon-time"/>
|
||||
<span class="last-modified">{{ scope.row.updateTime | timestampFormatDate }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:label="$t('commons.operating')">
|
||||
<template v-slot:default="scope">
|
||||
<el-button @click="preview(scope.row)" :disabled="!scope.row.id || readOnly" type="primary"
|
||||
v-if="isPreview(scope.row)"
|
||||
icon="el-icon-view"
|
||||
size="mini" circle/>
|
||||
<el-button @click="handleDownload(scope.row)" :disabled="!scope.row.id || readOnly" type="primary"
|
||||
icon="el-icon-download"
|
||||
size="mini" circle/>
|
||||
<el-button :disabled="readOnly" @click="handleDelete(scope.row, scope.$index)" type="danger"
|
||||
icon="el-icon-delete" size="mini"
|
||||
circle/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-col :offset="2" :span="20">
|
||||
<test-case-attachment :table-data="tableData"
|
||||
:read-only="readOnly"
|
||||
:is-delete="true"
|
||||
@handleDelete="handleDelete"
|
||||
/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
|
||||
<template v-slot:footer>
|
||||
|
@ -281,7 +249,6 @@
|
|||
|
||||
</el-dialog>
|
||||
|
||||
<test-case-file ref="testCaseFile"/>
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -294,11 +261,11 @@ import MsDialogFooter from '../../../common/components/MsDialogFooter'
|
|||
import {listenGoBack, removeGoBackListener} from "../../../../../common/js/utils";
|
||||
import {LIST_CHANGE, TrackEvent} from "@/business/components/common/head/ListEvent";
|
||||
import {Message} from "element-ui";
|
||||
import TestCaseFile from "@/business/components/track/case/components/TestCaseFile";
|
||||
import TestCaseAttachment from "@/business/components/track/case/components/TestCaseAttachment";
|
||||
|
||||
export default {
|
||||
name: "TestCaseEdit",
|
||||
components: {MsDialogFooter, TestCaseFile},
|
||||
components: {MsDialogFooter, TestCaseAttachment},
|
||||
data() {
|
||||
return {
|
||||
result: {},
|
||||
|
@ -723,13 +690,6 @@ export default {
|
|||
fileValidator(file) {
|
||||
/// todo: 是否需要对文件内容和大小做限制
|
||||
return file.size > 0;
|
||||
},
|
||||
preview(row) {
|
||||
this.$refs.testCaseFile.open(row);
|
||||
},
|
||||
isPreview(row) {
|
||||
const fileType = row.type;
|
||||
return fileType === 'JPG' || fileType === 'JPEG' || fileType === 'PDF' || fileType === 'PNG';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<el-dialog :visible.sync="dialogVisible" width="80%" :destroy-on-close="true" :before-close="close">
|
||||
<el-dialog :visible.sync="dialogVisible" width="80%" :destroy-on-close="true" :before-close="close" :append-to-body="true">
|
||||
<div>
|
||||
<img :src="'/test/case/file/preview/' + file.id" :alt="$t('test_track.case.img_loading_fail')" style="width: 100%;height: 100%;"
|
||||
v-if="file.type === 'JPG' || file.type === 'JPEG' || file.type === 'PNG'">
|
||||
|
|
|
@ -299,6 +299,21 @@
|
|||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="15" :offset="1">
|
||||
<div>
|
||||
<span class="cast_label">{{ $t('test_track.case.attachment') }}:</span>
|
||||
</div>
|
||||
<div>
|
||||
<test-case-attachment :table-data="tableData"
|
||||
:read-only="isReadOnly"
|
||||
:is-delete="false"
|
||||
@handleDelete="handleDelete"
|
||||
/>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
</el-scrollbar>
|
||||
|
@ -320,6 +335,7 @@ import ApiTestResult from "./test/ApiTestResult";
|
|||
import PerformanceTestDetail from "./test/PerformanceTestDetail";
|
||||
import PerformanceTestResult from "./test/PerformanceTestResult";
|
||||
import {listenGoBack, removeGoBackListener} from "@/common/js/utils";
|
||||
import TestCaseAttachment from "@/business/components/track/case/components/TestCaseAttachment";
|
||||
|
||||
export default {
|
||||
name: "TestPlanTestCaseEdit",
|
||||
|
@ -328,7 +344,8 @@ export default {
|
|||
PerformanceTestDetail,
|
||||
ApiTestResult,
|
||||
ApiTestDetail,
|
||||
TestPlanTestCaseStatusButton
|
||||
TestPlanTestCaseStatusButton,
|
||||
TestCaseAttachment
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -348,7 +365,8 @@ export default {
|
|||
activeTab: 'detail',
|
||||
isFailure: true,
|
||||
users: [],
|
||||
hasTapdId: false
|
||||
hasTapdId: false,
|
||||
tableData: [],
|
||||
};
|
||||
},
|
||||
props: {
|
||||
|
@ -449,6 +467,20 @@ export default {
|
|||
this.initTest();
|
||||
this.getIssues(testCase.caseId);
|
||||
this.stepResultChange();
|
||||
this.getFileMetaData(testCase);
|
||||
},
|
||||
getFileMetaData(testCase) {
|
||||
this.tableData = [];
|
||||
this.result = this.$get("test/case/file/metadata/" + testCase.caseId, response => {
|
||||
let files = response.data;
|
||||
if (!files) {
|
||||
return;
|
||||
}
|
||||
this.tableData = JSON.parse(JSON.stringify(files));
|
||||
this.tableData.map(f => {
|
||||
f.size = f.size + ' Bytes';
|
||||
});
|
||||
})
|
||||
},
|
||||
openTestCaseEdit(testCase) {
|
||||
this.showDialog = true;
|
||||
|
@ -589,6 +621,9 @@ export default {
|
|||
this.getIssues(this.testCase.caseId);
|
||||
this.$success(this.$t('commons.delete_success'));
|
||||
})
|
||||
},
|
||||
handleDelete() {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -201,6 +201,22 @@
|
|||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="20" :offset="1">
|
||||
<div>
|
||||
<span class="cast_label">{{ $t('test_track.case.attachment') }}:</span>
|
||||
</div>
|
||||
<div>
|
||||
<test-case-attachment :table-data="tableData"
|
||||
:read-only="false"
|
||||
:is-delete="false"
|
||||
@handleDelete="handleDelete"
|
||||
/>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</div>
|
||||
|
||||
</el-scrollbar>
|
||||
|
@ -234,6 +250,7 @@ import ApiTestDetail from "../../../plan/view/comonents/test/ApiTestDetail";
|
|||
import TestPlanTestCaseStatusButton from "../../../plan/common/TestPlanTestCaseStatusButton";
|
||||
import {listenGoBack, removeGoBackListener} from "@/common/js/utils";
|
||||
import ReviewComment from "../../commom/ReviewComment";
|
||||
import TestCaseAttachment from "@/business/components/track/case/components/TestCaseAttachment";
|
||||
|
||||
export default {
|
||||
name: "TestReviewTestCaseEdit",
|
||||
|
@ -243,7 +260,8 @@ export default {
|
|||
ApiTestResult,
|
||||
ApiTestDetail,
|
||||
TestPlanTestCaseStatusButton,
|
||||
ReviewComment
|
||||
ReviewComment,
|
||||
TestCaseAttachment
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -258,7 +276,8 @@ export default {
|
|||
isFailure: true,
|
||||
users: [],
|
||||
activeName: 'comment',
|
||||
comments: []
|
||||
comments: [],
|
||||
tableData: []
|
||||
};
|
||||
},
|
||||
props: {
|
||||
|
@ -332,6 +351,20 @@ export default {
|
|||
this.testCase = item;
|
||||
this.getComments(item);
|
||||
this.initTest();
|
||||
this.getFileMetaData(testCase);
|
||||
},
|
||||
getFileMetaData(testCase) {
|
||||
this.tableData = [];
|
||||
this.result = this.$get("test/case/file/metadata/" + testCase.caseId, response => {
|
||||
let files = response.data;
|
||||
if (!files) {
|
||||
return;
|
||||
}
|
||||
this.tableData = JSON.parse(JSON.stringify(files));
|
||||
this.tableData.map(f => {
|
||||
f.size = f.size + ' Bytes';
|
||||
});
|
||||
})
|
||||
},
|
||||
openTestCaseEdit(testCase) {
|
||||
this.showDialog = true;
|
||||
|
@ -406,6 +439,9 @@ export default {
|
|||
}).length > 0;
|
||||
}
|
||||
},
|
||||
handleDelete() {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue