fix(测试计划): 修复测试计划跳转场景提示场景被删除的缺陷

--bug=1019236 --user=王孝刚 【测试跟踪】测试计划-场景用例列表-执行单个场景后报告链接跳转提示报告被删除
https://www.tapd.cn/55049933/s/1285572
This commit is contained in:
wxg0103 2022-11-01 17:58:58 +08:00 committed by wxg0103
parent c394ca8576
commit 68ccaa2a1f
4 changed files with 31 additions and 5 deletions

View File

@ -123,4 +123,9 @@ public class TestPlanScenarioCaseController {
public void orderCase(@RequestBody ResetOrderRequest request) {
testPlanScenarioCaseService.updateOrder(request);
}
@GetMapping("/get-scenario-id/{id}")
public String getScenarioId(@PathVariable("id") String planScenarioId) {
return testPlanScenarioCaseService.getScenarioId(planScenarioId);
}
}

View File

@ -654,4 +654,12 @@ public class TestPlanScenarioCaseService {
extTestPlanScenarioCaseMapper.getFailureList(planId, "unExecute");
return buildCases(apiTestCases);
}
public String getScenarioId(String planScenarioId) {
TestPlanApiScenario planApiScenario = testPlanApiScenarioMapper.selectByPrimaryKey(planScenarioId);
if (planApiScenario != null) {
return planApiScenario.getApiScenarioId();
}
return planScenarioId;
}
}

View File

@ -82,6 +82,7 @@
import {generateShareInfoWithExpired} from "@/network/share";
import {getCurrentProjectID, getCurrentWorkspaceId, getUUID} from "@/common/js/utils";
import MsTag from "@/business/components/common/components/MsTag";
const requireComponent = require.context('@/business/components/xpack/', true, /\.vue$/);
const UiDownloadScreenshot = requireComponent.keys().length > 0 ? requireComponent("./ui/automation/report/UiDownloadScreenshot.vue") : {};
@ -155,6 +156,18 @@ export default {
$event.target.blur();
},
redirect() {
let resourceId = this.scenarioId;
if (this.isPlan) {
this.$get('/test/plan/scenario/case/get-scenario-id/' + resourceId , res => {
resourceId = res.data;
this.showDetail(resourceId);
});
} else {
resourceId = this.scenarioId;
this.showDetail(resourceId);
}
},
showDetail(resourceId) {
let data = this.$router.resolve({
name: this.isUi ? 'uiAutomation' : 'ApiAutomation',
query: {
@ -162,7 +175,7 @@ export default {
dataType: "scenario",
projectId: getCurrentProjectID(),
workspaceId: getCurrentWorkspaceId(),
resourceId: this.scenarioId
resourceId: resourceId
}
});
window.open(data.href, '_blank');
@ -193,7 +206,7 @@ export default {
pram.shareType = 'API_REPORT';
let thisHost = window.location.host;
let shareUrl = thisHost + "/shareApiReport";
if(this.isUi){
if (this.isUi) {
pram.shareType = 'UI_REPORT';
shareUrl = thisHost + "/shareUiReport";
}
@ -202,8 +215,8 @@ export default {
});
},
getProjectApplication() {
let path = "/API_SHARE_REPORT_TIME";
if(this.isUi){
let path = "/API_SHARE_REPORT_TIME";
if (this.isUi) {
path = "/UI_SHARE_REPORT_TIME";
}
this.$get('/project_application/get/' + getCurrentProjectID() + path, res => {

View File

@ -186,7 +186,7 @@
<!-- 执行结果 -->
<el-drawer :visible.sync="runVisible" :destroy-on-close="true" direction="ltr" :withHeader="true" :modal="false"
size="90%">
<ms-api-report-detail @invisible="runVisible = false" @refresh="search" :infoDb="infoDb" :report-id="reportId" :currentProjectId="projectId"/>
<ms-api-report-detail @invisible="runVisible = false" @refresh="search" :infoDb="infoDb" :report-id="reportId" :currentProjectId="projectId" :is-plan="true"/>
</el-drawer>
</div>
</el-card>