fix(测试跟踪): 修复执行不含有环境的接口和场景用例时无法选择新环境的问题
This commit is contained in:
parent
2f94824031
commit
2ccd543d06
|
@ -265,6 +265,12 @@ public class TestPlanController {
|
||||||
return testPlanService.getRelevanceProjectIds(plan.getId());
|
return testPlanService.getRelevanceProjectIds(plan.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/case/relevance/project/id/{testPlanId}/{caseType}")
|
||||||
|
@RequiresPermissions(PermissionConstants.PROJECT_TRACK_PLAN_READ)
|
||||||
|
public List<String> getRelevanceProjectIds(@PathVariable String testPlanId, @PathVariable String caseType) {
|
||||||
|
return testPlanService.getRelevanceProjectIdsByCaseType(testPlanId, caseType);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("/edit/run/config")
|
@PostMapping("/edit/run/config")
|
||||||
@RequiresPermissions(PermissionConstants.PROJECT_TRACK_PLAN_READ_RUN)
|
@RequiresPermissions(PermissionConstants.PROJECT_TRACK_PLAN_READ_RUN)
|
||||||
|
|
|
@ -2318,6 +2318,18 @@ public class TestPlanService {
|
||||||
return projectIds.stream().distinct().collect(Collectors.toList());
|
return projectIds.stream().distinct().collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<String> getRelevanceProjectIdsByCaseType(String planId, String caseType) {
|
||||||
|
if (StringUtils.equalsIgnoreCase(caseType, "apiCase")) {
|
||||||
|
return planTestPlanApiCaseService.getApiCaseProjectIds(planId);
|
||||||
|
} else if (StringUtils.equalsIgnoreCase(caseType, "apiScenario")) {
|
||||||
|
return planTestPlanScenarioCaseService.getApiScenarioProjectIds(planId);
|
||||||
|
} else if (StringUtils.equalsIgnoreCase(caseType, "uiScenario") && DiscoveryUtil.hasService(MicroServiceName.UI_TEST)) {
|
||||||
|
return planTestPlanUiScenarioCaseService.getUiScenarioProjectIds(planId);
|
||||||
|
} else {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public TestPlanReportDataStruct buildOldVersionTestPlanReport(TestPlanReport
|
public TestPlanReportDataStruct buildOldVersionTestPlanReport(TestPlanReport
|
||||||
testPlanReport, TestPlanReportContentWithBLOBs testPlanReportContent) {
|
testPlanReport, TestPlanReportContentWithBLOBs testPlanReportContent) {
|
||||||
TestPlanWithBLOBs testPlanWithBLOBs = this.testPlanMapper.selectByPrimaryKey(testPlanReport.getTestPlanId());
|
TestPlanWithBLOBs testPlanWithBLOBs = this.testPlanMapper.selectByPrimaryKey(testPlanReport.getTestPlanId());
|
||||||
|
|
|
@ -383,6 +383,11 @@ export function getPlanCaseProjectIds(param) {
|
||||||
return post(BASE_URL + "case/relevance/project/ids", param);
|
return post(BASE_URL + "case/relevance/project/ids", param);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export function getProjectIdsByPlanIdAndCaseType(planId, caseType) {
|
||||||
|
return get(BASE_URL + `case/relevance/project/id/${planId}/${caseType}`);
|
||||||
|
}
|
||||||
|
|
||||||
export function run(testId, reportId) {
|
export function run(testId, reportId) {
|
||||||
return get(`${BASE_URL}api/case/run/${testId}/${reportId}`);
|
return get(`${BASE_URL}api/case/run/${testId}/${reportId}`);
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
class="mode-row"
|
class="mode-row"
|
||||||
v-if="
|
v-if="
|
||||||
testType === 'API' &&
|
testType === 'API' &&
|
||||||
(haveOtherExecCase && !haveUICase)
|
(haveOtherExecCase)
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<span>{{ $t("run_mode.run_with_resource_pool") }}: </span>
|
<span>{{ $t("run_mode.run_with_resource_pool") }}: </span>
|
||||||
|
@ -171,7 +171,12 @@ import {getCurrentProjectID, getOwnerProjects,} from "@/business/utils/sdk-utils
|
||||||
import {getQuotaValidResourcePools} from "@/api/remote/resource-pool";
|
import {getQuotaValidResourcePools} from "@/api/remote/resource-pool";
|
||||||
import EnvGroupPopover from "@/business/plan/env/EnvGroupPopover";
|
import EnvGroupPopover from "@/business/plan/env/EnvGroupPopover";
|
||||||
import {getApiCaseEnv} from "@/api/remote/plan/test-plan-api-case";
|
import {getApiCaseEnv} from "@/api/remote/plan/test-plan-api-case";
|
||||||
import {getApiScenarioEnv, getPlanCaseEnv, getPlanCaseProjectIds,} from "@/api/remote/plan/test-plan";
|
import {
|
||||||
|
getApiScenarioEnv,
|
||||||
|
getPlanCaseEnv,
|
||||||
|
getPlanCaseProjectIds,
|
||||||
|
getProjectIdsByPlanIdAndCaseType,
|
||||||
|
} from "@/api/remote/plan/test-plan";
|
||||||
import EnvGroupWithOption from "../env/EnvGroupWithOption";
|
import EnvGroupWithOption from "../env/EnvGroupWithOption";
|
||||||
import EnvironmentGroup from "@/business/plan/env/EnvironmentGroupList";
|
import EnvironmentGroup from "@/business/plan/env/EnvironmentGroupList";
|
||||||
import EnvSelectPopover from "@/business/plan/env/EnvSelectPopover";
|
import EnvSelectPopover from "@/business/plan/env/EnvSelectPopover";
|
||||||
|
@ -379,24 +384,34 @@ export default {
|
||||||
let data = res.data;
|
let data = res.data;
|
||||||
if (data) {
|
if (data) {
|
||||||
this.projectEnvListMap = data;
|
this.projectEnvListMap = data;
|
||||||
for (let d in data) {
|
}
|
||||||
this.projectIds.add(d);
|
getProjectIdsByPlanIdAndCaseType(this.planId, 'apiCase').then((res) => {
|
||||||
|
let data = res.data;
|
||||||
|
if (data) {
|
||||||
|
for (let i = 0; i < data.length; i++) {
|
||||||
|
this.projectIds.add(data[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.$refs.envSelectPopover.open();
|
this.$refs.envSelectPopover.open();
|
||||||
});
|
});
|
||||||
|
});
|
||||||
} else if (this.type === "apiScenario") {
|
} else if (this.type === "apiScenario") {
|
||||||
param = this.planCaseIds;
|
param = this.planCaseIds;
|
||||||
getApiScenarioEnv(param).then((res) => {
|
getApiScenarioEnv(param).then((res) => {
|
||||||
let data = res.data;
|
let data = res.data;
|
||||||
if (data) {
|
if (data) {
|
||||||
this.projectEnvListMap = data;
|
this.projectEnvListMap = data;
|
||||||
for (let d in data) {
|
}
|
||||||
this.projectIds.add(d);
|
getProjectIdsByPlanIdAndCaseType(this.planId, 'apiScenario').then((res) => {
|
||||||
|
let data = res.data;
|
||||||
|
if (data) {
|
||||||
|
for (let i = 0; i < data.length; i++) {
|
||||||
|
this.projectIds.add(data[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.$refs.envSelectPopover.open();
|
this.$refs.envSelectPopover.open();
|
||||||
});
|
});
|
||||||
|
});
|
||||||
} else if (this.type === "plan") {
|
} else if (this.type === "plan") {
|
||||||
param = {id: this.planId};
|
param = {id: this.planId};
|
||||||
getPlanCaseEnv(param).then((res) => {
|
getPlanCaseEnv(param).then((res) => {
|
||||||
|
|
|
@ -222,6 +222,7 @@
|
||||||
@handleRunBatch="handleRunBatch"
|
@handleRunBatch="handleRunBatch"
|
||||||
ref="runMode"
|
ref="runMode"
|
||||||
:plan-case-ids="testPlanCaseIds"
|
:plan-case-ids="testPlanCaseIds"
|
||||||
|
:plan-id="planId"
|
||||||
:type="'apiCase'"
|
:type="'apiCase'"
|
||||||
@close="search"
|
@close="search"
|
||||||
/>
|
/>
|
||||||
|
@ -236,19 +237,9 @@ import MsTag from "metersphere-frontend/src/components/MsTag";
|
||||||
import MsContainer from "metersphere-frontend/src/components/MsContainer";
|
import MsContainer from "metersphere-frontend/src/components/MsContainer";
|
||||||
import MsBottomContainer from "metersphere-frontend/src/components/MsBottomContainer";
|
import MsBottomContainer from "metersphere-frontend/src/components/MsBottomContainer";
|
||||||
import BatchEdit from "@/business/case/components/BatchEdit";
|
import BatchEdit from "@/business/case/components/BatchEdit";
|
||||||
import {
|
import {API_METHOD_COLOUR, CASE_PRIORITY, RESULT_MAP,} from "metersphere-frontend/src/model/JsonData";
|
||||||
API_METHOD_COLOUR,
|
import {getCurrentProjectID, getCurrentWorkspaceId,} from "metersphere-frontend/src/utils/token";
|
||||||
CASE_PRIORITY,
|
import {hasLicense, hasPermission,} from "metersphere-frontend/src/utils/permission";
|
||||||
RESULT_MAP,
|
|
||||||
} from "metersphere-frontend/src/model/JsonData";
|
|
||||||
import {
|
|
||||||
getCurrentProjectID,
|
|
||||||
getCurrentWorkspaceId,
|
|
||||||
} from "metersphere-frontend/src/utils/token";
|
|
||||||
import {
|
|
||||||
hasLicense,
|
|
||||||
hasPermission,
|
|
||||||
} from "metersphere-frontend/src/utils/permission";
|
|
||||||
import {getUUID, strMapToObj} from "metersphere-frontend/src/utils";
|
import {getUUID, strMapToObj} from "metersphere-frontend/src/utils";
|
||||||
import PriorityTableItem from "../../../../common/tableItems/planview/PriorityTableItem";
|
import PriorityTableItem from "../../../../common/tableItems/planview/PriorityTableItem";
|
||||||
import TestPlanCaseListHeader from "./TestPlanCaseListHeader";
|
import TestPlanCaseListHeader from "./TestPlanCaseListHeader";
|
||||||
|
@ -267,16 +258,9 @@ import MsTable from "metersphere-frontend/src/components/table/MsTable";
|
||||||
import MsTableColumn from "metersphere-frontend/src/components/table/MsTableColumn";
|
import MsTableColumn from "metersphere-frontend/src/components/table/MsTableColumn";
|
||||||
import MsUpdateTimeColumn from "metersphere-frontend/src/components/table/MsUpdateTimeColumn";
|
import MsUpdateTimeColumn from "metersphere-frontend/src/components/table/MsUpdateTimeColumn";
|
||||||
import MsCreateTimeColumn from "metersphere-frontend/src/components/table/MsCreateTimeColumn";
|
import MsCreateTimeColumn from "metersphere-frontend/src/components/table/MsCreateTimeColumn";
|
||||||
import {
|
import {editTestPlanApiCaseOrder, run, testPlanAutoCheck,} from "@/api/remote/plan/test-plan";
|
||||||
editTestPlanApiCaseOrder,
|
|
||||||
run,
|
|
||||||
testPlanAutoCheck,
|
|
||||||
} from "@/api/remote/plan/test-plan";
|
|
||||||
import {getProjectMemberUserFilter} from "@/api/user";
|
import {getProjectMemberUserFilter} from "@/api/user";
|
||||||
import {
|
import {apiTestCaseReduction,} from "@/api/remote/api/api-case";
|
||||||
apiTestCaseGet,
|
|
||||||
apiTestCaseReduction,
|
|
||||||
} from "@/api/remote/api/api-case";
|
|
||||||
import {
|
import {
|
||||||
testPlanApiCaseBatchDelete,
|
testPlanApiCaseBatchDelete,
|
||||||
testPlanApiCaseBatchUpdateEnv,
|
testPlanApiCaseBatchUpdateEnv,
|
||||||
|
|
|
@ -269,6 +269,7 @@
|
||||||
<ms-test-plan-run-mode-with-env
|
<ms-test-plan-run-mode-with-env
|
||||||
@handleRunBatch="handleRunBatch"
|
@handleRunBatch="handleRunBatch"
|
||||||
ref="runMode"
|
ref="runMode"
|
||||||
|
:plan-id="planId"
|
||||||
:plan-case-ids="planCaseIds"
|
:plan-case-ids="planCaseIds"
|
||||||
:type="'apiScenario'"
|
:type="'apiScenario'"
|
||||||
@close="search"
|
@close="search"
|
||||||
|
|
Loading…
Reference in New Issue