fix(测试计划): 修改测试计划定时任务的配置可见项类型

--bug=1025626 --user=宋天阳 【测试跟踪】测试计划中只有ui测试用例-定时任务设置-其它配置显示资源池设置
https://www.tapd.cn/55049933/s/1364753
This commit is contained in:
song-tianyang 2023-04-20 14:37:44 +08:00 committed by 建国
parent d733631a29
commit 13bf6532d3
6 changed files with 19 additions and 21 deletions

View File

@ -98,7 +98,7 @@ public class HashTreeUtil {
return returnMap; return returnMap;
} }
public synchronized Map<String, List<String>> getEnvParamsMapByHashTree(HashTree hashTree) { public Map<String, List<String>> getEnvParamsMapByHashTree(HashTree hashTree) {
Map<String, List<String>> returnMap = new HashMap<>(); Map<String, List<String>> returnMap = new HashMap<>();
if (hashTree != null) { if (hashTree != null) {
for (Object hashTreeKey : hashTree.keySet()) { for (Object hashTreeKey : hashTree.keySet()) {
@ -116,8 +116,8 @@ public class HashTreeUtil {
JSR223Sampler processor = (JSR223Sampler) hashTreeKey; JSR223Sampler processor = (JSR223Sampler) hashTreeKey;
scriptValue = processor.getPropertyAsString(SCRIPT); scriptValue = processor.getPropertyAsString(SCRIPT);
} }
} catch (Exception ignored) { } catch (Exception e) {
LogUtil.error(ignored); LogUtil.error(e);
} }
if (StringUtils.isNotEmpty(scriptValue)) { if (StringUtils.isNotEmpty(scriptValue)) {

View File

@ -531,7 +531,7 @@ public class BaseEnvironmentService extends NodeTreeService<ApiModuleDTO> {
return baseApiTestEnvironmentMapper.selectNameById(id); return baseApiTestEnvironmentMapper.selectNameById(id);
} }
public synchronized ApiTestEnvironmentWithBLOBs getMockEnvironmentByProjectId(String projectId) { public ApiTestEnvironmentWithBLOBs getMockEnvironmentByProjectId(String projectId) {
SystemParameterService systemParameterService = CommonBeanFactory.getBean(SystemParameterService.class); SystemParameterService systemParameterService = CommonBeanFactory.getBean(SystemParameterService.class);
BaseSystemConfigDTO baseSystemConfigDTO = systemParameterService.getBaseInfo(); BaseSystemConfigDTO baseSystemConfigDTO = systemParameterService.getBaseInfo();

View File

@ -22,7 +22,7 @@ public class ChromeUtil {
return chromeUtils; return chromeUtils;
} }
private synchronized WebDriver genWebDriver(String seleniumUrl, String language) { private WebDriver genWebDriver(String seleniumUrl, String language) {
if (StringUtils.isEmpty(seleniumUrl)) { if (StringUtils.isEmpty(seleniumUrl)) {
LogUtil.error("Headless request is null! " + seleniumUrl); LogUtil.error("Headless request is null! " + seleniumUrl);
return null; return null;
@ -52,7 +52,7 @@ public class ChromeUtil {
return driver; return driver;
} }
public synchronized Map<String, String> getImageInfo(HeadlessRequest request, String langurage) { public Map<String, String> getImageInfo(HeadlessRequest request, String langurage) {
Map<String, String> returnMap = new HashMap<>(); Map<String, String> returnMap = new HashMap<>();
if (request.isEmpty()) { if (request.isEmpty()) {
return returnMap; return returnMap;

View File

@ -160,7 +160,7 @@ public class TestPlanService {
@Resource @Resource
private ApiPoolDebugService apiPoolDebugService; private ApiPoolDebugService apiPoolDebugService;
public synchronized TestPlan addTestPlan(AddTestPlanRequest testPlan) { public TestPlan addTestPlan(AddTestPlanRequest testPlan) {
if (getTestPlanByName(testPlan.getName()).size() > 0) { if (getTestPlanByName(testPlan.getName()).size() > 0) {
MSException.throwException(Translator.get("plan_name_already_exists")); MSException.throwException(Translator.get("plan_name_already_exists"));
} }
@ -678,7 +678,7 @@ public class TestPlanService {
} catch (Exception e) { } catch (Exception e) {
sqlSession.rollback(); sqlSession.rollback();
throw new RuntimeException(e); throw new RuntimeException(e);
}finally { } finally {
if (sqlSession != null && sqlSessionFactory != null) { if (sqlSession != null && sqlSessionFactory != null) {
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory); SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
} }
@ -2009,7 +2009,7 @@ public class TestPlanService {
//未勾选资源池运行时将资源池ID赋空 //未勾选资源池运行时将资源池ID赋空
runModeConfig.setResourcePoolId(null); runModeConfig.setResourcePoolId(null);
} }
String apiRunConfig = JSON.toJSONString(runModeConfig); String apiRunConfig = JSON.toJSONString(runModeConfig);
return this.runTestPlan(testPlanId, testplanRunRequest.getProjectId(), return this.runTestPlan(testPlanId, testplanRunRequest.getProjectId(),
testplanRunRequest.getUserId(), testplanRunRequest.getTriggerMode(), testplanRunRequest.getReportId(), testplanRunRequest.getExecutionWay(), apiRunConfig); testplanRunRequest.getUserId(), testplanRunRequest.getTriggerMode(), testplanRunRequest.getReportId(), testplanRunRequest.getExecutionWay(), apiRunConfig);

View File

@ -86,12 +86,12 @@
<span class="ms-mode-span">{{ $t("run_mode.title") }}</span> <span class="ms-mode-span">{{ $t("run_mode.title") }}</span>
<el-radio-group v-model="runConfig.mode" @change="changeMode"> <el-radio-group v-model="runConfig.mode" @change="changeMode">
<el-radio label="serial">{{ $t("run_mode.serial") }}</el-radio> <el-radio label="serial">{{ $t("run_mode.serial") }}</el-radio>
<el-radio label="parallel">{{ <el-radio label="parallel"
$t("run_mode.parallel") >{{ $t("run_mode.parallel") }}
}}</el-radio> </el-radio>
</el-radio-group> </el-radio-group>
</div> </div>
<div style="margin-top: 10px" v-if="haveUICase"> <div style="margin-top: 10px">
<span class="ms-mode-span">{{ $t("浏览器") }}</span> <span class="ms-mode-span">{{ $t("浏览器") }}</span>
<el-select <el-select
size="mini" size="mini"
@ -214,16 +214,16 @@
<el-row> <el-row>
<el-col :span="18" :offset="3"> <el-col :span="18" :offset="3">
<div> <div>
<el-checkbox v-model="runConfig.onSampleError">{{ <el-checkbox v-model="runConfig.onSampleError"
$t("api_test.fail_to_stop") >{{ $t("api_test.fail_to_stop") }}
}}</el-checkbox> </el-checkbox>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
<div v-if="haveUICase"> <div>
<el-row> <el-row>
<el-col :span="3"> &nbsp; </el-col> <el-col :span="3"> &nbsp;</el-col>
<el-col :span="18"> <el-col :span="18">
<div style="margin-top: 10px"> <div style="margin-top: 10px">
<el-checkbox v-model="runConfig.headlessEnabled"> <el-checkbox v-model="runConfig.headlessEnabled">

View File

@ -1059,9 +1059,7 @@ export default {
async scheduleTask(row) { async scheduleTask(row) {
row.redirectFrom = "testPlan"; row.redirectFrom = "testPlan";
this.currentPlanId = row.id; this.currentPlanId = row.id;
this.haveUIScenario().then(() => { this.$refs.scheduleMaintain.open(row);
this.$refs.scheduleMaintain.open(row);
});
}, },
saveSortField(key, orders) { saveSortField(key, orders) {
saveLastTableSortField(key, JSON.stringify(orders)); saveLastTableSortField(key, JSON.stringify(orders));