Merge branch 'master' of https://github.com/metersphere/metersphere
This commit is contained in:
commit
22020e48d0
|
@ -127,10 +127,4 @@ public class APITestController {
|
|||
public List<ScheduleDao> listSchedule(@RequestBody QueryScheduleRequest request) {
|
||||
return apiTestService.listSchedule(request);
|
||||
}
|
||||
|
||||
@GetMapping("/license/valid")
|
||||
public LicenseDTO valid() {
|
||||
return apiTestService.validateLicense();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -437,13 +437,4 @@ public class APITestService {
|
|||
quotaService.checkAPITestQuota();
|
||||
}
|
||||
}
|
||||
|
||||
public LicenseDTO validateLicense() {
|
||||
LicenseService licenseService = CommonBeanFactory.getBean(LicenseService.class);
|
||||
if (licenseService != null) {
|
||||
return licenseService.valid();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -4,14 +4,13 @@
|
|||
|
||||
<select id="list" resultType="io.metersphere.track.dto.TestCaseReviewDTO"
|
||||
parameterType="io.metersphere.track.request.testreview.QueryCaseReviewRequest">
|
||||
select distinct test_case_review.id, test_case_review.name, user.name as creator, test_case_review.status,
|
||||
select distinct test_case_review.id, test_case_review.name, test_case_review.creator, test_case_review.status,
|
||||
test_case_review.create_time, test_case_review.update_time, test_case_review.end_time,
|
||||
test_case_review.description
|
||||
from test_case_review, project, test_case_review_project, user
|
||||
from test_case_review, project, test_case_review_project
|
||||
<where>
|
||||
test_case_review.id = test_case_review_project.review_id
|
||||
and test_case_review_project.project_id = project.id
|
||||
and user.id = test_case_review.creator
|
||||
<if test="request.name != null">
|
||||
and test_case_review.name like CONCAT('%', #{request.name},'%')
|
||||
</if>
|
||||
|
|
|
@ -5,6 +5,7 @@ import io.metersphere.commons.constants.UserSource;
|
|||
import io.metersphere.commons.user.SessionUser;
|
||||
import io.metersphere.commons.utils.SessionUtils;
|
||||
import io.metersphere.controller.request.LoginRequest;
|
||||
import io.metersphere.dto.LicenseDTO;
|
||||
import io.metersphere.service.UserService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
|
@ -67,4 +68,9 @@ public class LoginController {
|
|||
return userService.getDefaultLanguage();
|
||||
}
|
||||
|
||||
@GetMapping("/api/license/valid")
|
||||
public LicenseDTO valid() {
|
||||
return userService.validateLicense();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -198,10 +198,6 @@ public class MailService {
|
|||
users = emails.toArray(new String[emails.size()]);
|
||||
if (type.equals("reviewer")) {
|
||||
helper.setText(html1, true);
|
||||
} else if (type.equals("reviewer")) {
|
||||
helper.setText(html2, true);
|
||||
} else {
|
||||
helper.setText(html3, true);
|
||||
}
|
||||
helper.setTo(users);
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ import io.metersphere.commons.constants.UserStatus;
|
|||
import io.metersphere.commons.exception.MSException;
|
||||
import io.metersphere.commons.user.SessionUser;
|
||||
import io.metersphere.commons.utils.CodingUtil;
|
||||
import io.metersphere.commons.utils.CommonBeanFactory;
|
||||
import io.metersphere.commons.utils.SessionUtils;
|
||||
import io.metersphere.controller.ResultHolder;
|
||||
import io.metersphere.controller.request.LoginRequest;
|
||||
|
@ -19,6 +20,7 @@ import io.metersphere.controller.request.member.QueryMemberRequest;
|
|||
import io.metersphere.controller.request.member.UserRequest;
|
||||
import io.metersphere.controller.request.organization.AddOrgMemberRequest;
|
||||
import io.metersphere.controller.request.organization.QueryOrgMemberRequest;
|
||||
import io.metersphere.dto.LicenseDTO;
|
||||
import io.metersphere.dto.UserDTO;
|
||||
import io.metersphere.dto.UserRoleDTO;
|
||||
import io.metersphere.i18n.Translator;
|
||||
|
@ -589,4 +591,12 @@ public class UserService {
|
|||
public List<User> searchUser(String condition) {
|
||||
return extUserMapper.searchUser(condition);
|
||||
}
|
||||
|
||||
public LicenseDTO validateLicense() {
|
||||
LicenseService licenseService = CommonBeanFactory.getBean(LicenseService.class);
|
||||
if (licenseService != null) {
|
||||
return licenseService.valid();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -351,33 +351,36 @@ public class TestCaseReviewService {
|
|||
}
|
||||
});
|
||||
|
||||
testReviews.forEach(testReview -> {
|
||||
List<TestReviewCaseDTO> testCases = testCaseMap.get(testReview.getId());
|
||||
if (!CollectionUtils.isEmpty(testReviews)) {
|
||||
testReviews.forEach(testReview -> {
|
||||
List<TestReviewCaseDTO> testCases = testCaseMap.get(testReview.getId());
|
||||
|
||||
TestCaseReviewUsersExample testCaseReviewUsersExample = new TestCaseReviewUsersExample();
|
||||
testCaseReviewUsersExample.createCriteria().andReviewIdEqualTo(testReview.getId());
|
||||
List<String> userIds = testCaseReviewUsersMapper.selectByExample(testCaseReviewUsersExample)
|
||||
.stream().map(TestCaseReviewUsers::getUserId).collect(Collectors.toList());
|
||||
String reviewName = getReviewName(userIds);
|
||||
testReview.setReviewerName(reviewName);
|
||||
TestCaseReviewUsersExample testCaseReviewUsersExample = new TestCaseReviewUsersExample();
|
||||
testCaseReviewUsersExample.createCriteria().andReviewIdEqualTo(testReview.getId());
|
||||
List<String> userIds = testCaseReviewUsersMapper.selectByExample(testCaseReviewUsersExample)
|
||||
.stream().map(TestCaseReviewUsers::getUserId).collect(Collectors.toList());
|
||||
String reviewName = getReviewName(userIds);
|
||||
testReview.setReviewerName(reviewName);
|
||||
|
||||
User u = userMapper.selectByPrimaryKey(testReview.getCreator());
|
||||
testReview.setCreator(u.getName());
|
||||
|
||||
testReview.setReviewed(0);
|
||||
testReview.setTotal(0);
|
||||
if (testCases != null) {
|
||||
testReview.setTotal(testCases.size());
|
||||
testCases.forEach(testCase -> {
|
||||
if (!StringUtils.equals(testCase.getStatus(), TestPlanTestCaseStatus.Prepare.name())
|
||||
&& !StringUtils.equals(testCase.getStatus(), TestPlanTestCaseStatus.Underway.name())) {
|
||||
testReview.setReviewed(testReview.getReviewed() + 1);
|
||||
}
|
||||
});
|
||||
}
|
||||
testReview.setTestRate(MathUtils.getPercentWithDecimal(testReview.getTotal() == 0 ? 0 : testReview.getReviewed() * 1.0 / testReview.getTotal()));
|
||||
});
|
||||
User u = userMapper.selectByPrimaryKey(testReview.getCreator());
|
||||
if (u != null) {
|
||||
testReview.setCreator(u.getName());
|
||||
}
|
||||
|
||||
testReview.setReviewed(0);
|
||||
testReview.setTotal(0);
|
||||
if (testCases != null) {
|
||||
testReview.setTotal(testCases.size());
|
||||
testCases.forEach(testCase -> {
|
||||
if (!StringUtils.equals(testCase.getStatus(), TestPlanTestCaseStatus.Prepare.name())
|
||||
&& !StringUtils.equals(testCase.getStatus(), TestPlanTestCaseStatus.Underway.name())) {
|
||||
testReview.setReviewed(testReview.getReviewed() + 1);
|
||||
}
|
||||
});
|
||||
}
|
||||
testReview.setTestRate(MathUtils.getPercentWithDecimal(testReview.getTotal() == 0 ? 0 : testReview.getReviewed() * 1.0 / testReview.getTotal()));
|
||||
});
|
||||
}
|
||||
return testReviews;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,15 +1,11 @@
|
|||
<template>
|
||||
<el-col v-if="auth">
|
||||
<el-row id="header-top1" type="flex" justify="space-between" align="middle">
|
||||
<el-row v-if="licenseHeader != null">
|
||||
<el-col>
|
||||
<div class="license-head" v-if="validData.status == 'expired'">License has expired since
|
||||
{{(validData!= undefined && validData.license!= undefined) ? validData.license.expired:''}},please
|
||||
update license.
|
||||
</div>
|
||||
<component :is="licenseHeader"></component>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row id="header-top" type="flex" justify="space-between" align="middle">
|
||||
|
||||
<el-col :span="12">
|
||||
<a class="logo"/>
|
||||
<ms-top-menus/>
|
||||
|
@ -34,15 +30,18 @@
|
|||
import MsHeaderOrgWs from "./components/common/head/HeaderOrgWs";
|
||||
import MsLanguageSwitch from "./components/common/head/LanguageSwitch";
|
||||
import {saveLocalStorage} from "../common/js/utils";
|
||||
import {saveLicense} from "../common/js/utils";
|
||||
import Setting from "@/business/components/settings/router";
|
||||
|
||||
const requireComponent = require.context('@/business/components/xpack/', true, /\.vue$/);
|
||||
const header = requireComponent("./license/LicenseMessage.vue");
|
||||
|
||||
export default {
|
||||
name: 'app',
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
validData: {},
|
||||
auth: false
|
||||
licenseHeader: null,
|
||||
auth: false,
|
||||
header: {},
|
||||
}
|
||||
},
|
||||
beforeCreate() {
|
||||
|
@ -51,6 +50,10 @@
|
|||
this.$setLang(response.data.data.language);
|
||||
saveLocalStorage(response.data);
|
||||
this.auth = true;
|
||||
// 是否显示校验信息
|
||||
if (header.default !== undefined) {
|
||||
this.licenseHeader = "LicenseMessage";
|
||||
}
|
||||
} else {
|
||||
window.location.href = "/login"
|
||||
}
|
||||
|
@ -58,21 +61,18 @@
|
|||
window.location.href = "/login"
|
||||
});
|
||||
},
|
||||
beforeMount() {
|
||||
// 验证license
|
||||
this.result = this.$get("/api/license/valid", response => {
|
||||
let data = response.data;
|
||||
if (data != undefined && data != null) {
|
||||
this.validData = response.data;
|
||||
saveLicense(response.data);
|
||||
}
|
||||
});
|
||||
},
|
||||
components: {MsLanguageSwitch, MsUser, MsView, MsTopMenus, MsHeaderOrgWs},
|
||||
methods: {}
|
||||
components: {
|
||||
MsLanguageSwitch,
|
||||
MsUser,
|
||||
MsView,
|
||||
MsTopMenus,
|
||||
MsHeaderOrgWs,
|
||||
"LicenseMessage": header.default
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style scoped>
|
||||
#header-top {
|
||||
width: 100%;
|
||||
|
@ -128,4 +128,3 @@
|
|||
color: white;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
<script>
|
||||
import MsDialogFooter from '../../common/components/MsDialogFooter'
|
||||
import {Test} from "./model/ScenarioModel"
|
||||
import {Scenario, Test} from "./model/ScenarioModel"
|
||||
import MsApiScenarioConfig from "./components/ApiScenarioConfig";
|
||||
import MsApiReportStatus from "../report/ApiReportStatus";
|
||||
import MsApiReportDialog from "./ApiReportDialog";
|
||||
|
|
|
@ -1116,8 +1116,11 @@ class JMXGenerator {
|
|||
|
||||
addScenarioVariables(threadGroup, scenario) {
|
||||
if (scenario.environment) {
|
||||
let commonConfig = scenario.environment.config.commonConfig;
|
||||
this.addEnvironments(commonConfig.variables, scenario.variables)
|
||||
let config = scenario.environment.config;
|
||||
if (!(scenario.environment.config instanceof Object)) {
|
||||
config = JSON.parse(scenario.environment.config);
|
||||
}
|
||||
this.addEnvironments(config.commonConfig.variables, scenario.variables)
|
||||
}
|
||||
let args = this.filterKV(scenario.variables);
|
||||
if (args.length > 0) {
|
||||
|
@ -1165,8 +1168,11 @@ class JMXGenerator {
|
|||
databaseConfigMap.set(config.id, config.name);
|
||||
});
|
||||
if (scenario.environment) {
|
||||
let envDatabaseConfigs = scenario.environment.config.databaseConfigs;
|
||||
envDatabaseConfigs.forEach(config => {
|
||||
let config = scenario.environment.config;
|
||||
if (!(scenario.environment.config instanceof Object)) {
|
||||
config = JSON.parse(scenario.environment.config);
|
||||
}
|
||||
config.databaseConfigs.forEach(config => {
|
||||
if (!names.has(config.name)) {
|
||||
let name = config.name + "JDBCDataSource";
|
||||
threadGroup.put(new JDBCDataSource(name, config));
|
||||
|
@ -1179,8 +1185,11 @@ class JMXGenerator {
|
|||
|
||||
addScenarioHeaders(threadGroup, scenario) {
|
||||
if (scenario.environment) {
|
||||
let httpConfig = scenario.environment.config.httpConfig;
|
||||
this.addEnvironments(httpConfig.headers, scenario.headers)
|
||||
let config = scenario.environment.config;
|
||||
if (!(scenario.environment.config instanceof Object)) {
|
||||
config = JSON.parse(scenario.environment.config);
|
||||
}
|
||||
this.addEnvironments(config.httpConfig.headers, scenario.headers)
|
||||
}
|
||||
let headers = this.filterKV(scenario.headers);
|
||||
if (headers.length > 0) {
|
||||
|
|
|
@ -47,7 +47,6 @@
|
|||
<script>
|
||||
import {checkoutCurrentOrganization, checkoutCurrentWorkspace} from "@/common/js/utils";
|
||||
import Setting from "@/business/components/settings/router";
|
||||
import {LicenseKey} from '@/common/js/constants';
|
||||
|
||||
export default {
|
||||
name: "MsSettingMenu",
|
||||
|
@ -74,51 +73,14 @@
|
|||
organizations: getMenus('organization'),
|
||||
workspaces: getMenus('workspace'),
|
||||
persons: getMenus('person'),
|
||||
isValid: valid,
|
||||
isCurrentOrganizationAdmin: false,
|
||||
isCurrentWorkspaceUser: false,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (this.isValid === true) {
|
||||
this.valid();
|
||||
}
|
||||
this.isCurrentOrganizationAdmin = checkoutCurrentOrganization();
|
||||
this.isCurrentWorkspaceUser = checkoutCurrentWorkspace();
|
||||
},
|
||||
methods: {
|
||||
valid() {
|
||||
let data = localStorage.getItem(LicenseKey);
|
||||
if (data != undefined && data != null) {
|
||||
data = JSON.parse(data);
|
||||
}
|
||||
if (data === undefined || data === null || data.status != "valid") {
|
||||
this.systems.forEach(item => {
|
||||
if (item.valid != undefined && item.valid === true) {
|
||||
this.systems.splice(this.systems.indexOf(item), 1);
|
||||
}
|
||||
})
|
||||
|
||||
this.organizations.forEach(item => {
|
||||
if (item.valid != undefined && item.valid === true) {
|
||||
this.organizations.splice(this.organizations.indexOf(item), 1);
|
||||
}
|
||||
})
|
||||
|
||||
this.workspaces.forEach(item => {
|
||||
if (item.valid != undefined && item.valid === true) {
|
||||
this.workspaces.splice(this.workspaces.indexOf(item), 1);
|
||||
}
|
||||
})
|
||||
|
||||
this.persons.forEach(item => {
|
||||
if (item.valid != undefined && item.valid === true) {
|
||||
this.persons.splice(this.persons.indexOf(item), 1);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
:close-on-click-modal="false"
|
||||
class="ms-switch-project"
|
||||
>
|
||||
<ms-table-header :condition.sync="condition" @search="initData" title="切换项目" :show-create="false"/>
|
||||
<ms-table-header :condition.sync="condition" @search="initData" :title="$t('test_track.switch_project')" :show-create="false"/>
|
||||
<el-table
|
||||
:data="tableData"
|
||||
highlight-current-row
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
<el-container class="main-content">
|
||||
<el-aside class="tree-aside" width="250px">
|
||||
<el-link type="primary" class="project-link" @click="switchProject">{{projectName ? projectName : '切换项目' }}</el-link>
|
||||
<el-link type="primary" class="project-link" @click="switchProject">{{projectName ? projectName : $t('test_track.switch_project') }}</el-link>
|
||||
<node-tree class="node-tree"
|
||||
@nodeSelectEvent="nodeChange"
|
||||
@refresh="refresh"
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<div v-if="comments.length === 0" style="text-align: center">
|
||||
<i class="el-icon-chat-line-square" style="font-size: 15px;color: #8a8b8d;">
|
||||
<span style="font-size: 15px; color: #8a8b8d;">
|
||||
暂无评论
|
||||
{{ $t('test_track.comment.no_comment') }}
|
||||
</span>
|
||||
</i>
|
||||
</div>
|
||||
|
@ -13,7 +13,7 @@
|
|||
<div>
|
||||
<el-input
|
||||
type="textarea"
|
||||
placeholder="发表评论(Ctrl+Enter发送)"
|
||||
:placeholder="$t('test_track.comment.send_comment')"
|
||||
v-model="textarea"
|
||||
maxlength="60"
|
||||
show-word-limit
|
||||
|
@ -22,7 +22,9 @@
|
|||
@keyup.ctrl.enter.native="sendComment"
|
||||
>
|
||||
</el-input>
|
||||
<el-button type="primary" size="mini" class="send-btn" @click="sendComment">发送</el-button>
|
||||
<el-button type="primary" size="mini" class="send-btn" @click="sendComment">
|
||||
{{ $t('test_track.comment.send') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -49,16 +51,15 @@ export default {
|
|||
comment.caseId = this.caseId;
|
||||
comment.description = this.textarea;
|
||||
if (!this.textarea) {
|
||||
this.$warning("评论内容不能为空!");
|
||||
this.$warning(this.$t('test_track.comment.description_is_null'));
|
||||
return;
|
||||
}
|
||||
this.result = this.$post('/test/case/comment/save', comment, () => {
|
||||
this.$success("评论成功!");
|
||||
this.$success(this.$t('test_track.comment.send_success'));
|
||||
this.$emit('getComments');
|
||||
this.textarea = '';
|
||||
});
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
<el-container class="main-content">
|
||||
<el-aside class="tree-aside" width="250px">
|
||||
<el-link type="primary" class="project-link" @click="switchProject">{{projectName ? projectName : '切换项目' }}</el-link>
|
||||
<el-link type="primary" class="project-link" @click="switchProject">{{projectName ? projectName : $t('test_track.switch_project') }}</el-link>
|
||||
<node-tree class="node-tree"
|
||||
@nodeSelectEvent="nodeChange"
|
||||
@refresh="refresh"
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
<el-row type="flex" class="head-bar">
|
||||
|
||||
<el-col :span="12">
|
||||
<el-col :span="8">
|
||||
<el-button plain size="mini"
|
||||
icon="el-icon-back"
|
||||
@click="cancel">{{ $t('test_track.return') }}
|
||||
|
@ -29,12 +29,12 @@
|
|||
|
||||
<el-col :span="12" class="head-right">
|
||||
|
||||
<span class="head-right-tip" v-if="index + 1 == testCases.length">
|
||||
<span class="head-right-tip" v-if="index + 1 === testCases.length">
|
||||
{{ $t('test_track.plan_view.pre_case') }} : {{
|
||||
testCases[index - 1] ? testCases[index - 1].name : ''
|
||||
}}
|
||||
</span>
|
||||
<span class="head-right-tip" v-if="index + 1 != testCases.length">
|
||||
<span class="head-right-tip" v-if="index + 1 !== testCases.length">
|
||||
{{ $t('test_track.plan_view.next_case') }} : {{
|
||||
testCases[index + 1] ? testCases[index + 1].name : ''
|
||||
}}
|
||||
|
@ -50,16 +50,16 @@
|
|||
<el-divider direction="vertical"></el-divider>
|
||||
|
||||
<el-button type="success" size="mini" :disabled="isReadOnly" plain @click="saveCase('Pass')">
|
||||
通过
|
||||
{{ $t('test_track.review.pass') }}
|
||||
</el-button>
|
||||
<el-button type="danger" size="mini" :disabled="isReadOnly" plain @click="saveCase('UnPass')">
|
||||
未通过
|
||||
{{ $t('test_track.review.un_pass') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row style="margin-top: 0px;">
|
||||
<el-row style="margin-top: 0;">
|
||||
<el-col>
|
||||
<el-divider content-position="left">{{ testCase.name }}</el-divider>
|
||||
</el-col>
|
||||
|
@ -75,18 +75,20 @@
|
|||
</el-col>
|
||||
<el-col :span="5">
|
||||
<span class="cast_label">{{ $t('test_track.case.case_type') }}:</span>
|
||||
<span class="cast_item" v-if="testCase.type == 'functional'">{{ $t('commons.functional') }}</span>
|
||||
<span class="cast_item" v-if="testCase.type === 'functional'">{{
|
||||
$t('commons.functional')
|
||||
}}</span>
|
||||
<span class="cast_item"
|
||||
v-if="testCase.type == 'performance'">{{ $t('commons.performance') }}</span>
|
||||
<span class="cast_item" v-if="testCase.type == 'api'">{{ $t('commons.api') }}</span>
|
||||
v-if="testCase.type === 'performance'">{{ $t('commons.performance') }}</span>
|
||||
<span class="cast_item" v-if="testCase.type === 'api'">{{ $t('commons.api') }}</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="4" :offset="1">
|
||||
<span class="cast_label">{{ $t('test_track.case.method') }}:</span>
|
||||
<span v-if="testCase.method == 'manual'">{{ $t('test_track.case.manual') }}</span>
|
||||
<span v-if="testCase.method == 'auto'">{{ $t('test_track.case.auto') }}</span>
|
||||
<span v-if="testCase.method === 'manual'">{{ $t('test_track.case.manual') }}</span>
|
||||
<span v-if="testCase.method === 'auto'">{{ $t('test_track.case.auto') }}</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<span class="cast_label">{{ $t('test_track.case.module') }}:</span>
|
||||
|
@ -105,27 +107,21 @@
|
|||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row v-if="testCase.method == 'auto' && testCase.testId">
|
||||
<el-row v-if="testCase.method === 'auto' && testCase.testId">
|
||||
<el-col class="test-detail" :span="20" :offset="1">
|
||||
<el-tabs v-model="activeTab" type="border-card" @tab-click="testTabChange">
|
||||
<el-tabs v-model="activeTab" type="border-card">
|
||||
<el-tab-pane name="detail" :label="$t('test_track.plan_view.test_detail')">
|
||||
<api-test-detail :is-read-only="isReadOnly" v-if="testCase.type == 'api'" @runTest="testRun"
|
||||
<api-test-detail :is-read-only="true" v-if="testCase.type === 'api'" @runTest="testRun"
|
||||
:id="testCase.testId" ref="apiTestDetail"/>
|
||||
<performance-test-detail :is-read-only="isReadOnly" v-if="testCase.type == 'performance'"
|
||||
<performance-test-detail :is-read-only="true" v-if="testCase.type === 'performance'"
|
||||
@runTest="testRun" :id="testCase.testId"
|
||||
ref="performanceTestDetail"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane name="result" :label="$t('test_track.plan_view.test_result')">
|
||||
<api-test-result :report-id="testCase.reportId" v-if=" testCase.type == 'api'"
|
||||
ref="apiTestResult"/>
|
||||
<performance-test-result :is-read-only="isReadOnly" :report-id="testCase.reportId"
|
||||
v-if="testCase.type == 'performance'" ref="performanceTestResult"/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row v-if="testCase.method && testCase.method != 'auto'">
|
||||
<el-row v-if="testCase.method && testCase.method !== 'auto'">
|
||||
<el-col :span="20" :offset="1">
|
||||
<div>
|
||||
<span class="cast_label">{{ $t('test_track.case.steps') }}:</span>
|
||||
|
@ -202,7 +198,7 @@
|
|||
<el-col :span="15" :offset="1">
|
||||
<div>
|
||||
<span class="cast_label">{{ $t('commons.remark') }}:</span>
|
||||
<span v-if="testCase.remark == null || testCase.remark == ''"
|
||||
<span v-if="testCase.remark == null || testCase.remark === ''"
|
||||
style="color: darkgrey">{{ $t('commons.not_filled') }}</span>
|
||||
</div>
|
||||
<div>
|
||||
|
@ -222,7 +218,7 @@
|
|||
<el-col :span="7">
|
||||
<el-card class="comment-card">
|
||||
<template slot="header">
|
||||
<span style="font-size: 15px; color: #1E90FF">评论</span>
|
||||
<span style="font-size: 15px; color: #1E90FF">{{ $t('test_track.review.comment') }}</span>
|
||||
<i class="el-icon-refresh" @click="getComments(testCase)"
|
||||
style="margin-left:10px;font-size: 14px; cursor: pointer"/>
|
||||
</template>
|
||||
|
@ -232,7 +228,6 @@
|
|||
</div>
|
||||
</el-row>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
</el-drawer>
|
||||
|
@ -348,11 +343,10 @@ export default {
|
|||
},
|
||||
initTest() {
|
||||
this.$nextTick(() => {
|
||||
if (this.testCase.method == 'auto') {
|
||||
if (this.$refs.apiTestDetail && this.testCase.type == 'api') {
|
||||
|
||||
if (this.testCase.method === 'auto') {
|
||||
if (this.$refs.apiTestDetail && this.testCase.type === 'api') {
|
||||
this.$refs.apiTestDetail.init();
|
||||
} else if (this.testCase.type == 'performance') {
|
||||
} else if (this.testCase.type === 'performance') {
|
||||
this.$refs.performanceTestDetail.init();
|
||||
}
|
||||
}
|
||||
|
@ -362,12 +356,6 @@ export default {
|
|||
this.testCase.reportId = reportId;
|
||||
this.saveReport(reportId);
|
||||
},
|
||||
testTabChange(data) {
|
||||
if (this.testCase.type == 'performance' && data.paneName == 'result') {
|
||||
this.$refs.performanceTestResult.checkReportStatus();
|
||||
this.$refs.performanceTestResult.init();
|
||||
}
|
||||
},
|
||||
saveReport(reportId) {
|
||||
// this.$post('/test/plan/case/edit', {id: this.testCase.id, reportId: reportId});
|
||||
},
|
||||
|
@ -395,7 +383,7 @@ export default {
|
|||
});
|
||||
},
|
||||
getRelatedTest() {
|
||||
if (this.testCase.method == 'auto' && this.testCase.testId && this.testCase.testId != 'other') {
|
||||
if (this.testCase.method === 'auto' && this.testCase.testId && this.testCase.testId !== 'other') {
|
||||
this.$get('/' + this.testCase.type + '/get/' + this.testCase.testId, response => {
|
||||
let data = response.data;
|
||||
if (data) {
|
||||
|
@ -413,7 +401,7 @@ export default {
|
|||
this.$post('/test/case/review/edit/status/' + reviewId);
|
||||
},
|
||||
stepResultChange() {
|
||||
if (this.testCase.method == 'manual') {
|
||||
if (this.testCase.method === 'manual') {
|
||||
this.isFailure = this.testCase.steptResults.filter(s => {
|
||||
return s.executeResult === 'Failure' || s.executeResult === 'Blocking';
|
||||
}).length > 0;
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
type="selection"/>
|
||||
<el-table-column width="40" :resizable="false" align="center">
|
||||
<template v-slot:default="scope">
|
||||
<!-- <show-more-btn :is-show="scope.row.showMore" :buttons="buttons" :size="selectRows.size"/>-->
|
||||
<show-more-btn :is-show="scope.row.showMore" :buttons="buttons" :size="selectRows.size"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
|
@ -146,14 +146,11 @@
|
|||
@refreshTable="search"/>
|
||||
|
||||
</el-card>
|
||||
<batch-edit ref="batchEdit" @batchEdit="batchEdit"
|
||||
:type-arr="typeArr" :value-arr="valueArr" :dialog-title="$t('test_track.case.batch_edit_case')"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import ClassicEditor from "@ckeditor/ckeditor5-build-classic";
|
||||
import MsTableOperatorButton from "../../../../common/components/MsTableOperatorButton";
|
||||
import MsTableOperator from "../../../../common/components/MsTableOperator";
|
||||
import MethodTableItem from "../../../common/tableItems/planview/MethodTableItem";
|
||||
|
@ -171,7 +168,7 @@ import BatchEdit from "../../../case/components/BatchEdit";
|
|||
import MsTablePagination from '../../../../common/pagination/TablePagination';
|
||||
import {_filter, _sort, checkoutTestManagerOrTestUser, hasRoles} from "../../../../../../common/js/utils";
|
||||
import {TEST_CASE_CONFIGS} from "../../../../common/components/search/search-components";
|
||||
import {ROLE_TEST_MANAGER, ROLE_TEST_USER, TokenKey, WORKSPACE_ID} from "../../../../../../common/js/constants";
|
||||
import {ROLE_TEST_MANAGER, ROLE_TEST_USER} from "../../../../../../common/js/constants";
|
||||
import TestReviewTestCaseEdit from "./TestReviewTestCaseEdit";
|
||||
|
||||
export default {
|
||||
|
@ -216,9 +213,6 @@ export default {
|
|||
],
|
||||
showMore: false,
|
||||
buttons: [
|
||||
{
|
||||
name: this.$t('test_track.case.batch_edit_case'), handleClick: this.handleBatchEdit
|
||||
},
|
||||
{
|
||||
name: this.$t('test_track.case.batch_unlink'), handleClick: this.handleDeleteBatch
|
||||
}
|
||||
|
@ -236,10 +230,6 @@ export default {
|
|||
{name: this.$t('test_track.plan_view.skip'), id: 'Skip'}
|
||||
]
|
||||
},
|
||||
editor: ClassicEditor,
|
||||
editorConfig: {
|
||||
toolbar: [],
|
||||
},
|
||||
}
|
||||
},
|
||||
props: {
|
||||
|
@ -335,7 +325,7 @@ export default {
|
|||
this.$post('/test/review/case/batch/delete', {ids: ids}, () => {
|
||||
this.selectRows.clear();
|
||||
this.$emit("refresh");
|
||||
this.$success(this.$t('commons.delete_success'));
|
||||
this.$success(this.$t('test_track.cancel_relevance_success'));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -345,33 +335,33 @@ export default {
|
|||
let testCaseId = testCase.id;
|
||||
this.$post('/test/review/case/delete/' + testCaseId, {}, () => {
|
||||
this.$emit("refresh");
|
||||
this.$success(this.$t('commons.delete_success'));
|
||||
this.$success(this.$t('test_track.cancel_relevance_success'));
|
||||
});
|
||||
},
|
||||
handleSelectAll(selection) {
|
||||
|
||||
if (selection.length > 0) {
|
||||
this.tableData.forEach(item => {
|
||||
this.$set(item, "showMore", true);
|
||||
this.selectRows.add(item);
|
||||
});
|
||||
} else {
|
||||
this.selectRows.clear();
|
||||
this.tableData.forEach(row => {
|
||||
this.$set(row, "showMore", false);
|
||||
})
|
||||
}
|
||||
},
|
||||
handleSelectionChange(selection, row) {
|
||||
|
||||
},
|
||||
handleBatch(type) {
|
||||
if (this.selectRows.size < 1) {
|
||||
this.$warning(this.$t('test_track.plan_view.select_manipulate'));
|
||||
return;
|
||||
}
|
||||
if (type === 'executor') {
|
||||
this.$refs.executorEdit.openExecutorEdit();
|
||||
} else if (type === 'status') {
|
||||
this.$refs.statusEdit.openStatusEdit();
|
||||
} else if (type === 'delete') {
|
||||
this.handleDeleteBatch();
|
||||
if (this.selectRows.has(row)) {
|
||||
this.$set(row, "showMore", false);
|
||||
this.selectRows.delete(row);
|
||||
} else {
|
||||
this.$set(row, "showMore", true);
|
||||
this.selectRows.add(row);
|
||||
}
|
||||
},
|
||||
openTestReport() {
|
||||
this.$refs.testReportTemplateList.open(this.reviewId);
|
||||
},
|
||||
statusChange(param) {
|
||||
|
||||
},
|
||||
getTestReviewById() {
|
||||
if (this.reviewId) {
|
||||
|
@ -393,34 +383,12 @@ export default {
|
|||
_sort(column, this.condition);
|
||||
this.initTableData();
|
||||
},
|
||||
batchEdit(form) {
|
||||
// let param = {};
|
||||
// param[form.type] = form.value;
|
||||
// param.ids = Array.from(this.selectRows).map(row => row.id);
|
||||
// this.$post('/test/plan/case/batch/edit', param, () => {
|
||||
// this.selectRows.clear();
|
||||
// this.status = '';
|
||||
// this.$post('/test/plan/edit/status/' + this.reviewId);
|
||||
// this.$success(this.$t('commons.save_success'));
|
||||
// this.$emit('refresh');
|
||||
// });
|
||||
},
|
||||
handleBatchEdit() {
|
||||
this.getMaintainerOptions();
|
||||
this.$refs.batchEdit.open();
|
||||
},
|
||||
getMaintainerOptions() {
|
||||
let workspaceId = localStorage.getItem(WORKSPACE_ID);
|
||||
this.$post('/user/ws/member/tester/list', {workspaceId: workspaceId}, response => {
|
||||
this.valueArr.executor = response.data;
|
||||
});
|
||||
},
|
||||
startReview() {
|
||||
if (this.tableData.length !== 0) {
|
||||
this.isReadOnly = false;
|
||||
this.$refs.testReviewTestCaseEdit.openTestCaseEdit(this.tableData[0]);
|
||||
} else {
|
||||
this.$warning("没有关联的评审!");
|
||||
this.$warning(this.$t('test_track.review.no_link_case'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -429,14 +397,5 @@ export default {
|
|||
|
||||
<style scoped>
|
||||
|
||||
.search {
|
||||
margin-left: 10px;
|
||||
width: 240px;
|
||||
}
|
||||
|
||||
.test-case-status, .el-table {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
|
|
|
@ -621,6 +621,8 @@ export default {
|
|||
pass_rate: "Pass rate",
|
||||
execution_result: ": Please select the execution result",
|
||||
actual_result: ": The actual result is empty",
|
||||
cancel_relevance_success: "Unlinked successfully",
|
||||
switch_project: "Switch project",
|
||||
case: {
|
||||
export_all_cases: 'Are you sure you want to export all use cases?',
|
||||
input_test_case: 'Please enter the associated case name',
|
||||
|
@ -737,6 +739,17 @@ export default {
|
|||
input_review_name: "Please enter the name of the review",
|
||||
input_review_project: "Please select the project",
|
||||
input_reviewer: "Please select reviewer",
|
||||
no_link_case: "No associated use cases!",
|
||||
pass: "pass",
|
||||
un_pass: "UnPass",
|
||||
comment: "Comment",
|
||||
},
|
||||
comment: {
|
||||
no_comment: "No Comment",
|
||||
send_comment: "Post a comment (Ctrl + Enter to send)",
|
||||
send: "Send",
|
||||
description_is_null: "Comment content cannot be empty!",
|
||||
send_success: "Comment successful!",
|
||||
},
|
||||
review_view: {
|
||||
review: "Review",
|
||||
|
|
|
@ -623,7 +623,8 @@ export default {
|
|||
pass_rate: "通过率",
|
||||
execution_result: ": 请选择执行结果",
|
||||
actual_result: ": 实际结果为空",
|
||||
|
||||
cancel_relevance_success: "取消关联成功",
|
||||
switch_project: "切换项目",
|
||||
case: {
|
||||
export_all_cases: '确定要导出全部用例吗?',
|
||||
input_test_case: '请输入关联用例名称',
|
||||
|
@ -740,6 +741,17 @@ export default {
|
|||
input_review_name: "请输入评审名称",
|
||||
input_review_project: "请选择所属项目",
|
||||
input_reviewer: "请选择评审人",
|
||||
no_link_case: "没有关联用例!",
|
||||
pass: "通过",
|
||||
un_pass: "未通过",
|
||||
comment: "评论",
|
||||
},
|
||||
comment: {
|
||||
no_comment: "暂无评论",
|
||||
send_comment: "发表评论(Ctrl+Enter发送)",
|
||||
send: "发送",
|
||||
description_is_null: "评论内容不能为空!",
|
||||
send_success: "评论成功!",
|
||||
},
|
||||
review_view: {
|
||||
review: "评审",
|
||||
|
|
|
@ -623,7 +623,8 @@ export default {
|
|||
pass_rate: "通過率",
|
||||
execution_result: ": 請選擇執行結果",
|
||||
actual_result: ": 實際結果為空",
|
||||
|
||||
cancel_relevance_success: "取消關聯成功",
|
||||
switch_project: "切換項目",
|
||||
case: {
|
||||
export_all_cases: '確定要匯出全部用例嗎?',
|
||||
input_test_case: '請輸入關聯用例名稱',
|
||||
|
@ -740,6 +741,17 @@ export default {
|
|||
input_review_name: "請輸入評審名稱",
|
||||
input_review_project: "請選擇所屬項目",
|
||||
input_reviewer: "請選擇評審人",
|
||||
no_link_case: "沒有關聯用例!",
|
||||
pass: "通過",
|
||||
un_pass: "未通過",
|
||||
comment: "評論",
|
||||
},
|
||||
comment: {
|
||||
no_comment: "暫無評論",
|
||||
send_comment: "發表評論(Ctrl+Enter發送)",
|
||||
send: "發送",
|
||||
description_is_null: "評論內容不能為空!",
|
||||
send_success: "評論成功!",
|
||||
},
|
||||
review_view: {
|
||||
review: "評審",
|
||||
|
|
Loading…
Reference in New Issue