fix: 设置接口URL不可重复,重复导入时接口用例重复生成,部分提取

This commit is contained in:
wenyann 2021-02-24 18:37:59 +08:00
parent 1f2ffba0d4
commit 3fc69227ff
14 changed files with 68 additions and 36 deletions

View File

@ -391,9 +391,12 @@ public class ApiDefinitionService {
if (apiTestCase.getName().length() > 255) {
apiTestCase.setName(apiTestCase.getName().substring(0, 255));
}
if (!isInsert) {
/* if (!isInsert) {
apiTestCase.setName(apiTestCase.getName() + "_" + apiTestCase.getId().substring(0, 5));
}
}*/
ApiTestCaseExample example = new ApiTestCaseExample();
example.createCriteria().andApiDefinitionIdEqualTo(apiDefinition.getId());
apiTestCaseMapper.deleteByExample(example);
apiTestCaseMapper.insert(apiTestCase);
}
} catch (Exception e) {

View File

@ -109,9 +109,7 @@
</template>
<el-table-column fixed="right" :label="$t('commons.operating')" width="190px" v-if="!referenced">
<template slot="header">
<span>{{ $t('commons.operating') }}
<i class='el-icon-setting' style="color:#7834c1; margin-left:10px" @click="customHeader"> </i>
</span>
<header-label-operate @exec="customHeader"/>
</template>
<template v-slot:default="{row}">
<div v-if="trashEnable">
@ -193,10 +191,12 @@
getSelectDataCounts,
setUnSelectIds, toggleAllSelection
} from "@/common/js/tableUtils";
import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate";
export default {
name: "MsApiScenarioList",
components: {
HeaderLabelOperate,
HeaderCustom,
BatchMove,
EnvironmentSelect,

View File

@ -98,9 +98,7 @@
<el-table-column fixed="right" v-if="!isReadOnly" :label="$t('commons.operating')" min-width="130"
align="center">
<template slot="header">
<span>{{ $t('commons.operating') }}
<i class='el-icon-setting' style="color:#7834c1; margin-left:10px" @click="customHeader"> </i>
</span>
<header-label-operate @exec="customHeader"/>
</template>
<template v-slot:default="scope">
<ms-table-operator-button :tip="$t('commons.edit')" icon="el-icon-edit" @exec="handleTestCase(scope.row)"
@ -164,10 +162,12 @@ import {_filter, _handleSelect, _handleSelectAll, _sort, getLabel,} from "@/comm
import {API_CASE_LIST, API_LIST, API_SCENARIO_LIST, TEST_CASE_LIST} from "@/common/js/constants";
import {Api_Case_List, Api_List, Track_Test_Case} from "@/business/components/common/model/JsonData";
import HeaderCustom from "@/business/components/common/head/HeaderCustom";
import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate";
export default {
name: "ApiCaseSimpleList",
components: {
HeaderLabelOperate,
ApiListContainerWithDoc,
HeaderCustom,
MsTableHeaderSelectPopover,

View File

@ -160,13 +160,13 @@
:key="index"/>
</template>
<el-table-column fixed="right" v-if="!isReadOnly" :label="$t('commons.operating')" min-width="180"
<el-table-column fixed="right" v-if="!isReadOnly" min-width="180"
align="center">
<template slot="header">
<span>{{ $t('commons.operating') }}
<i class='el-icon-setting' style="color:#7834c1; margin-left:10px" @click="customHeader"> </i>
</span>
<header-label-operate @exec="customHeader"/>
</template>
<template v-slot:default="scope">
<ms-table-operator-button class="run-button" :is-tester-permission="true"
:tip="$t('api_test.automation.execute')"
@ -243,11 +243,13 @@ import {
import {_filter, _sort} from "@/common/js/tableUtils";
import {Api_List, Track_Test_Case} from "@/business/components/common/model/JsonData";
import HeaderCustom from "@/business/components/common/head/HeaderCustom";
import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate";
export default {
name: "ApiList",
components: {
HeaderLabelOperate,
HeaderCustom,
CaseBatchMove,
ApiStatus,

View File

@ -49,6 +49,8 @@ export default {
props: JSON.stringify(this.fieldSelected)
}
this.$post("/system/save/header", param, response => {
console.log(this.optionalFields)
console.log(this.fieldSelected)
this.$success(this.$t("commons.save_success"));
this.dialogTableVisible = false
this.initTableData()

View File

@ -0,0 +1,25 @@
<template>
<div>
<template>
<span>{{ $t('commons.operating') }}
<i class='el-icon-setting' style="color:#7834c1; margin-left:10px" @click="customHeader"> </i>
</span>
</template>
</div>
</template>
<script>
export default {
name: "HeaderLabelOperate",
methods: {
customHeader() {
this.$emit('exec')
}
}
}
</script>
<style scoped>
</style>

View File

@ -163,9 +163,7 @@
</template>
<el-table-column fixed="right" min-width="150">
<template slot="header">
<span>{{ $t('commons.operating') }}
<i class='el-icon-setting' style="color:#7834c1; margin-left:10px" @click="customHeader"> </i>
</span>
<header-label-operate @exec="customHeader"/>
</template>
<template v-slot:default="scope">
<ms-table-operator :is-tester-permission="true" @editClick="handleEdit(scope.row)"
@ -231,10 +229,12 @@ import BatchMove from "./BatchMove";
import {Track_Test_Case} from "@/business/components/common/model/JsonData";
import HeaderCustom from "@/business/components/common/head/HeaderCustom";
import i18n from "@/i18n/i18n";
import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate";
export default {
name: "TestCaseList",
components: {
HeaderLabelOperate,
HeaderCustom,
BatchMove,
MsTableHeaderSelectPopover,

View File

@ -139,9 +139,7 @@
min-width="150"
:label="$t('commons.operating')">
<template slot="header">
<span>{{ $t('commons.operating') }}
<i class='el-icon-setting' style="color:#7834c1; margin-left:10px" @click="customHeader"> </i>
</span>
<header-label-operate @exec="customHeader"/>
</template>
<template v-slot:default="scope">
<ms-table-operator :is-tester-permission="true" @editClick="handleEdit(scope.row)"
@ -205,11 +203,13 @@ 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 HeaderCustom from "@/business/components/common/head/HeaderCustom";
import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate";
export default {
name: "TestPlanList",
components: {
HeaderLabelOperate,
HeaderCustom,
MsDeleteConfirm,
TestCaseReportView,

View File

@ -106,9 +106,7 @@
</template>
<el-table-column v-if="!isReadOnly" :label="$t('commons.operating')" align="center">
<template slot="header">
<span>{{ $t('commons.operating') }}
<i class='el-icon-setting' style="color:#7834c1; margin-left:10px" @click="customHeader"> </i>
</span>
<header-label-operate @exec="customHeader"/>
</template>
<template v-slot:default="scope">
<ms-table-operator-button class="run-button" :is-tester-permission="true" :tip="$t('api_test.run')"
@ -162,11 +160,13 @@ import {TEST_CASE_LIST, TEST_PLAN_API_CASE, WORKSPACE_ID} from "@/common/js/cons
import {_filter, _sort, getLabel} from "@/common/js/tableUtils";
import HeaderCustom from "@/business/components/common/head/HeaderCustom";
import {Test_Plan_Api_Case, Track_Test_Case} from "@/business/components/common/model/JsonData";
import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate";
export default {
name: "TestPlanApiCaseList",
components: {
HeaderLabelOperate,
HeaderCustom,
TestPlanApiCaseResult,
MsRun,

View File

@ -67,9 +67,7 @@
</template>
<el-table-column :label="$t('commons.operating')" width="200px" v-if="!referenced">
<template slot="header">
<span>{{ $t('commons.operating') }}
<i class='el-icon-setting' style="color:#7834c1; margin-left:10px" @click="customHeader"> </i>
</span>
<header-label-operate @exec="customHeader"/>
</template>
<template v-slot:default="{row}">
<ms-table-operator-button class="run-button" :is-tester-permission="true" :tip="$t('api_test.run')"
@ -111,10 +109,12 @@ import MsTableOperatorButton from "../../../../../common/components/MsTableOpera
import HeaderCustom from "@/business/components/common/head/HeaderCustom";
import {TEST_CASE_LIST, TEST_PLAN_SCENARIO_CASE} from "@/common/js/constants";
import {Test_Plan_Scenario_Case, Track_Test_Case} from "@/business/components/common/model/JsonData";
import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate";
export default {
name: "MsTestPlanApiScenarioList",
components: {
HeaderLabelOperate,
HeaderCustom,
MsTableOperatorButton,
TestPlanScenarioListHeader,

View File

@ -228,9 +228,7 @@
min-width="100"
:label="$t('commons.operating')">
<template slot="header">
<span>{{ $t('commons.operating') }}
<i class='el-icon-setting' style="color:#7834c1; margin-left:10px" @click="customHeader"> </i>
</span>
<header-label-operate @exec="customHeader"/>
</template>
<template v-slot:default="scope">
<ms-table-operator-button :is-tester-permission="true" :tip="$t('commons.edit')" icon="el-icon-edit"
@ -292,11 +290,13 @@ import MsTag from "@/business/components/common/components/MsTag";
import {_filter, _sort, getLabel} from "@/common/js/tableUtils";
import HeaderCustom from "@/business/components/common/head/HeaderCustom";
import {Test_Plan_Function_Test_Case} from "@/business/components/common/model/JsonData";
import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate";
export default {
name: "FunctionalTestCaseList",
components: {
HeaderLabelOperate,
HeaderCustom,
FunctionalTestCaseEdit,
MsTableOperatorButton,

View File

@ -102,9 +102,7 @@
</template>
<el-table-column v-if="!isReadOnly" :label="$t('commons.operating')" align="center">
<template slot="header">
<span>{{ $t('commons.operating') }}
<i class='el-icon-setting' style="color:#7834c1; margin-left:10px" @click="customHeader"> </i>
</span>
<header-label-operate @exec="customHeader"/>
</template>
<template v-slot:default="scope">
<ms-table-operator-button class="run-button" :is-tester-permission="true" :tip="$t('api_test.run')"
@ -138,10 +136,12 @@ import HeaderCustom from "@/business/components/common/head/HeaderCustom";
import {TEST_CASE_LIST, TEST_PLAN_LOAD_CASE} from "@/common/js/constants";
import {Test_Plan_Load_Case, Track_Test_Case} from "@/business/components/common/model/JsonData";
import {getCurrentUser} from "@/common/js/utils";
import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate";
export default {
name: "TestPlanLoadCaseList",
components: {
HeaderLabelOperate,
HeaderCustom,
LoadCaseReport,
TestPlanLoadCaseListHeader,

View File

@ -84,9 +84,7 @@
min-width="100"
:label="$t('commons.operating')">
<template slot="header">
<span>{{ $t('commons.operating') }}
<i class='el-icon-setting' style="color:#7834c1; margin-left:10px" @click="customHeader"> </i>
</span>
<header-label-operate @exec="customHeader"/>
</template>
<template v-slot:default="scope">
<ms-table-operator :is-tester-permission="true" @editClick="handleEdit(scope.row)"
@ -123,10 +121,12 @@ import PlanStatusTableItem from "../../common/tableItems/plan/PlanStatusTableIte
import {Test_Case_Review} from "@/business/components/common/model/JsonData";
import {TEST_CASE_LIST, TEST_CASE_REVIEW_LIST} from "@/common/js/constants";
import HeaderCustom from "@/business/components/common/head/HeaderCustom";
import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate";
export default {
name: "TestCaseReviewList",
components: {
HeaderLabelOperate,
HeaderCustom,
MsDeleteConfirm,
MsTableOperator,

View File

@ -153,9 +153,7 @@
:label="$t('commons.operating')"
>
<template slot="header">
<span>{{ $t('commons.operating') }}
<i class='el-icon-setting' style="color:#7834c1; margin-left:10px" @click="customHeader"> </i>
</span>
<header-label-operate @exec="customHeader"/>
</template>
<template v-slot:default="scope">
<ms-table-operator-button :is-tester-permission="true" :tip="$t('commons.edit')" icon="el-icon-edit"
@ -215,10 +213,12 @@ import ReviewStatus from "@/business/components/track/case/components/ReviewStat
import {_filter, _sort, getLabel} from "@/common/js/tableUtils";
import HeaderCustom from "@/business/components/common/head/HeaderCustom";
import {Test_Case_Review_Case_List, Track_Test_Case} from "@/business/components/common/model/JsonData";
import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate";
export default {
name: "TestReviewTestCaseList",
components: {
HeaderLabelOperate,
HeaderCustom,
MsTableOperatorButton, MsTableOperator, MethodTableItem, TypeTableItem,
StatusTableItem, PriorityTableItem, StatusEdit,