Merge remote-tracking branch 'origin/master'

This commit is contained in:
song.tianyang 2021-03-23 20:20:08 +08:00
commit 691cf5a380
34 changed files with 373 additions and 309 deletions

View File

@ -36,9 +36,12 @@
SELECT * FROM (
SELECT testCase.testCaseID,testCase.testCaseName AS caseName,testCase.testPlanName AS testPlan ,caseErrorCountData.dataCountNumber AS failureTimes,'apiCase' AS caseType
FROM (
SELECT apiCase.id AS testCaseID,apiCase.`name` AS testCaseName,group_concat(testPlan.`name`) AS testPlanName FROM api_test_case apiCase
SELECT apiCase.id AS testCaseID,apiCase.`name` AS testCaseName,group_concat(testPlan.`name`) AS testPlanName, testPlanCase.update_time as updateTime
FROM api_test_case apiCase
inner join api_definition on api_definition.id = apiCase.api_definition_id
INNER JOIN test_plan_api_case testPlanCase ON testPlanCase.api_case_id = apiCase.id
INNER JOIN test_plan testPlan ON testPlan.id = testPlanCase.test_plan_id
and api_definition.status != 'Trash'
GROUP BY apiCase.id
ORDER BY apiCase.create_time DESC
)testCase
@ -48,7 +51,7 @@
SELECT id FROM api_test_case WHERE project_id = #{projectId}
) and `status` = 'error' GROUP BY resource_id
) caseErrorCountData ON caseErrorCountData.testCaseID =testCase.testCaseID
WHERE caseErrorCountData.executeTime >= #{startTimestamp}
WHERE testCase.updateTime >= #{startTimestamp}
UNION
SELECT scene.id AS testCaseID,scene.`name` AS caseName,apiScene.testPlanName AS testPlan,count(report.id) AS failureTimes,'scenario' AS caseType
FROM api_scenario_report report

View File

@ -23,7 +23,6 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Service
@Transactional(rollbackFor = Exception.class)
@ -87,18 +86,10 @@ public class TrackService {
public List<ChartsData> getCaseMaintenanceBar(String projectId) {
List<TrackCountResult> funcMaintainer = extTestCaseMapper.countFuncMaintainer(projectId);
List<TrackCountResult> relevanceMaintainer = extTestCaseMapper.countRelevanceMaintainer(projectId);
List<String> list = relevanceMaintainer.stream().map(TrackCountResult::getGroupField).collect(Collectors.toList());
List<ChartsData> charts = new ArrayList<>();
for (TrackCountResult result : funcMaintainer) {
String groupField = result.getGroupField();
if (!list.contains(groupField)) {
// 创建了功能用例但是未关联测试
TrackCountResult trackCount = new TrackCountResult();
trackCount.setCountNumber(0);
trackCount.setGroupField(groupField);
relevanceMaintainer.add(trackCount);
}
ChartsData chartsData = new ChartsData();
chartsData.setxAxis(groupField);
chartsData.setyAxis(BigDecimal.valueOf(result.getCountNumber()));

View File

@ -133,6 +133,9 @@
});
}
}
},
selectNodeIds() {
this.activeName = "default";
}
},
methods: {

View File

@ -244,6 +244,9 @@
});
},
list(data) {
if (data.protocol === "dubbo://") {
data.protocol = "DUBBO";
}
let url = "/api/module/list/" + getCurrentProjectID() + "/" + data.protocol;
this.result = this.$get(url, response => {
if (response.data != undefined && response.data != null) {

View File

@ -6,7 +6,7 @@
<div class="el-step__icon-inner">{{data.index}}</div>
</div>
<el-tag class="ms-left-btn" size="small" :style="{'color': color, 'background-color': backgroundColor}">{{title}}</el-tag>
<el-tag size="mini" v-if="data.method">{{data.method}}</el-tag>
<el-tag size="mini" v-if="data.method">{{getMethod()}}</el-tag>
</slot>
<span>
@ -125,6 +125,17 @@
//this.$set(this.data, 'active', !this.data.active);
this.$emit('active');
},
getMethod() {
if (this.data.protocol === "HTTP") {
return this.data.method;
}
else if (this.data.protocol === "dubbo://") {
return "DUBBO";
}
else {
return this.data.protocol;
}
},
copyRow() {
this.$emit('copy');
},

View File

@ -13,7 +13,7 @@
</el-dropdown-menu>
</el-dropdown>
<ms-variable-list ref="scenarioParameters"/>
<ms-add-basis-api ref="api"/>
<ms-add-basis-api :currentProtocol="currentProtocol" ref="api"/>
</div>
</template>
@ -32,6 +32,7 @@
data() {
return {
allSamplers: ELEMENTS.get('AllSamplerProxy'),
currentProtocol: "HTTP",
}
},
methods: {
@ -63,7 +64,8 @@
}
});
},
saveAsApi(){
saveAsApi() {
this.currentProtocol = this.data.protocol;
this.$refs.api.open(this.data);
}
}

View File

@ -126,27 +126,27 @@
</div>
</template>
<script>
import MsApiList from './components/list/ApiList';
import MsContainer from "../../common/components/MsContainer";
import MsMainContainer from "../../common/components/MsMainContainer";
import MsAsideContainer from "../../common/components/MsAsideContainer";
import MsApiConfig from "./components/ApiConfig";
import MsDebugHttpPage from "./components/debug/DebugHttpPage";
import MsDebugJdbcPage from "./components/debug/DebugJdbcPage";
import MsDebugTcpPage from "./components/debug/DebugTcpPage";
import MsDebugDubboPage from "./components/debug/DebugDubboPage";
import MsApiList from './components/list/ApiList';
import MsContainer from "../../common/components/MsContainer";
import MsMainContainer from "../../common/components/MsMainContainer";
import MsAsideContainer from "../../common/components/MsAsideContainer";
import MsApiConfig from "./components/ApiConfig";
import MsDebugHttpPage from "./components/debug/DebugHttpPage";
import MsDebugJdbcPage from "./components/debug/DebugJdbcPage";
import MsDebugTcpPage from "./components/debug/DebugTcpPage";
import MsDebugDubboPage from "./components/debug/DebugDubboPage";
import MsRunTestHttpPage from "./components/runtest/RunTestHTTPPage";
import MsRunTestTcpPage from "./components/runtest/RunTestTCPPage";
import MsRunTestSqlPage from "./components/runtest/RunTestSQLPage";
import MsRunTestDubboPage from "./components/runtest/RunTestDubboPage";
import {checkoutTestManagerOrTestUser, getCurrentUser, getUUID} from "@/common/js/utils";
import MsApiModule from "./components/module/ApiModule";
import ApiCaseSimpleList from "./components/list/ApiCaseSimpleList";
import MsRunTestHttpPage from "./components/runtest/RunTestHTTPPage";
import MsRunTestTcpPage from "./components/runtest/RunTestTCPPage";
import MsRunTestSqlPage from "./components/runtest/RunTestSQLPage";
import MsRunTestDubboPage from "./components/runtest/RunTestDubboPage";
import {checkoutTestManagerOrTestUser, getCurrentUser, getUUID} from "@/common/js/utils";
import MsApiModule from "./components/module/ApiModule";
import ApiCaseSimpleList from "./components/list/ApiCaseSimpleList";
import ApiDocumentsPage from "@/business/components/api/definition/components/list/ApiDocumentsPage";
import MsTableButton from "@/business/components/common/components/MsTableButton";
import MsTabButton from "@/business/components/common/components/MsTabButton";
import MsTableButton from "@/business/components/common/components/MsTableButton";
import MsTabButton from "@/business/components/common/components/MsTabButton";
export default {
name: "ApiDefinition",
@ -157,7 +157,7 @@ import MsTabButton from "@/business/components/common/components/MsTabButton";
this.changeRedirectParam(redirectIDParam);
return routeParam;
},
isReadOnly(){
isReadOnly() {
return !checkoutTestManagerOrTestUser();
},
projectId() {
@ -221,6 +221,9 @@ import MsTabButton from "@/business/components/common/components/MsTabButton";
currentProtocol() {
this.handleCommand("CLOSE_ALL");
},
selectNodeIds() {
this.apiDefaultTab = "default";
},
redirectID() {
this.renderComponent = false;
this.$nextTick(() => {

View File

@ -18,6 +18,7 @@
{{ assertion.desc }}
</div>
<div class="assertion-item btn circle">
<i class="el-icon-view el-button el-button--primary el-button--mini is-circle" circle @click="showPage"/>
<el-button :disabled="isReadOnly" type="success" size="mini" icon="el-icon-edit" circle @click="detail"/>
<el-button :disabled="isReadOnly" type="danger" size="mini" icon="el-icon-delete" circle @click="remove"/>
</div>
@ -27,23 +28,23 @@
<el-row type="flex" justify="space-between" align="middle" class="quick-script-block">
<div class="assertion-item input">
<el-input size="small" v-model="assertion.variable"
:placeholder="$t('api_test.request.assertions.variable_name')" @change="quickScript"/>
:placeholder="$t('api_test.request.assertions.variable_name')" @change="quickScript" :disabled="disabled"/>
</div>
<div class="assertion-item select">
<el-select v-model="assertion.operator" :placeholder="$t('commons.please_select')" size="small"
@change="changeOperator">
@change="changeOperator" :disabled="disabled">
<el-option v-for="o in operators" :key="o.value" :label="$t(o.label)" :value="o.value"/>
</el-select>
</div>
<div class="assertion-item input">
<el-input size="small" v-model="assertion.value" :placeholder="$t('api_test.value')"
@change="quickScript" v-if="!hasEmptyOperator"/>
@change="quickScript" v-if="!hasEmptyOperator" :disabled="disabled"/>
</div>
</el-row>
<el-input size="small" v-model="assertion.desc" :placeholder="$t('api_test.request.assertions.script_name')"
class="quick-script-block"/>
<ms-jsr233-processor ref="jsr233" :is-read-only="isReadOnly" :jsr223-processor="assertion" :templates="templates"
class="quick-script-block" :disabled="disabled"/>
<ms-jsr233-processor ref="jsr233" :is-read-only="disabled" :jsr223-processor="assertion" :templates="templates"
:height="300" @languageChange="quickScript"/>
<template v-slot:footer v-if="!edit">
<ms-dialog-footer
@ -84,6 +85,7 @@
data() {
return {
visible: false,
disabled: false,
operators: {
EQ: {
label: "commons.adv_search.operators.equals",
@ -260,6 +262,11 @@
}
},
detail() {
this.disabled = false;
this.visible = true;
},
showPage() {
this.disabled = true;
this.visible = true;
},
close() {

View File

@ -42,7 +42,7 @@
</div>
<div class="ms-body" v-if="body.type == 'XML'">
<ms-code-edit :read-only="isReadOnly" :data.sync="body.raw" :modes="modes" :mode="'xml'" ref="codeEdit"/>
<ms-code-edit :read-only="isReadOnly" :data.sync="body.raw" :modes="modes" :mode="'text'" ref="codeEdit"/>
</div>
<div class="ms-body" v-if="body.type == 'Raw'">

View File

@ -41,7 +41,6 @@
</template>
<script>
import {getCurrentProjectID} from "@/common/js/utils";
import MsTag from "@/business/components/common/components/MsTag";
export default {
@ -58,10 +57,14 @@ export default {
loading: false
}
},
computed: {
projectId() {
return this.$store.state.projectId
},
},
methods: {
search() {
let projectID = getCurrentProjectID();
let projectID = this.projectId;
this.result = this.$get("/api/faliureCaseAboutTestPlan/"+projectID+"/10", response => {
this.tableData = response.data;
});

View File

@ -57,7 +57,7 @@
</template>
<script>
import {checkoutTestManagerOrTestUser, getCurrentProjectID} from "@/common/js/utils";
import {checkoutTestManagerOrTestUser} from "@/common/js/utils";
import MsTag from "@/business/components/common/components/MsTag";
export default {
name: "MsRunningTaskList",
@ -80,12 +80,15 @@ export default {
computed:{
isReadOnly(){
return !checkoutTestManagerOrTestUser();
}
},
projectId() {
return this.$store.state.projectId
},
},
methods: {
search() {
let projectID = getCurrentProjectID();
let projectID = this.projectId;
this.result = this.$get("/api/runningTask/"+projectID+"/"+this.callFrom, response => {
this.tableData = response.data;
});

View File

@ -201,7 +201,7 @@ export default {
});
},
async beforeUploadFile(file) {
beforeUploadFile(file) {
if (!this.fileValidator(file)) {
/// todo:
return false;
@ -211,14 +211,14 @@ export default {
this.$error(this.$t('load_test.delete_file'));
return false;
}
let valid = false;
},
checkFileExist(file, callback) {
//
async function f() {
return await axios.post('/performance/file/' + getCurrentProjectID() + '/getMetadataByName', {name: file.name})
}
await f().then(res => {
f().then(res => {
let response = res.data;
if (response.data.length === 0) {
let type = file.name.substring(file.name.lastIndexOf(".") + 1);
@ -229,18 +229,18 @@ export default {
type: type.toUpperCase(),
updateTime: file.lastModified,
});
valid = true;
callback();
} else {
this.$error(this.$t('load_test.project_file_exist'));
}
});
return valid;
},
handleUpload(uploadResources) {
let self = this;
let file = uploadResources.file;
this.checkFileExist(file, () => {
self.uploadList.push(file);
let type = file.name.substring(file.name.lastIndexOf(".") + 1);
if (type.toLowerCase() !== 'jmx') {
@ -251,11 +251,12 @@ export default {
let threadGroups = findThreadGroup(event.target.result, file.name);
threadGroups.forEach(tg => {
tg.options = {};
this.scenarios.push(tg);
self.scenarios.push(tg);
});
self.$emit('fileChange', self.scenarios);
};
jmxReader.readAsText(file);
})
},
handleExceed() {
this.$error(this.$t('load_test.file_size_limit'));

View File

@ -99,7 +99,7 @@ import SelectMenu from "../common/SelectMenu";
import MsContainer from "../../common/components/MsContainer";
import MsAsideContainer from "../../common/components/MsAsideContainer";
import MsMainContainer from "../../common/components/MsMainContainer";
import {checkoutTestManagerOrTestUser, getCurrentProjectID, getUUID} from "../../../../common/js/utils";
import {checkoutTestManagerOrTestUser, getUUID} from "../../../../common/js/utils";
import TestCaseNodeTree from "../common/TestCaseNodeTree";
import MsTabButton from "@/business/components/common/components/MsTabButton";
@ -132,12 +132,10 @@ export default {
loading: false,
type:'',
activeDom: 'left',
projectId: ""
}
},
mounted() {
this.init(this.$route);
this.projectId = getCurrentProjectID();
},
watch: {
redirectID() {
@ -151,7 +149,6 @@ export default {
this.init(to);
if (to.path.indexOf('/track/case/all') == -1) {
if (this.$refs && this.$refs.autoScenarioConfig) {
console.log(this.$refs.autoScenarioConfig);
this.$refs.autoScenarioConfig.forEach(item => {
/*item.removeListener();*/
});
@ -168,7 +165,10 @@ export default {
isRedirectEdit: function () {
let redirectParam = this.$route.params.dataSelectRange;
return redirectParam;
}
},
projectId() {
return this.$store.state.projectId
},
},
methods: {
handleCommand(e) {
@ -197,7 +197,6 @@ export default {
}
},
addTab(tab) {
this.projectId=getCurrentProjectID();
if (!this.projectId) {
this.$warning(this.$t('commons.check_project_tip'));
return;
@ -238,6 +237,10 @@ export default {
}
},
exportTestCase(){
if (this.activeDom !== 'left') {
this.$warning('请切换成接口列表导出!');
return;
}
this.$refs.testCaseList.exportTestCase()
},
addListener() {
@ -258,7 +261,6 @@ export default {
this.testCaseReadOnly = true;
}
let caseId = this.$route.params.caseId;
this.projectId=getCurrentProjectID();
if (!this.projectId) {
this.$warning(this.$t('commons.check_project_tip'));
return;

View File

@ -58,7 +58,7 @@
</template>
<script>
import {getCurrentProjectID, getCurrentUser, getUUID} from "@/common/js/utils";
import {getCurrentUser} from "@/common/js/utils";
import {WORKSPACE_ID} from "@/common/js/constants";
import MsDialogFooter from "@/business/components/common/components/MsDialogFooter";
import {buildNodePath} from "@/business/components/api/definition/model/NodeTree";
@ -97,15 +97,20 @@ export default {
this.getModuleOptions();
},
},
computed: {
projectId() {
return this.$store.state.projectId
},
},
methods: {
saveTestCase(saveAs) {
this.$refs['testCaseForm'].validate((valid) => {
if (valid) {
let path = "/test/case/save";
this.testCaseForm.projectId = getCurrentProjectID();
this.testCaseForm.projectId = this.projectId;
this.testCaseForm.type = "";
this.testCaseForm.priority = "P0";
if (this.currentModule !== undefined || this.currentModule !== null || this.currentModule !== 0 || this.currentModule !== "") {
if (this.currentModule && this.currentModule !== 0 && this.currentModule.path && this.currentModule.path !== 0) {
this.testCaseForm.nodePath = this.currentModule.path;
this.testCaseForm.nodeId = this.currentModule.id;
} else {
@ -113,7 +118,7 @@ export default {
this.testCaseForm.nodeId = "root"
}
this.result = this.$post(path, this.testCaseForm, response => {
this.testCaseForm.id=response.data.id
this.testCaseForm.id = response.data.id
this.$success(this.$t('commons.save_success'));
this.visible = false;
if (saveAs) {

View File

@ -287,10 +287,8 @@
import {TokenKey, WORKSPACE_ID} from '@/common/js/constants';
import MsDialogFooter from '../../../common/components/MsDialogFooter'
import {getCurrentUser, listenGoBack, removeGoBackListener} from "@/common/js/utils";
import {LIST_CHANGE, TrackEvent} from "@/business/components/common/head/ListEvent";
import {Message} from "element-ui";
import TestCaseAttachment from "@/business/components/track/case/components/TestCaseAttachment";
import {getCurrentProjectID} from "../../../../../common/js/utils";
import {buildNodePath} from "../../../api/definition/model/NodeTree";
import CaseComment from "@/business/components/track/case/components/CaseComment";
import MsInputTag from "@/business/components/api/automation/scenario/MsInputTag";
@ -324,11 +322,9 @@ export default {
resolve(nodes)
}
if(node.level==1){
this.projectId = getCurrentProjectID()
this.testOptions = [];
let url = '';
this.form.type=node.data.value
console.log(this.form.type)
if (this.form.type === 'testcase' || this.form.type === 'automation') {
url = '/api/' + this.form.type + '/list/' + this.projectId
} else if (this.form.type === 'performance' || this.form.type === 'api') {
@ -354,7 +350,6 @@ export default {
statuOptions:API_STATUS,
comments: [],
result: {},
projectId: "",
dialogFormVisible: false,
form: {
name: '',
@ -434,6 +429,11 @@ export default {
},
type: String
},
computed: {
projectId() {
return this.$store.state.projectId
},
},
mounted() {
this.getSelectOptions();
if (this.type === 'edit' || this.type === 'copy') {
@ -499,9 +499,6 @@ export default {
this.$nextTick(() => (this.isStepTableAlive = true));
},
open(testCase) {
console.log("测试用例")
console.log(testCase)
this.projectId = getCurrentProjectID();
if (window.history && window.history.pushState) {
history.pushState(null, null, document.URL);
window.addEventListener('popstate', this.close);
@ -587,7 +584,6 @@ export default {
/*
this.form.testId=testCase.selected
*/
console.log(this.form.selected)
this.getFileMetaData(testCase);
},
setTestCaseExtInfo(testCase) {
@ -692,7 +688,6 @@ export default {
buildParam() {
let param = {};
Object.assign(param, this.form);
console.log(this.form)
param.steps = JSON.stringify(this.form.steps);
param.nodeId = this.form.module;
this.moduleOptions.forEach(item => {
@ -781,7 +776,6 @@ export default {
});
},
getTestOptions(val) {
this.projectId = getCurrentProjectID()
this.testOptions = [];
let url = '';
if (this.form.type === 'testcase' || this.form.type === 'automation') {
@ -803,7 +797,6 @@ export default {
},
getDemandOptions() {
if (this.demandOptions.length === 0) {
this.projectId = getCurrentProjectID();
this.result = {loading : true};
this.$get("demand/list/" + this.projectId).then(response => {
this.demandOptions = response.data.data;

View File

@ -210,7 +210,6 @@ import {LIST_CHANGE, TrackEvent} from "@/business/components/common/head/ListEve
import StatusTableItem from "@/business/components/track/common/tableItems/planview/StatusTableItem";
import TestCaseDetail from "./TestCaseDetail";
import ReviewStatus from "@/business/components/track/case/components/ReviewStatus";
import {downloadFile, getCurrentProjectID, getCurrentUser} from "../../../../../common/js/utils";
import MsTag from "@/business/components/common/components/MsTag";
import {
_filter,
@ -330,7 +329,6 @@ export default {
maintainer: [],
},
currentCaseId: null,
projectId: "",
selectDataCounts: 0,
selectDataRange: "all"
}
@ -353,6 +351,11 @@ export default {
default: false,
}
},
computed: {
projectId() {
return this.$store.state.projectId
},
},
created: function () {
this.$emit('setCondition', this.condition);
if (this.trashEnable) {
@ -390,7 +393,6 @@ export default {
this.selectDataRange = dataType === 'case' ? dataRange : 'all';
},
initTableData() {
this.projectId = getCurrentProjectID();
this.condition.planId = "";
this.condition.nodeIds = [];
initCondition(this.condition);
@ -538,14 +540,14 @@ export default {
this.selectDataCounts = getSelectDataCounts(this.condition, this.total, this.selectRows);
},
importTestCase() {
if (!getCurrentProjectID()) {
if (!this.projectId) {
this.$warning(this.$t('commons.check_project_tip'));
return;
}
this.$refs.testCaseImport.open();
},
exportTestCase() {
if (!getCurrentProjectID()) {
if (!this.projectId) {
this.$warning(this.$t('commons.check_project_tip'));
return;
}

View File

@ -44,9 +44,7 @@
<script>
import NodeEdit from "./NodeEdit";
import {getCurrentProjectID} from "../../../../common/js/utils";
import MsNodeTree from "./NodeTree";
import {buildNodePath} from "@/business/components/api/definition/model/NodeTree";
import TestCaseCreate from "@/business/components/track/case/components/TestCaseCreate";
import TestCaseImport from "@/business/components/track/case/components/TestCaseImport";
@ -61,7 +59,6 @@ export default {
},
result: {},
treeNodes: [],
projectId: "",
condition: {
filterText: "",
trashEnable: false
@ -83,12 +80,16 @@ export default {
},
},
mounted() {
this.projectId = getCurrentProjectID();
this.list();
},
computed: {
projectId() {
return this.$store.state.projectId
},
},
methods: {
addTestCase(){
if (!getCurrentProjectID()) {
if (!this.projectId) {
this.$warning(this.$t('commons.check_project_tip'));
return;
}
@ -109,7 +110,7 @@ export default {
this.addTestCase();
break;
case "import":
if (!getCurrentProjectID()) {
if (!this.projectId) {
this.$warning(this.$t('commons.check_project_tip'));
return;
}

View File

@ -124,7 +124,7 @@ name: "TestCaseMinder",
if (isChange) {
saveCases.push(testCase);
}
if (testCase.nodeId.length < 15) {
if (testCase.nodeId !== 'root' && testCase.nodeId.length < 15) {
let tip = this.$t('test_track.case.create_case') + "'" + testCase.name + "'" + this.$t('test_track.case.minder_create_tip');
this.$error(tip)
throw new Error(tip);

View File

@ -1,5 +1,6 @@
export function getTestCaseDataMap(testCase, isDisable, setParamCallback) {
let dataMap = new Map();
if (testCase) {
testCase.forEach(item => {
item.steps = JSON.parse(item.steps);
// if (item.tags && item.tags.length > 0) {
@ -34,6 +35,7 @@ export function getTestCaseDataMap(testCase, isDisable, setParamCallback) {
dataMap.set(item.nodeId, mapItem);
}
})
}
return dataMap;
}
@ -41,6 +43,7 @@ function parseChildren(nodeItem, item, isDisable) {
nodeItem.children = [];
let children = [];
_parseChildren(children, item.prerequisite, "前置条件", isDisable);
if (item.steps) {
item.steps.forEach((step) => {
let descNode = _parseChildren(children, step.desc, undefined, isDisable);
if (descNode) {
@ -49,6 +52,7 @@ function parseChildren(nodeItem, item, isDisable) {
_parseChildren(descNode.children, step.result, undefined, isDisable);
}
});
}
_parseChildren(children, item.remark, "备注", isDisable);
nodeItem.children = children;
}

View File

@ -34,7 +34,8 @@
</el-col>
<el-col :span="6">
<div class="square">
<relevance-case-card :relevance-count-data="relevanceCountData" class="track-card" @redirectPage="redirectPage"/>
<relevance-case-card :relevance-count-data="relevanceCountData" class="track-card"
@redirectPage="redirectPage"/>
</div>
</el-col>
<el-col :span="12">
@ -73,7 +74,6 @@ import MsMainContainer from "@/business/components/common/components/MsMainConta
import MsContainer from "@/business/components/common/components/MsContainer";
import CaseCountCard from "@/business/components/track/home/components/CaseCountCard";
import RelevanceCaseCard from "@/business/components/track/home/components/RelevanceCaseCard";
import {getCurrentProjectID,getUUID} from "@/common/js/utils";
import CaseMaintenance from "@/business/components/track/home/components/CaseMaintenance";
import {COUNT_NUMBER, COUNT_NUMBER_SHALLOW} from "@/common/js/constants";
import BugCountCard from "@/business/components/track/home/components/BugCountCard";
@ -108,13 +108,18 @@ export default {
this.checkTipsType();
this.init();
},
computed: {
projectId() {
return this.$store.state.projectId
},
},
methods: {
checkTipsType() {
let random = Math.floor(Math.random() * (4 - 1 + 1)) + 1;
this.tipsType = random + "";
},
init() {
let selectProjectId = getCurrentProjectID();
let selectProjectId = this.projectId;
this.$get("/track/count/" + selectProjectId, response => {
this.trackCountData = response.data;
@ -136,8 +141,8 @@ export default {
xAxis.push(d.xAxis);
}
});
let yAxis1 = data.filter(d => d.groupName === 'FUNCTIONCASE').map(d => d.yAxis);
let yAxis2 = data.filter(d => d.groupName === 'RELEVANCECASE').map(d => d.yAxis);
let yAxis1 = data.filter(d => d.groupName === 'FUNCTIONCASE').map(d => [d.xAxis, d.yAxis]);
let yAxis2 = data.filter(d => d.groupName === 'RELEVANCECASE').map(d => [d.xAxis, d.yAxis]);
let option = {
tooltip: {
trigger: 'axis',
@ -186,12 +191,17 @@ export default {
};
this.caseOption = option;
},
redirectPage(page,dataType,selectType){
redirectPage(page, dataType, selectType) {
//test_plan
// this.$router.push('/track/plan/view/'+selectType);
switch (page){
switch (page) {
case "case":
this.$router.push({name:'testCase',params:{dataType:dataType,dataSelectRange:selectType, projectId: getCurrentProjectID()}});
this.$router.push({
name:'testCase',
params:{
dataType:dataType,dataSelectRange:selectType, projectId: this.projectId
}
});
break;
}
}

View File

@ -20,7 +20,6 @@
import TestPlanEdit from './components/TestPlanEdit';
import MsContainer from "../../common/components/MsContainer";
import MsMainContainer from "../../common/components/MsMainContainer";
import {getCurrentProjectID} from "../../../../common/js/utils";
export default {
name: "TestPlan",
@ -29,6 +28,11 @@
return {
}
},
computed: {
projectId() {
return this.$store.state.projectId
},
},
mounted() {
if (this.$route.path.indexOf("/track/plan/create") >= 0){
this.openTestPlanEditDialog();
@ -38,7 +42,7 @@
watch: {
'$route'(to, from) {
if (to.path.indexOf("/track/plan/create") >= 0){
if (!getCurrentProjectID()) {
if (!this.projectId) {
this.$warning(this.$t('commons.check_project_tip'));
return;
}

View File

@ -125,7 +125,7 @@
import {WORKSPACE_ID} from '@/common/js/constants';
import TestPlanStatusButton from "../common/TestPlanStatusButton";
import {getCurrentProjectID, listenGoBack, removeGoBackListener} from "@/common/js/utils";
import {listenGoBack, removeGoBackListener} from "@/common/js/utils";
import {LIST_CHANGE, TrackEvent} from "@/business/components/common/head/ListEvent";
import MsInputTag from "@/business/components/api/automation/scenario/MsInputTag";

View File

@ -220,11 +220,10 @@ import TestCaseReportView from "../view/comonents/report/TestCaseReportView";
import MsDeleteConfirm from "../../../common/components/MsDeleteConfirm";
import {TEST_PLAN_CONFIGS} from "../../../common/components/search/search-components";
import {LIST_CHANGE, TrackEvent} from "@/business/components/common/head/ListEvent";
import {getCurrentProjectID} from "../../../../../common/js/utils";
import MsScheduleMaintain from "@/business/components/api/automation/schedule/ScheduleMaintain"
import {_filter, _sort, getLabel} from "@/common/js/tableUtils";
import {TEST_CASE_LIST, TEST_PLAN_LIST} from "@/common/js/constants";
import {Test_Plan_List, Track_Test_Case} from "@/business/components/common/model/JsonData";
import {TEST_PLAN_LIST} from "@/common/js/constants";
import {Test_Plan_List} from "@/business/components/common/model/JsonData";
import HeaderCustom from "@/business/components/common/head/HeaderCustom";
import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate";
import MsTag from "@/business/components/common/components/MsTag";
@ -282,6 +281,9 @@ export default {
},
created() {
this.projectId = this.$route.params.projectId;
if (!this.projectId) {
this.projectId = this.$store.state.projectId;
}
this.isTestManagerOrTestUser = checkoutTestManagerOrTestUser();
this.initTableData();
},
@ -296,7 +298,7 @@ export default {
if (this.selectNodeIds && this.selectNodeIds.length > 0) {
this.condition.nodeIds = this.selectNodeIds;
}
if (!getCurrentProjectID()) {
if (!this.projectId) {
return;
}
this.result = this.$post(this.buildPagePath(this.queryPath), this.condition, response => {
@ -320,7 +322,7 @@ export default {
return path + "/" + this.currentPage + "/" + this.pageSize;
},
testPlanCreate() {
if (!getCurrentProjectID()) {
if (!this.projectId) {
this.$warning(this.$t('commons.check_project_tip'));
return;
}

View File

@ -151,7 +151,7 @@ import MsBottomContainer from "../../../../../api/definition/components/BottomCo
import ShowMoreBtn from "../../../../case/components/ShowMoreBtn";
import BatchEdit from "@/business/components/track/case/components/BatchEdit";
import {API_METHOD_COLOUR, CASE_PRIORITY, RESULT_MAP} from "../../../../../api/definition/model/JsonData";
import {getCurrentProjectID, strMapToObj} from "@/common/js/utils";
import {strMapToObj} from "@/common/js/utils";
import ApiListContainer from "../../../../../api/definition/components/list/ApiListContainer";
import PriorityTableItem from "../../../../common/tableItems/planview/PriorityTableItem";
import {getBodyUploadFiles, getUUID} from "../../../../../../../common/js/utils";
@ -539,7 +539,7 @@ export default {
},
getProjectId() {
if (!this.isRelevanceModel) {
return getCurrentProjectID();
return this.$store.state.projectId;
} else {
return this.currentCaseProjectId;
}

View File

@ -103,7 +103,7 @@ import MsTableHeader from "@/business/components/common/components/MsTableHeader
import MsTablePagination from "@/business/components/common/pagination/TablePagination";
import ShowMoreBtn from "@/business/components/track/case/components/ShowMoreBtn";
import MsTag from "../../../../../common/components/MsTag";
import {getUUID, getCurrentProjectID, getCurrentUser, strMapToObj} from "@/common/js/utils";
import {getUUID, strMapToObj} from "@/common/js/utils";
import MsApiReportDetail from "../../../../../api/automation/report/ApiReportDetail";
import MsTableMoreBtn from "../../../../../api/automation/scenario/TableMoreBtn";
import MsScenarioExtendButtons from "@/business/components/api/automation/scenario/ScenarioExtendBtns";
@ -162,7 +162,6 @@ export default {
status: 'default',
infoDb: false,
runVisible: false,
projectId: "",
runData: [],
buttons: [
{
@ -182,8 +181,12 @@ export default {
},
}
},
computed: {
projectId() {
return this.$store.state.projectId
},
},
created() {
this.projectId = getCurrentProjectID();
this.search();
},
watch: {

View File

@ -94,7 +94,7 @@
this.result = this.$get("/project/listAll", res => {
let data = res.data;
if (data) {
const index = data.findIndex(d => d.id === getCurrentProjectID());
const index = data.findIndex(d => d.id === this.$store.state.projectId);
this.projects = data;
if (index !== -1) {
this.projectId = data[index].id;

View File

@ -1,7 +1,5 @@
<template>
<div class="card-container">
<!-- <el-card class="card-content" v-loading="result.loading">-->
<!-- <template v-slot:header>-->
<ms-table-header :is-tester-permission="true" :condition.sync="condition" @search="initTableData"
:show-create="false" :tip="$t('commons.search_by_id_name_tag')">
@ -18,14 +16,8 @@
<ms-table-button :is-tester-permission="true" icon="el-icon-connection"
:content="$t('test_track.plan_view.relevance_test_case')"
@click="$emit('openTestCaseRelevanceDialog')"/>
<!-- 删除 取消全部关联 按钮-->
<!-- <ms-table-button :is-tester-permission="true" icon="el-icon-document-remove"-->
<!-- :content="$t('test_track.plan_view.cancel_all_relevance')" @click="handleDeleteBatch"/>-->
</template>
</ms-table-header>
<!-- </template>-->
<executor-edit ref="executorEdit" :select-ids="new Set(Array.from(this.selectRows).map(row => row.id))"
@refresh="initTableData"/>
@ -712,4 +704,8 @@ export default {
.el-tag {
margin-left: 10px;
}
.ms-table-header >>> .table-title {
height: 0px;
}
</style>

View File

@ -51,7 +51,6 @@
import FunctionalTestCaseList from "./FunctionalTestCaseList";
import MsTabButton from "@/business/components/common/components/MsTabButton";
import TestPlanMinder from "@/business/components/track/common/minder/TestPlanMinder";
import {getCurrentProjectID} from "@/common/js/utils";
export default {
name: "TestPlanFunctional",
@ -71,7 +70,6 @@
selectParentNodes: [],
treeNodes: [],
activeDom: 'left',
projectId: ""
}
},
props: [
@ -80,9 +78,13 @@
'clickType'
],
mounted() {
this.projectId = getCurrentProjectID();
this.initData();
},
computed: {
projectId() {
return this.$store.state.projectId
},
},
activated(){
this.initData();
this.openTestCaseEdit(this.$route.path);

View File

@ -13,7 +13,6 @@
import TestPlanReportList from './components/TestPlanReportList';
import MsContainer from "../../common/components/MsContainer";
import MsMainContainer from "../../common/components/MsMainContainer";
import {getCurrentProjectID} from "../../../../common/js/utils";
export default {
name: "TestPlanReport",

View File

@ -66,7 +66,6 @@ import MsTableOperatorButton from "../../../common/components/MsTableOperatorBut
import MsTableOperator from "../../../common/components/MsTableOperator";
import {checkoutTestManagerOrTestUser} from "@/common/js/utils";
import {TEST_PLAN_REPORT_CONFIGS} from "../../../common/components/search/search-components";
import {getCurrentProjectID} from "../../../../../common/js/utils";
import TestPlanReportView from "@/business/components/track/report/components/TestPlanReportView";
import ReportTriggerModeItem from "@/business/components/common/tableItem/ReportTriggerModeItem";
import MsTag from "@/business/components/common/components/MsTag";
@ -124,6 +123,9 @@ export default {
},
created() {
this.projectId = this.$route.params.projectId;
if (!this.projectId) {
this.projectId = this.$store.state.projectId;
}
this.isTestManagerOrTestUser = checkoutTestManagerOrTestUser();
this.initTableData();
},
@ -139,7 +141,7 @@ export default {
if (this.selectNodeIds && this.selectNodeIds.length > 0) {
this.condition.nodeIds = this.selectNodeIds;
}
if (!getCurrentProjectID()) {
if (!this.projectId) {
return;
}
this.result = this.$post(this.buildPagePath(this.queryPath), this.condition, response => {
@ -214,7 +216,7 @@ export default {
let deleteParam = {};
let ids = Array.from(this.selectRows).map(row => row.id);
deleteParam.dataIds = ids;
deleteParam.projectId = getCurrentProjectID();
deleteParam.projectId = this.projectId;
deleteParam.selectAllDate = this.isSelectAllDate;
deleteParam.unSelectIds = this.unSelection;
deleteParam = Object.assign(deleteParam, this.condition);

View File

@ -18,7 +18,6 @@ import TestCaseReviewList from "./components/TestCaseReviewList";
import TestCaseReviewEdit from "./components/TestCaseReviewEdit";
import MsMainContainer from "../../common/components/MsMainContainer";
import MsContainer from "../../common/components/MsContainer";
import {getCurrentProjectID} from "../../../../common/js/utils";
export default {
name: "TestCaseReview",
@ -33,6 +32,11 @@ export default {
}
},
computed: {
projectId() {
return this.$store.state.projectId
},
},
mounted() {
if (this.$route.path.indexOf("/track/review/create") >= 0){
this.openCaseReviewEditDialog();
@ -42,7 +46,7 @@ export default {
watch: {
'$route'(to) {
if (to.path.indexOf("/track/review/create") >= 0){
if (!getCurrentProjectID()) {
if (!this.projectId) {
this.$warning(this.$t('commons.check_project_tip'));
return;
}

View File

@ -101,7 +101,7 @@
import TestPlanStatusButton from "../../plan/common/TestPlanStatusButton";
import {WORKSPACE_ID} from "@/common/js/constants";
import {getCurrentProjectID, listenGoBack, removeGoBackListener} from "@/common/js/utils";
import {listenGoBack, removeGoBackListener} from "@/common/js/utils";
import MsInputTag from "@/business/components/api/automation/scenario/MsInputTag";
export default {

View File

@ -120,7 +120,6 @@ import MsCreateBox from "../../../settings/CreateBox";
import MsTablePagination from "../../../common/pagination/TablePagination";
import {
checkoutTestManagerOrTestUser,
getCurrentProjectID, getCurrentUser,
getCurrentWorkspaceId
} from "../../../../../common/js/utils";
import {_filter, _sort, getLabel} from "@/common/js/tableUtils";
@ -176,6 +175,11 @@ export default {
this.isTestManagerOrTestUser = checkoutTestManagerOrTestUser();
this.initTableData();
},
computed: {
projectId() {
return this.$store.state.projectId
},
},
methods: {
customHeader() {
this.$refs.headerCustom.open(this.tableLabel)
@ -185,10 +189,10 @@ export default {
getLabel(this, TEST_CASE_REVIEW_LIST);
let lastWorkspaceId = getCurrentWorkspaceId();
this.condition.workspaceId = lastWorkspaceId;
if (!getCurrentProjectID()) {
if (!this.projectId) {
return;
}
this.condition.projectId = getCurrentProjectID();
this.condition.projectId = this.projectId;
this.result = this.$post("/test/case/review/list/" + this.currentPage + "/" + this.pageSize, this.condition, response => {
let data = response.data;
this.total = data.itemCount;
@ -219,7 +223,7 @@ export default {
this.$router.push('/track/review/view/' + row.id);
},
testCaseReviewCreate() {
if (!getCurrentProjectID()) {
if (!this.projectId) {
this.$warning(this.$t('commons.check_project_tip'));
return;
}

View File

@ -49,7 +49,6 @@ import TestReviewRelevance from "@/business/components/track/review/view/compone
import TestReviewTestCaseList from "@/business/components/track/review/view/components/TestReviewTestCaseList";
import MsTabButton from "@/business/components/common/components/MsTabButton";
import TestReviewMinder from "@/business/components/track/common/minder/TestReviewMinder";
import {getCurrentProjectID} from "@/common/js/utils";
export default {
name: "TestReviewFunction",
@ -69,7 +68,6 @@ export default {
treeNodes: [],
isMenuShow: true,
activeDom: 'left',
projectId: ""
}
},
props: [
@ -79,11 +77,14 @@ export default {
],
mounted() {
this.getNodeTreeByReviewId()
this.projectId = getCurrentProjectID();
},
activated() {
this.getNodeTreeByReviewId()
},
computed: {
projectId() {
return this.$store.state.projectId
},
},
methods: {
refresh() {