Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
70ba39912d
|
@ -1,6 +1,6 @@
|
||||||
[submodule "backend/src/main/java/io/metersphere/xpack"]
|
[submodule "backend/src/main/java/io/metersphere/xpack"]
|
||||||
path = backend/src/main/java/io/metersphere/xpack
|
path = backend/src/main/java/io/metersphere/xpack
|
||||||
url = https://github.com/metersphere/xpack-backend.git
|
url = git@github.com:metersphere/xpack-backend.git
|
||||||
[submodule "frontend/src/business/components/xpack"]
|
[submodule "frontend/src/business/components/xpack"]
|
||||||
path = frontend/src/business/components/xpack
|
path = frontend/src/business/components/xpack
|
||||||
url = https://github.com/metersphere/xpack-frontend.git
|
url = git@github.com:metersphere/xpack-frontend.git
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
pipeline {
|
||||||
|
agent {
|
||||||
|
node {
|
||||||
|
label 'master'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
options { quietPeriod(1200) }
|
||||||
|
parameters {
|
||||||
|
string(name: 'IMAGE_NAME', defaultValue: 'metersphere', description: '构建后的 Docker 镜像名称')
|
||||||
|
string(name: 'IMAGE_FREFIX', defaultValue: 'registry.cn-qingdao.aliyuncs.com/metersphere', description: '构建后的 Docker 镜像带仓库名的前缀')
|
||||||
|
}
|
||||||
|
stages {
|
||||||
|
stage('Build/Test') {
|
||||||
|
steps {
|
||||||
|
configFileProvider([configFile(fileId: 'metersphere-maven', targetLocation: 'settings.xml')]) {
|
||||||
|
sh "mvn clean package --settings ./settings.xml"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Docker build & push') {
|
||||||
|
steps {
|
||||||
|
sh "docker build --build-arg MS_VERSION=\${TAG_NAME:-\$BRANCH_NAME}-b\${BUILD_NUMBER} -t ${IMAGE_NAME}:\${TAG_NAME:-\$BRANCH_NAME} ."
|
||||||
|
sh "docker tag ${IMAGE_NAME}:\${TAG_NAME:-\$BRANCH_NAME} ${IMAGE_FREFIX}/${IMAGE_NAME}:\${TAG_NAME:-\$BRANCH_NAME}"
|
||||||
|
sh "docker push ${IMAGE_FREFIX}/${IMAGE_NAME}:\${TAG_NAME:-\$BRANCH_NAME}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
post('Notification') {
|
||||||
|
always {
|
||||||
|
sh "echo \$WEBHOOK\n"
|
||||||
|
withCredentials([string(credentialsId: 'wechat-bot-webhook', variable: 'WEBHOOK')]) {
|
||||||
|
qyWechatNotification failSend: true, mentionedId: '', mentionedMobile: '', webhookUrl: "$WEBHOOK"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -44,10 +44,14 @@ public class MsScenario extends MsTestElement {
|
||||||
@JSONField(ordinal = 23)
|
@JSONField(ordinal = 23)
|
||||||
private List<KeyValue> variables;
|
private List<KeyValue> variables;
|
||||||
|
|
||||||
|
@JSONField(ordinal = 24)
|
||||||
|
private boolean enableCookieShare;
|
||||||
|
|
||||||
public void toHashTree(HashTree tree, List<MsTestElement> hashTree, ParameterConfig config) {
|
public void toHashTree(HashTree tree, List<MsTestElement> hashTree, ParameterConfig config) {
|
||||||
if (!this.isEnable()) {
|
if (!this.isEnable()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
config.setEnableCookieShare(enableCookieShare);
|
||||||
if (StringUtils.isNotEmpty(environmentId)) {
|
if (StringUtils.isNotEmpty(environmentId)) {
|
||||||
ApiTestEnvironmentService environmentService = CommonBeanFactory.getBean(ApiTestEnvironmentService.class);
|
ApiTestEnvironmentService environmentService = CommonBeanFactory.getBean(ApiTestEnvironmentService.class);
|
||||||
ApiTestEnvironmentWithBLOBs environment = environmentService.get(environmentId);
|
ApiTestEnvironmentWithBLOBs environment = environmentService.get(environmentId);
|
||||||
|
|
|
@ -5,6 +5,7 @@ import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.apache.jmeter.control.LoopController;
|
import org.apache.jmeter.control.LoopController;
|
||||||
|
import org.apache.jmeter.protocol.http.control.CookieManager;
|
||||||
import org.apache.jmeter.save.SaveService;
|
import org.apache.jmeter.save.SaveService;
|
||||||
import org.apache.jmeter.testelement.TestElement;
|
import org.apache.jmeter.testelement.TestElement;
|
||||||
import org.apache.jmeter.threads.ThreadGroup;
|
import org.apache.jmeter.threads.ThreadGroup;
|
||||||
|
@ -17,9 +18,17 @@ import java.util.List;
|
||||||
@JSONType(typeName = "ThreadGroup")
|
@JSONType(typeName = "ThreadGroup")
|
||||||
public class MsThreadGroup extends MsTestElement {
|
public class MsThreadGroup extends MsTestElement {
|
||||||
private String type = "ThreadGroup";
|
private String type = "ThreadGroup";
|
||||||
|
private boolean enableCookieShare;
|
||||||
|
|
||||||
public void toHashTree(HashTree tree, List<MsTestElement> hashTree, ParameterConfig config) {
|
public void toHashTree(HashTree tree, List<MsTestElement> hashTree, ParameterConfig config) {
|
||||||
final HashTree groupTree = tree.add(getThreadGroup());
|
final HashTree groupTree = tree.add(getThreadGroup());
|
||||||
|
if ((config != null && config.isEnableCookieShare()) || enableCookieShare) {
|
||||||
|
CookieManager cookieManager = new CookieManager();
|
||||||
|
cookieManager.setName("CookieManager");
|
||||||
|
cookieManager.setClearEachIteration(false);
|
||||||
|
cookieManager.setControlledByThread(false);
|
||||||
|
groupTree.add(cookieManager);
|
||||||
|
}
|
||||||
if (CollectionUtils.isNotEmpty(hashTree)) {
|
if (CollectionUtils.isNotEmpty(hashTree)) {
|
||||||
hashTree.forEach(el -> {
|
hashTree.forEach(el -> {
|
||||||
el.toHashTree(groupTree, el.getHashTree(), config);
|
el.toHashTree(groupTree, el.getHashTree(), config);
|
||||||
|
|
|
@ -12,4 +12,7 @@ public class ParameterConfig {
|
||||||
private EnvironmentConfig config;
|
private EnvironmentConfig config;
|
||||||
// 公共场景参数
|
// 公共场景参数
|
||||||
private List<KeyValue> variables;
|
private List<KeyValue> variables;
|
||||||
|
// 公共Cookie
|
||||||
|
private boolean enableCookieShare;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -162,6 +162,9 @@ public class MsHTTPSamplerProxy extends MsTestElement {
|
||||||
// 请求体
|
// 请求体
|
||||||
if (!StringUtils.equals(this.getMethod(), "GET")) {
|
if (!StringUtils.equals(this.getMethod(), "GET")) {
|
||||||
List<KeyValue> bodyParams = this.body.getBodyParams(sampler, this.getId());
|
List<KeyValue> bodyParams = this.body.getBodyParams(sampler, this.getId());
|
||||||
|
if (this.body.getType().equals("Form Data")) {
|
||||||
|
sampler.setDoMultipart(true);
|
||||||
|
}
|
||||||
sampler.setArguments(httpArguments(bodyParams));
|
sampler.setArguments(httpArguments(bodyParams));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -280,7 +280,7 @@ public class ApiAutomationService {
|
||||||
// 调用执行方法
|
// 调用执行方法
|
||||||
jMeterService.runDefinition(request.getId(), jmeterTestPlanHashTree, request.getReportId(), ApiRunMode.SCENARIO.name());
|
jMeterService.runDefinition(request.getId(), jmeterTestPlanHashTree, request.getReportId(), ApiRunMode.SCENARIO.name());
|
||||||
|
|
||||||
createAPIReportResult(request.getId(), request.getTriggerMode() == null ? ReportTriggerMode.API.name() : request.getTriggerMode());
|
createAPIReportResult(request.getId(), request.getTriggerMode() == null ? ReportTriggerMode.MANUAL.name() : request.getTriggerMode());
|
||||||
return request.getId();
|
return request.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -201,6 +201,7 @@ public class ApiDefinitionService {
|
||||||
test.setName(request.getName());
|
test.setName(request.getName());
|
||||||
test.setPath(request.getPath());
|
test.setPath(request.getPath());
|
||||||
test.setProjectId(request.getProjectId());
|
test.setProjectId(request.getProjectId());
|
||||||
|
request.getRequest().setId(request.getId());
|
||||||
test.setRequest(JSONObject.toJSONString(request.getRequest()));
|
test.setRequest(JSONObject.toJSONString(request.getRequest()));
|
||||||
test.setUpdateTime(System.currentTimeMillis());
|
test.setUpdateTime(System.currentTimeMillis());
|
||||||
test.setStatus(request.getStatus());
|
test.setStatus(request.getStatus());
|
||||||
|
@ -227,6 +228,7 @@ public class ApiDefinitionService {
|
||||||
test.setPath(request.getPath());
|
test.setPath(request.getPath());
|
||||||
test.setModuleId(request.getModuleId());
|
test.setModuleId(request.getModuleId());
|
||||||
test.setProjectId(request.getProjectId());
|
test.setProjectId(request.getProjectId());
|
||||||
|
request.getRequest().setId(request.getId());
|
||||||
test.setRequest(JSONObject.toJSONString(request.getRequest()));
|
test.setRequest(JSONObject.toJSONString(request.getRequest()));
|
||||||
test.setCreateTime(System.currentTimeMillis());
|
test.setCreateTime(System.currentTimeMillis());
|
||||||
test.setUpdateTime(System.currentTimeMillis());
|
test.setUpdateTime(System.currentTimeMillis());
|
||||||
|
|
|
@ -121,9 +121,11 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="list" resultType="io.metersphere.track.dto.TestPlanCaseDTO">
|
<select id="list" resultType="io.metersphere.track.dto.TestPlanCaseDTO">
|
||||||
select test_plan_test_case.id as id, test_case.id as caseId, test_case.name, test_case.priority, test_case.type,
|
select test_plan_test_case.id as id, test_case.id as caseId, test_case.name, test_case.priority,
|
||||||
|
test_case.type,test_case.test_id as testId,
|
||||||
test_case.node_path, test_case.method, test_case.num, test_plan_test_case.executor, test_plan_test_case.status,
|
test_case.node_path, test_case.method, test_case.num, test_plan_test_case.executor, test_plan_test_case.status,
|
||||||
test_plan_test_case.update_time, test_case_node.name as model, project.name as projectName, test_plan_test_case.plan_id as planId
|
test_plan_test_case.update_time, test_case_node.name as model, project.name as projectName,
|
||||||
|
test_plan_test_case.plan_id as planId
|
||||||
from test_plan_test_case
|
from test_plan_test_case
|
||||||
inner join test_case on test_plan_test_case.case_id = test_case.id
|
inner join test_case on test_plan_test_case.case_id = test_case.id
|
||||||
left join test_case_node on test_case_node.id=test_case.node_id
|
left join test_case_node on test_case_node.id=test_case.node_id
|
||||||
|
|
|
@ -150,8 +150,8 @@ public class TestPlanService {
|
||||||
if (!StringUtils.isBlank(testPlan.getStatus())) {
|
if (!StringUtils.isBlank(testPlan.getStatus())) {
|
||||||
BeanUtils.copyBean(testPlans, getTestPlan(testPlan.getId()));
|
BeanUtils.copyBean(testPlans, getTestPlan(testPlan.getId()));
|
||||||
String context = getTestPlanContext(testPlans, NoticeConstants.Event.UPDATE);
|
String context = getTestPlanContext(testPlans, NoticeConstants.Event.UPDATE);
|
||||||
User user = userMapper.selectByPrimaryKey(testPlan.getCreator());
|
User user = userMapper.selectByPrimaryKey(testPlans.getCreator());
|
||||||
Map<String, Object> paramMap = getTestPlanParamMap(testPlan);
|
Map<String, Object> paramMap = getTestPlanParamMap(testPlans);
|
||||||
paramMap.put("creator", user.getName());
|
paramMap.put("creator", user.getName());
|
||||||
NoticeModel noticeModel = NoticeModel.builder()
|
NoticeModel noticeModel = NoticeModel.builder()
|
||||||
.context(context)
|
.context(context)
|
||||||
|
@ -533,8 +533,8 @@ public class TestPlanService {
|
||||||
try {
|
try {
|
||||||
BeanUtils.copyBean(_testPlans, testPlans);
|
BeanUtils.copyBean(_testPlans, testPlans);
|
||||||
String context = getTestPlanContext(_testPlans, NoticeConstants.Event.UPDATE);
|
String context = getTestPlanContext(_testPlans, NoticeConstants.Event.UPDATE);
|
||||||
User user = userMapper.selectByPrimaryKey(testPlan.getCreator());
|
User user = userMapper.selectByPrimaryKey(_testPlans.getCreator());
|
||||||
Map<String, Object> paramMap = getTestPlanParamMap(testPlan);
|
Map<String, Object> paramMap = getTestPlanParamMap(_testPlans);
|
||||||
paramMap.put("creator", user.getName());
|
paramMap.put("creator", user.getName());
|
||||||
NoticeModel noticeModel = NoticeModel.builder()
|
NoticeModel noticeModel = NoticeModel.builder()
|
||||||
.context(context)
|
.context(context)
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit efb49c9b4be136ce48e9550dc9c8a2975d9f4d7f
|
Subproject commit b5643ac73fb4a2db3f11b23a81848990d8e78703
|
|
@ -92,7 +92,8 @@
|
||||||
let testPlan = createComponent('TestPlan');
|
let testPlan = createComponent('TestPlan');
|
||||||
let threadGroup = createComponent('ThreadGroup');
|
let threadGroup = createComponent('ThreadGroup');
|
||||||
threadGroup.hashTree = [];
|
threadGroup.hashTree = [];
|
||||||
threadGroup.name = this.runData.name;
|
threadGroup.name = this.runData.name ? this.runData.name : "Debug-Scenario";
|
||||||
|
threadGroup.enableCookieShare = this.runData.enableCookieShare;
|
||||||
threadGroup.hashTree.push(this.runData);
|
threadGroup.hashTree.push(this.runData);
|
||||||
testPlan.hashTree.push(threadGroup);
|
testPlan.hashTree.push(threadGroup);
|
||||||
let reqObj = {id: this.reportId, reportId: this.reportId, environmentId: this.environment, testElement: testPlan};
|
let reqObj = {id: this.reportId, reportId: this.reportId, environmentId: this.environment, testElement: testPlan};
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<el-card class="card-content">
|
<el-card class="card-content">
|
||||||
<div class="ms-main-div">
|
<div class="ms-main-div" @click="showAll">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col>
|
<el-col>
|
||||||
<!--操作按钮-->
|
<!--操作按钮-->
|
||||||
|
@ -123,15 +123,17 @@
|
||||||
<el-col :span="6" class="ms-col-one">
|
<el-col :span="6" class="ms-col-one">
|
||||||
{{currentScenario.name ===undefined || ''? $t('api_test.scenario.name') : currentScenario.name}}
|
{{currentScenario.name ===undefined || ''? $t('api_test.scenario.name') : currentScenario.name}}
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="4" class="ms-col-one">
|
<el-col :span="3" class="ms-col-one">
|
||||||
{{$t('api_test.automation.step_total')}}:{{scenarioDefinition.length}}
|
{{$t('api_test.automation.step_total')}}:{{scenarioDefinition.length}}
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="4" class="ms-col-one">
|
<el-col :span="3" class="ms-col-one">
|
||||||
<el-link style="font-size: 13px" @click="showScenarioParameters">{{$t('api_test.automation.scenario_total')}}:
|
<el-link class="head" @click="showScenarioParameters">{{$t('api_test.automation.scenario_total')}}</el-link>
|
||||||
{{this.currentScenario.variables!=undefined?this.currentScenario.variables.length-1: 0}}
|
:{{this.currentScenario.variables!=undefined?this.currentScenario.variables.length-1: 0}}
|
||||||
</el-link>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="3">
|
||||||
|
<el-checkbox v-model="enableCookieShare" style="margin-top: 5px">{{ '共享cookie' }}</el-checkbox>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="7">
|
||||||
{{$t('api_test.definition.request.run_env')}}:
|
{{$t('api_test.definition.request.run_env')}}:
|
||||||
<el-select v-model="currentEnvironmentId" size="small" class="ms-htt-width"
|
<el-select v-model="currentEnvironmentId" size="small" class="ms-htt-width"
|
||||||
:placeholder="$t('api_test.definition.request.run_env')"
|
:placeholder="$t('api_test.definition.request.run_env')"
|
||||||
|
@ -157,7 +159,7 @@
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
<!-- 场景步骤内容 -->
|
<!-- 场景步骤内容 -->
|
||||||
<div style="margin-top: 10px" v-loading="loading">
|
<div v-loading="loading">
|
||||||
<el-tree node-key="resourceId" :props="props" :data="scenarioDefinition"
|
<el-tree node-key="resourceId" :props="props" :data="scenarioDefinition"
|
||||||
:default-expanded-keys="expandedNode"
|
:default-expanded-keys="expandedNode"
|
||||||
:expand-on-click-node="false"
|
:expand-on-click-node="false"
|
||||||
|
@ -197,37 +199,37 @@
|
||||||
<el-col :span="3" class="ms-left-cell">
|
<el-col :span="3" class="ms-left-cell">
|
||||||
<el-button type="primary" icon="el-icon-refresh" size="small" @click="showAll">{{$t('commons.show_all')}}</el-button>
|
<el-button type="primary" icon="el-icon-refresh" size="small" @click="showAll">{{$t('commons.show_all')}}</el-button>
|
||||||
<br/>
|
<br/>
|
||||||
<div v-if="operatingElements.indexOf('HTTPSamplerProxy')>0 || operatingElements.indexOf('DubboSampler')>0 || operatingElements.indexOf('JDBCSampler')>0 || operatingElements.indexOf('TCPSampler')>0 ">
|
<div v-if="operatingElements.indexOf('HTTPSamplerProxy')!=-1 || operatingElements.indexOf('DubboSampler')!=-1 || operatingElements.indexOf('JDBCSampler')!=-1 || operatingElements.indexOf('TCPSampler')!=-1 ">
|
||||||
<el-button class="ms-right-buttion ms-btn-1" size="small" @click="apiListImport">+{{$t('api_test.automation.api_list_import')}}</el-button>
|
<el-button class="ms-right-buttion ms-btn-1" size="small" @click="apiListImport">+{{$t('api_test.automation.api_list_import')}}</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="operatingElements.indexOf('OT_IMPORT')>0">
|
<div v-if="operatingElements.indexOf('OT_IMPORT')!=-1">
|
||||||
<el-button class="ms-right-buttion" size="small" style="color: #409EFF;background-color: #EEF5FE" @click="addComponent('OT_IMPORT')">+{{$t('api_test.automation.external_import')}}</el-button>
|
<el-button class="ms-right-buttion" size="small" style="color: #409EFF;background-color: #EEF5FE" @click="addComponent('OT_IMPORT')">+{{$t('api_test.automation.external_import')}}</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="operatingElements.indexOf('ConstantTimer')>0">
|
<div v-if="operatingElements.indexOf('ConstantTimer')!=-1">
|
||||||
<el-button class="ms-right-buttion ms-btn-3" size="small" @click="addComponent('ConstantTimer')">+{{$t('api_test.automation.wait_controller')}}</el-button>
|
<el-button class="ms-right-buttion ms-btn-3" size="small" @click="addComponent('ConstantTimer')">+{{$t('api_test.automation.wait_controller')}}</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="operatingElements.indexOf('IfController')>0">
|
<div v-if="operatingElements.indexOf('IfController')!=-1">
|
||||||
<el-button class="ms-right-buttion ms-btn-4" size="small" @click="addComponent('IfController')">+{{$t('api_test.automation.if_controller')}}</el-button>
|
<el-button class="ms-right-buttion ms-btn-4" size="small" @click="addComponent('IfController')">+{{$t('api_test.automation.if_controller')}}</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="operatingElements.indexOf('scenario')===0">
|
<div v-if="operatingElements.indexOf('scenario')===0">
|
||||||
<el-button class="ms-right-buttion ms-btn-5" size="small" @click="addComponent('scenario')">+{{$t('api_test.automation.scenario_import')}}</el-button>
|
<el-button class="ms-right-buttion ms-btn-5" size="small" @click="addComponent('scenario')">+{{$t('api_test.automation.scenario_import')}}</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="operatingElements.indexOf('JSR223Processor')>0">
|
<div v-if="operatingElements.indexOf('JSR223Processor')!=-1">
|
||||||
<el-button class="ms-right-buttion ms-btn-6" size="small" @click="addComponent('JSR223Processor')">+{{$t('api_test.automation.customize_script')}}</el-button>
|
<el-button class="ms-right-buttion ms-btn-6" size="small" @click="addComponent('JSR223Processor')">+{{$t('api_test.automation.customize_script')}}</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="operatingElements.indexOf('CustomizeReq')>0">
|
<div v-if="operatingElements.indexOf('CustomizeReq')!=-1">
|
||||||
<el-button class="ms-right-buttion ms-btn-7" size="small" @click="addComponent('CustomizeReq')">+{{$t('api_test.automation.customize_req')}}</el-button>
|
<el-button class="ms-right-buttion ms-btn-7" size="small" @click="addComponent('CustomizeReq')">+{{$t('api_test.automation.customize_req')}}</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="operatingElements.indexOf('JSR223PreProcessor')>0">
|
<div v-if="operatingElements.indexOf('JSR223PreProcessor')!=-1">
|
||||||
<el-button class="ms-right-buttion ms-btn-8" size="small" @click="addComponent('JSR223PreProcessor')">+{{$t('api_test.definition.request.pre_script')}}</el-button>
|
<el-button class="ms-right-buttion ms-btn-8" size="small" @click="addComponent('JSR223PreProcessor')">+{{$t('api_test.definition.request.pre_script')}}</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="operatingElements.indexOf('JSR223PostProcessor')>0">
|
<div v-if="operatingElements.indexOf('JSR223PostProcessor')!=-1">
|
||||||
<el-button class="ms-right-buttion ms-btn-9" size="small" @click="addComponent('JSR223PostProcessor')">+{{$t('api_test.definition.request.post_script')}}</el-button>
|
<el-button class="ms-right-buttion ms-btn-9" size="small" @click="addComponent('JSR223PostProcessor')">+{{$t('api_test.definition.request.post_script')}}</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="operatingElements.indexOf('Assertions')>0">
|
<div v-if="operatingElements.indexOf('Assertions')!=-1">
|
||||||
<el-button class="ms-right-buttion ms-btn-10" size="small" @click="addComponent('Assertions')">+{{$t('api_test.definition.request.assertions_rule')}}</el-button>
|
<el-button class="ms-right-buttion ms-btn-10" size="small" @click="addComponent('Assertions')">+{{$t('api_test.definition.request.assertions_rule')}}</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="operatingElements.indexOf('Extract')>0">
|
<div v-if="operatingElements.indexOf('Extract')!=-1">
|
||||||
<el-button class="ms-right-buttion ms-btn-11" size="small" @click="addComponent('Extract')">+{{$t('api_test.definition.request.extract_param')}}</el-button>
|
<el-button class="ms-right-buttion ms-btn-11" size="small" @click="addComponent('Extract')">+{{$t('api_test.definition.request.extract_param')}}</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -236,7 +238,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!--接口列表-->
|
<!--接口列表-->
|
||||||
<el-drawer :visible.sync="apiListVisible" :destroy-on-close="true" direction="ltr" :withHeader="false" :title="$t('api_test.automation.api_list_import')" :modal="false" size="90%">
|
<el-drawer :visible.sync="apiListVisible" :destroy-on-close="true" direction="ltr" :withHeader="true" :modal="false" size="90%">
|
||||||
<ms-api-definition :visible="visibleRef" :currentRow="currentRow"/>
|
<ms-api-definition :visible="visibleRef" :currentRow="currentRow"/>
|
||||||
<el-button style="float: right;margin: 0px 20px 0px" type="primary" @click="pushApiOrCase('REF')">{{$t('api_test.scenario.reference')}}</el-button>
|
<el-button style="float: right;margin: 0px 20px 0px" type="primary" @click="pushApiOrCase('REF')">{{$t('api_test.scenario.reference')}}</el-button>
|
||||||
<el-button style="float: right;" type="primary" @click="pushApiOrCase('Copy')">{{ $t('commons.copy') }}</el-button>
|
<el-button style="float: right;" type="primary" @click="pushApiOrCase('Copy')">{{ $t('commons.copy') }}</el-button>
|
||||||
|
@ -245,7 +247,6 @@
|
||||||
<!--自定义接口-->
|
<!--自定义接口-->
|
||||||
<el-drawer :visible.sync="customizeVisible" :destroy-on-close="true" direction="ltr" :withHeader="false" :title="$t('api_test.automation.customize_req')" style="overflow: auto" :modal="false" size="90%">
|
<el-drawer :visible.sync="customizeVisible" :destroy-on-close="true" direction="ltr" :withHeader="false" :title="$t('api_test.automation.customize_req')" style="overflow: auto" :modal="false" size="90%">
|
||||||
<ms-api-customize :request="customizeRequest" @addCustomizeApi="addCustomizeApi"/>
|
<ms-api-customize :request="customizeRequest" @addCustomizeApi="addCustomizeApi"/>
|
||||||
<el-button style="float: right;margin: 20px" @click="addCustomizeApi">{{$t('commons.save')}}</el-button>
|
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
<!--场景导入 -->
|
<!--场景导入 -->
|
||||||
<el-drawer :visible.sync="scenarioVisible" :destroy-on-close="true" direction="ltr" :withHeader="false" :title="$t('api_test.automation.scenario_import')" style="overflow: auto" :modal="false" size="90%">
|
<el-drawer :visible.sync="scenarioVisible" :destroy-on-close="true" direction="ltr" :withHeader="false" :title="$t('api_test.automation.scenario_import')" style="overflow: auto" :modal="false" size="90%">
|
||||||
|
@ -360,6 +361,7 @@
|
||||||
reportId: "",
|
reportId: "",
|
||||||
projectId: "",
|
projectId: "",
|
||||||
visibleRef: "",
|
visibleRef: "",
|
||||||
|
enableCookieShare: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
@ -486,6 +488,9 @@
|
||||||
} else {
|
} else {
|
||||||
request = item.request;
|
request = item.request;
|
||||||
}
|
}
|
||||||
|
if (item.protocol) {
|
||||||
|
request.protocol = item.protocol;
|
||||||
|
}
|
||||||
request.id = item.id;
|
request.id = item.id;
|
||||||
request.name = item.name;
|
request.name = item.name;
|
||||||
request.refType = refType;
|
request.refType = refType;
|
||||||
|
@ -552,7 +557,7 @@
|
||||||
remove(row, node) {
|
remove(row, node) {
|
||||||
const parent = node.parent
|
const parent = node.parent
|
||||||
const hashTree = parent.data.hashTree || parent.data;
|
const hashTree = parent.data.hashTree || parent.data;
|
||||||
const index = hashTree.findIndex(d => d.id != undefined && row.id != undefined && d.id === row.id)
|
const index = hashTree.findIndex(d => d.resourceId != undefined && row.resourceId != undefined && d.resourceId === row.resourceId)
|
||||||
hashTree.splice(index, 1);
|
hashTree.splice(index, 1);
|
||||||
this.sort();
|
this.sort();
|
||||||
this.reload();
|
this.reload();
|
||||||
|
@ -581,7 +586,7 @@
|
||||||
}
|
}
|
||||||
this.debugData = {
|
this.debugData = {
|
||||||
id: this.currentScenario.id, name: this.currentScenario.name, type: "scenario",
|
id: this.currentScenario.id, name: this.currentScenario.name, type: "scenario",
|
||||||
variables: this.currentScenario.variables, referenced: 'Created',
|
variables: this.currentScenario.variables, referenced: 'Created', enableCookieShare: this.enableCookieShare,
|
||||||
environmentId: this.currentEnvironmentId, hashTree: this.scenarioDefinition
|
environmentId: this.currentEnvironmentId, hashTree: this.scenarioDefinition
|
||||||
};
|
};
|
||||||
this.reportId = getUUID().substring(0, 8);
|
this.reportId = getUUID().substring(0, 8);
|
||||||
|
@ -606,13 +611,16 @@
|
||||||
environmentConfigClose() {
|
environmentConfigClose() {
|
||||||
this.getEnvironments();
|
this.getEnvironments();
|
||||||
},
|
},
|
||||||
allowDrop(draggingNode, dropNode, type) {
|
allowDrop(draggingNode, dropNode, dropType) {
|
||||||
if (dropNode.data.type === draggingNode.data.type || ELEMENTS.get(dropNode.data.type).indexOf(draggingNode.data.type) != -1) {
|
if (dropType != "inner") {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if (dropType === "inner" && ELEMENTS.get(dropNode.data.type).indexOf(draggingNode.data.type) != -1) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
allowDrag() {
|
allowDrag(draggingNode, dropNode, dropType) {
|
||||||
this.sort();
|
this.sort();
|
||||||
this.reload();
|
this.reload();
|
||||||
},
|
},
|
||||||
|
@ -722,6 +730,7 @@
|
||||||
if (obj) {
|
if (obj) {
|
||||||
this.currentEnvironmentId = obj.environmentId;
|
this.currentEnvironmentId = obj.environmentId;
|
||||||
this.currentScenario.variables = obj.variables;
|
this.currentScenario.variables = obj.variables;
|
||||||
|
this.enableCookieShare = obj.enableCookieShare;
|
||||||
this.scenarioDefinition = obj.hashTree;
|
this.scenarioDefinition = obj.hashTree;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -738,7 +747,7 @@
|
||||||
this.currentScenario.modulePath = this.getPath(this.currentScenario.apiScenarioModuleId);
|
this.currentScenario.modulePath = this.getPath(this.currentScenario.apiScenarioModuleId);
|
||||||
// 构建一个场景对象 方便引用处理
|
// 构建一个场景对象 方便引用处理
|
||||||
let scenario = {
|
let scenario = {
|
||||||
id: this.currentScenario.id, name: this.currentScenario.name, variables: this.currentScenario.variables,
|
id: this.currentScenario.id, enableCookieShare: this.enableCookieShare, name: this.currentScenario.name, variables: this.currentScenario.variables,
|
||||||
type: "scenario", referenced: 'Created', environmentId: this.currentEnvironmentId, hashTree: this.scenarioDefinition
|
type: "scenario", referenced: 'Created', environmentId: this.currentEnvironmentId, hashTree: this.scenarioDefinition
|
||||||
};
|
};
|
||||||
this.currentScenario.scenarioDefinition = scenario;
|
this.currentScenario.scenarioDefinition = scenario;
|
||||||
|
@ -899,4 +908,9 @@
|
||||||
/deep/ .el-drawer__header {
|
/deep/ .el-drawer__header {
|
||||||
margin-bottom: 0px;
|
margin-bottom: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.head {
|
||||||
|
border-bottom: 1px solid #474849;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
export const ELEMENTS = new Map([
|
export const ELEMENTS = new Map([
|
||||||
['ALL', ["scenario", "HTTPSamplerProxy", "DubboSampler", "JDBCSampler", "TCPSampler", "OT_IMPORT", "IfController", "ConstantTimer", "JSR223Processor", "JSR223PreProcessor", "JSR223PostProcessor", "Assertions", "Extract", "CustomizeReq"]],
|
['ALL', ["scenario", "HTTPSamplerProxy", "DubboSampler", "JDBCSampler", "TCPSampler", "OT_IMPORT", "IfController", "ConstantTimer", "JSR223Processor", "CustomizeReq"]],
|
||||||
['scenario', ["API", "CASE", "OT_IMPORT", "IfController", "ConstantTimer", "JSR223Processor", "JSR223PreProcessor", "JSR223PostProcessor", "Assertions", "Extract", "CustomizeReq"]],
|
['scenario', ["HTTPSamplerProxy", "DubboSampler", "JDBCSampler", "TCPSampler", "CASE", "OT_IMPORT", "IfController", "ConstantTimer", "JSR223Processor", "CustomizeReq"]],
|
||||||
['HTTPSamplerProxy', ["IfController", "ConstantTimer", "JSR223Processor", "JSR223PreProcessor", "JSR223PostProcessor", "Assertions", "Extract"]],
|
['HTTPSamplerProxy', ["ConstantTimer", "JSR223PreProcessor", "JSR223PostProcessor", "Assertions", "Extract"]],
|
||||||
['DubboSampler', ["IfController", "ConstantTimer", "JSR223Processor", "JSR223PreProcessor", "JSR223PostProcessor", "Assertions", "Extract"]],
|
['DubboSampler', ["ConstantTimer", "JSR223PreProcessor", "JSR223PostProcessor", "Assertions", "Extract"]],
|
||||||
['JDBCSampler', ["IfController", "ConstantTimer", "JSR223Processor", "JSR223PreProcessor", "JSR223PostProcessor", "Assertions", "Extract"]],
|
['JDBCSampler', ["ConstantTimer", "JSR223PreProcessor", "JSR223PostProcessor", "Assertions", "Extract"]],
|
||||||
['TCPSampler', ["IfController", "ConstantTimer", "JSR223Processor", "JSR223PreProcessor", "JSR223PostProcessor", "Assertions", "Extract"]],
|
['TCPSampler', ["ConstantTimer", "JSR223PreProcessor", "JSR223PostProcessor", "Assertions", "Extract"]],
|
||||||
['OT_IMPORT', []],
|
['OT_IMPORT', ["ConstantTimer", "JSR223PreProcessor", "JSR223PostProcessor", "Assertions", "Extract"]],
|
||||||
['IfController', ["HTTPSamplerProxy", "DubboSampler", "JDBCSampler", "TCPSampler", "OT_IMPORT", "ConstantTimer", "JSR223Processor", "JSR223PreProcessor", "JSR223PostProcessor", "Assertions", "Extract", "CustomizeReq"]],
|
['IfController', ["IfController", "HTTPSamplerProxy", "DubboSampler", "JDBCSampler", "TCPSampler", "OT_IMPORT", "ConstantTimer", "JSR223Processor", "JSR223PreProcessor", "JSR223PostProcessor", "Assertions", "Extract", "CustomizeReq"]],
|
||||||
['ConstantTimer', ["HTTPSamplerProxy", "DubboSampler", "JDBCSampler", "TCPSampler", "OT_IMPORT", "IfController", "JSR223Processor", "JSR223PreProcessor", "JSR223PostProcessor", "Assertions", "Extract", "CustomizeReq"]],
|
['ConstantTimer', []],
|
||||||
['JSR223Processor', []],
|
['JSR223Processor', ["ConstantTimer", "JSR223PreProcessor", "JSR223PostProcessor", "Assertions", "Extract"]],
|
||||||
['JSR223PreProcessor', []],
|
['JSR223PreProcessor', []],
|
||||||
['JSR223PostProcessor', []],
|
['JSR223PostProcessor', []],
|
||||||
['Assertions', []],
|
['Assertions', []],
|
||||||
['Extract', []],
|
['Extract', []],
|
||||||
['CustomizeReq', ["HTTPSamplerProxy", "DubboSampler", "JDBCSampler", "TCPSampler", "OT_IMPORT", "IfController", "ConstantTimer", "JSR223Processor", "JSR223PreProcessor", "JSR223PostProcessor", "Assertions", "Extract"]],
|
['CustomizeReq', ["ConstantTimer", "JSR223PreProcessor", "JSR223PostProcessor", "Assertions", "Extract"]],
|
||||||
])
|
])
|
||||||
|
|
||||||
export const ELEMENT_TYPE = {
|
export const ELEMENT_TYPE = {
|
||||||
|
|
|
@ -8,9 +8,9 @@
|
||||||
<div class="variable-combine"> {{api.name}}</div>
|
<div class="variable-combine"> {{api.name}}</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="api.protocol==='HTTP'? 1:3">
|
<el-col :span="api.protocol==='HTTP'? 1:3">
|
||||||
<ms-tag v-if="api.status == 'Prepare'" type="info" effect="plain" :content="$t('test_track.plan.plan_status_prepare')"/>
|
<el-tag size="mini" :style="{'background-color': getColor(true, api.method), border: getColor(true, api.method)}" class="api-el-tag">
|
||||||
<ms-tag v-if="api.status == 'Underway'" type="warning" effect="plain" :content="$t('test_track.plan.plan_status_running')"/>
|
{{ api.method}}
|
||||||
<ms-tag v-if="api.status == 'Completed'" type="success" effect="plain" :content="$t('test_track.plan.plan_status_completed')"/>
|
</el-tag>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="api.protocol==='HTTP'? 4:0">
|
<el-col :span="api.protocol==='HTTP'? 4:0">
|
||||||
<div class="variable-combine" style="margin-left: 10px">{{api.path ===null ? " " : api.path}}</div>
|
<div class="variable-combine" style="margin-left: 10px">{{api.path ===null ? " " : api.path}}</div>
|
||||||
|
@ -151,6 +151,7 @@
|
||||||
import MsTcpBasisParameters from "../../../definition/components/request/tcp/BasisParameters";
|
import MsTcpBasisParameters from "../../../definition/components/request/tcp/BasisParameters";
|
||||||
import MsDubboBasisParameters from "../../../definition/components/request/dubbo/BasisParameters";
|
import MsDubboBasisParameters from "../../../definition/components/request/dubbo/BasisParameters";
|
||||||
import MsApiExtendBtns from "../../../definition/components/reference/ApiExtendBtns";
|
import MsApiExtendBtns from "../../../definition/components/reference/ApiExtendBtns";
|
||||||
|
import {API_METHOD_COLOUR} from "../../../definition/model/JsonData";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ApiCaseList',
|
name: 'ApiCaseList',
|
||||||
|
@ -192,7 +193,7 @@
|
||||||
reportId: "",
|
reportId: "",
|
||||||
projectId: "",
|
projectId: "",
|
||||||
checkedCases: new Set(),
|
checkedCases: new Set(),
|
||||||
|
methodColorMap: new Map(API_METHOD_COLOUR),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
@ -403,6 +404,11 @@
|
||||||
environmentConfigClose() {
|
environmentConfigClose() {
|
||||||
this.getEnvironments();
|
this.getEnvironments();
|
||||||
},
|
},
|
||||||
|
getColor(enable, method) {
|
||||||
|
if (enable) {
|
||||||
|
return this.methodColorMap.get(method);
|
||||||
|
}
|
||||||
|
},
|
||||||
caseChecked(row) {
|
caseChecked(row) {
|
||||||
row.protocol = this.api.protocol;
|
row.protocol = this.api.protocol;
|
||||||
row.hashTree = [];
|
row.hashTree = [];
|
||||||
|
@ -477,6 +483,9 @@
|
||||||
padding: 7px;
|
padding: 7px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.api-el-tag {
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
.is-selected {
|
.is-selected {
|
||||||
background: #EFF7FF;
|
background: #EFF7FF;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<ms-container>
|
<ms-container>
|
||||||
<ms-aside-container>
|
<ms-aside-container>
|
||||||
<ms-node-tree @selectModule="selectModule" @getApiModuleTree="initTree" @changeProtocol="changeProtocol"
|
<ms-node-tree @nodeSelectEvent="selectModule" @getApiModuleTree="initTree" @protocolChange="changeProtocol"
|
||||||
@refresh="refresh" @saveAsEdit="editApi" @exportAPI="exportAPI"/>
|
@refresh="refresh" @saveAsEdit="editApi" @exportAPI="exportAPI"/>
|
||||||
</ms-aside-container>
|
</ms-aside-container>
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@
|
||||||
this.isHide = true;
|
this.isHide = true;
|
||||||
},
|
},
|
||||||
selectModule(data) {
|
selectModule(data) {
|
||||||
this.currentModule = data;
|
this.currentModule = data.data;
|
||||||
},
|
},
|
||||||
exportAPI() {
|
exportAPI() {
|
||||||
if (!this.$refs.apiList[0].tableData) {
|
if (!this.$refs.apiList[0].tableData) {
|
||||||
|
|
|
@ -76,14 +76,14 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<ms-table-pagination :change="initApiTable" :current-page.sync="currentPage" :page-size.sync="pageSize"
|
<ms-table-pagination :change="initTable" :current-page.sync="currentPage" :page-size.sync="pageSize"
|
||||||
:total="total"/>
|
:total="total"/>
|
||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
<div id="svgResize"/>
|
<div id="svgResize"/>
|
||||||
<div id="svgDown">
|
<div id="svgDown">
|
||||||
<ms-bottom-container v-bind:enableAsideHidden="isHide">
|
<ms-bottom-container v-bind:enableAsideHidden="isHide">
|
||||||
<ms-api-case-list @apiCaseClose="apiCaseClose" @refresh="initApiTable" :visible="visible" :currentRow="currentRow" :api="selectApi"/>
|
<ms-api-case-list @apiCaseClose="apiCaseClose" @refresh="initTable" :visible="visible" :currentRow="currentRow" :api="selectApi"/>
|
||||||
</ms-bottom-container>
|
</ms-bottom-container>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -150,38 +150,35 @@
|
||||||
},
|
},
|
||||||
created: function () {
|
created: function () {
|
||||||
this.projectId = getCurrentProjectID();
|
this.projectId = getCurrentProjectID();
|
||||||
this.initApiTable();
|
this.initTable();
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.dragControllerDiv();
|
this.dragControllerDiv();
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
currentModule() {
|
currentModule() {
|
||||||
this.initApiTable();
|
this.initTable();
|
||||||
this.apiCaseClose();
|
this.apiCaseClose();
|
||||||
},
|
},
|
||||||
visible() {
|
visible() {
|
||||||
this.initApiTable();
|
this.initTable();
|
||||||
this.apiCaseClose();
|
this.apiCaseClose();
|
||||||
},
|
},
|
||||||
currentProtocol() {
|
currentProtocol() {
|
||||||
this.initApiTable();
|
this.initTable();
|
||||||
this.apiCaseClose();
|
this.apiCaseClose();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
initApiTable() {
|
initTable() {
|
||||||
|
this.selectRows = new Set();
|
||||||
this.condition.filters = ["Prepare", "Underway", "Completed"];
|
this.condition.filters = ["Prepare", "Underway", "Completed"];
|
||||||
if (this.currentModule != null) {
|
if (this.currentModule) {
|
||||||
if (this.currentModule.id == "root") {
|
this.condition.moduleIds = [this.currentModule.id];
|
||||||
this.condition.moduleIds = [];
|
}
|
||||||
} else if (this.currentModule.id == "gc") {
|
if (this.trashEnable) {
|
||||||
this.condition.moduleIds = [];
|
this.condition.filters = ["Trash"];
|
||||||
this.condition.filters = ["Trash"];
|
this.condition.moduleIds = [];
|
||||||
}
|
|
||||||
else {
|
|
||||||
this.condition.moduleIds = this.currentModule.ids;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (this.projectId != null) {
|
if (this.projectId != null) {
|
||||||
this.condition.projectId = this.projectId;
|
this.condition.projectId = this.projectId;
|
||||||
|
@ -193,7 +190,6 @@
|
||||||
this.total = response.data.itemCount;
|
this.total = response.data.itemCount;
|
||||||
this.tableData = response.data.listObject;
|
this.tableData = response.data.listObject;
|
||||||
});
|
});
|
||||||
this.selectRows = new Set();
|
|
||||||
},
|
},
|
||||||
handleSelect(selection, row) {
|
handleSelect(selection, row) {
|
||||||
row.hashTree = [];
|
row.hashTree = [];
|
||||||
|
@ -241,7 +237,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
search() {
|
search() {
|
||||||
this.initApiTable();
|
this.initTable();
|
||||||
},
|
},
|
||||||
buildPagePath(path) {
|
buildPagePath(path) {
|
||||||
return path + "/" + this.currentPage + "/" + this.pageSize;
|
return path + "/" + this.currentPage + "/" + this.pageSize;
|
||||||
|
@ -268,7 +264,7 @@
|
||||||
let ids = Array.from(this.selectRows).map(row => row.id);
|
let ids = Array.from(this.selectRows).map(row => row.id);
|
||||||
this.$post('/api/definition/deleteBatch/', ids, () => {
|
this.$post('/api/definition/deleteBatch/', ids, () => {
|
||||||
this.selectRows.clear();
|
this.selectRows.clear();
|
||||||
this.initApiTable();
|
this.initTable();
|
||||||
this.$success(this.$t('commons.delete_success'));
|
this.$success(this.$t('commons.delete_success'));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -282,7 +278,7 @@
|
||||||
let ids = Array.from(this.selectRows).map(row => row.id);
|
let ids = Array.from(this.selectRows).map(row => row.id);
|
||||||
this.$post('/api/definition/removeToGc/', ids, () => {
|
this.$post('/api/definition/removeToGc/', ids, () => {
|
||||||
this.selectRows.clear();
|
this.selectRows.clear();
|
||||||
this.initApiTable();
|
this.initTable();
|
||||||
this.$success(this.$t('commons.delete_success'));
|
this.$success(this.$t('commons.delete_success'));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -307,7 +303,7 @@
|
||||||
if (this.currentModule != undefined && this.currentModule.id == "gc") {
|
if (this.currentModule != undefined && this.currentModule.id == "gc") {
|
||||||
this.$get('/api/definition/delete/' + api.id, () => {
|
this.$get('/api/definition/delete/' + api.id, () => {
|
||||||
this.$success(this.$t('commons.delete_success'));
|
this.$success(this.$t('commons.delete_success'));
|
||||||
this.initApiTable();
|
this.initTable();
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -318,7 +314,7 @@
|
||||||
let ids = [api.id];
|
let ids = [api.id];
|
||||||
this.$post('/api/definition/removeToGc/', ids, () => {
|
this.$post('/api/definition/removeToGc/', ids, () => {
|
||||||
this.$success(this.$t('commons.delete_success'));
|
this.$success(this.$t('commons.delete_success'));
|
||||||
this.initApiTable();
|
this.initTable();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -268,7 +268,7 @@
|
||||||
},
|
},
|
||||||
saveApi(data) {
|
saveApi(data) {
|
||||||
this.setTabTitle(data);
|
this.setTabTitle(data);
|
||||||
this.$refs.apiList[0].initApiTable(data);
|
this.$refs.apiList[0].initTable(data);
|
||||||
},
|
},
|
||||||
|
|
||||||
showExecResult(row){
|
showExecResult(row){
|
||||||
|
|
|
@ -63,11 +63,11 @@
|
||||||
<ms-api-body-file-upload :parameter="item"/>
|
<ms-api-body-file-upload :parameter="item"/>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<!--<el-col v-if="type === 'body'" class="kv-select">-->
|
<el-col v-if="type === 'body'" class="kv-select">
|
||||||
<!--<el-input :disabled="isReadOnly" v-model="item.contentType" size="small"-->
|
<el-input :disabled="isReadOnly" v-model="item.contentType" size="small"
|
||||||
<!--@change="change" :placeholder="$t('api_test.request.content_type')" show-word-limit>-->
|
@change="change" :placeholder="$t('api_test.request.content_type')" show-word-limit>
|
||||||
<!--</el-input>-->
|
</el-input>
|
||||||
<!--</el-col>-->
|
</el-col>
|
||||||
|
|
||||||
<el-col class="kv-delete">
|
<el-col class="kv-delete">
|
||||||
<el-button size="mini" class="el-icon-delete-solid" circle @click="remove(index)"
|
<el-button size="mini" class="el-icon-delete-solid" circle @click="remove(index)"
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
<div class="variable-combine"> {{api.name}}</div>
|
<div class="variable-combine"> {{api.name}}</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="api.protocol==='HTTP'? 1:3">
|
<el-col :span="api.protocol==='HTTP'? 1:3">
|
||||||
<ms-tag v-if="api.status == 'Prepare'" type="info" effect="plain" :content="$t('test_track.plan.plan_status_prepare')"/>
|
<el-tag size="mini" :style="{'background-color': getColor(true, api.method), border: getColor(true, api.method)}" class="api-el-tag">
|
||||||
<ms-tag v-if="api.status == 'Underway'" type="warning" effect="plain" :content="$t('test_track.plan.plan_status_running')"/>
|
{{ api.method}}
|
||||||
<ms-tag v-if="api.status == 'Completed'" type="success" effect="plain" :content="$t('test_track.plan.plan_status_completed')"/>
|
</el-tag>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="api.protocol==='HTTP'? 4:0">
|
<el-col :span="api.protocol==='HTTP'? 4:0">
|
||||||
<div class="variable-combine" style="margin-left: 10px">{{api.path ===null ? " " : api.path}}</div>
|
<div class="variable-combine" style="margin-left: 10px">{{api.path ===null ? " " : api.path}}</div>
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
<div>
|
<div>
|
||||||
<el-select size="small" :placeholder="$t('api_test.definition.request.grade_info')" v-model="condition.priority"
|
<el-select size="small" :placeholder="$t('api_test.definition.request.grade_info')" v-model="condition.priority"
|
||||||
:disabled="isCaseEdit"
|
:disabled="isCaseEdit"
|
||||||
class="ms-api-header-select" @change="getApiTest">
|
class="ms-api-header-select" @change="getApiTest" clearable>
|
||||||
<el-option v-for="grd in priorities" :key="grd.id" :label="grd.name" :value="grd.id"/>
|
<el-option v-for="grd in priorities" :key="grd.id" :label="grd.name" :value="grd.id"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
|
@ -72,85 +72,93 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import ApiEnvironmentConfig from "../../../test/components/ApiEnvironmentConfig";
|
import ApiEnvironmentConfig from "../../../test/components/ApiEnvironmentConfig";
|
||||||
import {parseEnvironment} from "../../../test/model/EnvironmentModel";
|
import {parseEnvironment} from "../../../test/model/EnvironmentModel";
|
||||||
import MsTag from "../../../../common/components/MsTag";
|
import MsTag from "../../../../common/components/MsTag";
|
||||||
export default {
|
import {API_METHOD_COLOUR} from "../../model/JsonData";
|
||||||
name: "ApiCaseHeader",
|
|
||||||
components: {MsTag, ApiEnvironmentConfig},
|
export default {
|
||||||
data() {
|
name: "ApiCaseHeader",
|
||||||
return {
|
components: {MsTag, ApiEnvironmentConfig},
|
||||||
environments: [],
|
data() {
|
||||||
environment: {},
|
return {
|
||||||
|
environments: [],
|
||||||
|
environment: {},
|
||||||
|
methodColorMap: new Map(API_METHOD_COLOUR),
|
||||||
|
}
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
api: Object,
|
||||||
|
projectId: String,
|
||||||
|
priorities: Array,
|
||||||
|
apiCaseList: Array,
|
||||||
|
isReadOnly: Boolean,
|
||||||
|
isCaseEdit: Boolean,
|
||||||
|
condition: {
|
||||||
|
type: Object,
|
||||||
|
default() {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.environment = undefined;
|
||||||
|
this.getEnvironments();
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
environment() {
|
||||||
|
this.$emit('setEnvironment', this.environment);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getEnvironments() {
|
||||||
|
if (this.projectId) {
|
||||||
|
this.$get('/api/environment/list/' + this.projectId, response => {
|
||||||
|
this.environments = response.data;
|
||||||
|
this.environments.forEach(environment => {
|
||||||
|
parseEnvironment(environment);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.environment = undefined;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
props: {
|
openEnvironmentConfig() {
|
||||||
api: Object,
|
if (!this.projectId) {
|
||||||
projectId: String,
|
this.$error(this.$t('api_test.select_project'));
|
||||||
priorities: Array,
|
return;
|
||||||
apiCaseList: Array,
|
}
|
||||||
isReadOnly: Boolean,
|
this.$refs.environmentConfig.open(this.projectId);
|
||||||
isCaseEdit: Boolean,
|
},
|
||||||
condition: {
|
environmentChange(value) {
|
||||||
type: Object,
|
for (let i in this.environments) {
|
||||||
default() {
|
if (this.environments[i].id === value) {
|
||||||
return {}
|
this.environment = this.environments[i];
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
environmentConfigClose() {
|
||||||
this.environment = undefined;
|
|
||||||
this.getEnvironments();
|
this.getEnvironments();
|
||||||
},
|
},
|
||||||
watch: {
|
getApiTest() {
|
||||||
environment() {
|
this.$emit('getApiTest');
|
||||||
this.$emit('setEnvironment', this.environment);
|
},
|
||||||
|
addCase() {
|
||||||
|
this.$emit('addCase');
|
||||||
|
},
|
||||||
|
handleCommand(e) {
|
||||||
|
if (e === "run") {
|
||||||
|
this.$emit('batchRun');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getColor(enable, method) {
|
||||||
|
if (enable) {
|
||||||
|
return this.methodColorMap.get(method);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
|
||||||
getEnvironments() {
|
|
||||||
if (this.projectId) {
|
|
||||||
this.$get('/api/environment/list/' + this.projectId, response => {
|
|
||||||
this.environments = response.data;
|
|
||||||
this.environments.forEach(environment => {
|
|
||||||
parseEnvironment(environment);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.environment = undefined;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
openEnvironmentConfig() {
|
|
||||||
if (!this.projectId) {
|
|
||||||
this.$error(this.$t('api_test.select_project'));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.$refs.environmentConfig.open(this.projectId);
|
|
||||||
},
|
|
||||||
environmentChange(value) {
|
|
||||||
for (let i in this.environments) {
|
|
||||||
if (this.environments[i].id === value) {
|
|
||||||
this.environment = this.environments[i];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
environmentConfigClose() {
|
|
||||||
this.getEnvironments();
|
|
||||||
},
|
|
||||||
getApiTest() {
|
|
||||||
this.$emit('getApiTest');
|
|
||||||
},
|
|
||||||
addCase() {
|
|
||||||
this.$emit('addCase');
|
|
||||||
},
|
|
||||||
handleCommand(e) {
|
|
||||||
if (e === "run") {
|
|
||||||
this.$emit('batchRun');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
@ -190,5 +198,8 @@
|
||||||
line-height: 32px;
|
line-height: 32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.api-el-tag {
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -1,59 +1,59 @@
|
||||||
<template>
|
<template>
|
||||||
<el-form :model="basicForm" label-position="right" label-width="80px" size="small" :rules="rule" ref="basicForm" style="margin-right: 20px">
|
<div v-loading="loading">
|
||||||
<!-- 基础信息 -->
|
<el-form :model="basicForm" label-position="right" label-width="80px" size="small" :rules="rule" ref="basicForm" style="margin-right: 20px">
|
||||||
<el-row>
|
<!-- 基础信息 -->
|
||||||
<el-col :span="12">
|
<el-row>
|
||||||
<el-form-item :label="$t('commons.name')" prop="name">
|
<el-col :span="12">
|
||||||
<el-input class="ms-http-input" size="small" v-model="basicForm.name"/>
|
<el-form-item :label="$t('commons.name')" prop="name">
|
||||||
</el-form-item>
|
<el-input class="ms-http-input" size="small" v-model="basicForm.name"/>
|
||||||
</el-col>
|
</el-form-item>
|
||||||
<el-col :span="12">
|
</el-col>
|
||||||
<el-form-item :label="$t('test_track.module.module')" prop="moduleId">
|
<el-col :span="12">
|
||||||
<el-select class="ms-http-input" size="small" v-model="basicForm.moduleId" style="width: 100%">
|
<el-form-item :label="$t('test_track.module.module')" prop="moduleId">
|
||||||
<el-option v-for="item in moduleOptions" :key="item.id" :label="item.path" :value="item.id"/>
|
<el-select class="ms-http-input" size="small" v-model="basicForm.moduleId" style="width: 100%" @change="reload">
|
||||||
</el-select>
|
<el-option v-for="item in moduleOptions" :key="item.id" :label="item.path" :value="item.id"/>
|
||||||
</el-form-item>
|
</el-select>
|
||||||
</el-col>
|
</el-form-item>
|
||||||
</el-row>
|
</el-col>
|
||||||
<el-row>
|
</el-row>
|
||||||
<el-col :span="12">
|
<el-row>
|
||||||
<el-form-item :label="$t('commons.status')" prop="status">
|
<el-col :span="12">
|
||||||
<el-select class="ms-http-input" size="small" v-model="basicForm.status" style="width: 100%">
|
<el-form-item :label="$t('commons.status')" prop="status">
|
||||||
<el-option v-for="item in options" :key="item.id" :label="item.label" :value="item.id"/>
|
<el-select class="ms-http-input" size="small" v-model="basicForm.status" style="width: 100%">
|
||||||
</el-select>
|
<el-option v-for="item in options" :key="item.id" :label="item.label" :value="item.id"/>
|
||||||
</el-form-item>
|
</el-select>
|
||||||
</el-col>
|
</el-form-item>
|
||||||
<el-col :span="12">
|
</el-col>
|
||||||
<el-form-item :label="$t('api_test.definition.request.responsible')" prop="userId">
|
<el-col :span="12">
|
||||||
<el-select v-model="basicForm.userId"
|
<el-form-item :label="$t('api_test.definition.request.responsible')" prop="userId">
|
||||||
:placeholder="$t('api_test.definition.request.responsible')" filterable size="small"
|
<el-select v-model="basicForm.userId"
|
||||||
class="ms-http-input" style="width: 100%">
|
:placeholder="$t('api_test.definition.request.responsible')" filterable size="small"
|
||||||
<el-option
|
class="ms-http-input" style="width: 100%">
|
||||||
v-for="item in maintainerOptions"
|
<el-option
|
||||||
:key="item.id"
|
v-for="item in maintainerOptions"
|
||||||
:label="item.id + ' (' + item.name + ')'"
|
:key="item.id"
|
||||||
:value="item.id">
|
:label="item.id + ' (' + item.name + ')'"
|
||||||
</el-option>
|
:value="item.id">
|
||||||
</el-select>
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col>
|
<el-col>
|
||||||
<el-form-item :label="$t('commons.description')" prop="description">
|
<el-form-item :label="$t('commons.description')" prop="description">
|
||||||
<el-input class="ms-http-textarea"
|
<el-input class="ms-http-textarea"
|
||||||
v-model="basicForm.description"
|
v-model="basicForm.description"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
:autosize="{ minRows: 2, maxRows: 10}"
|
:autosize="{ minRows: 2, maxRows: 10}"
|
||||||
:rows="2" size="small"/>
|
:rows="2" size="small"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
</el-form>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
@ -81,6 +81,7 @@
|
||||||
httpVisible: false,
|
httpVisible: false,
|
||||||
currentModule: {},
|
currentModule: {},
|
||||||
maintainerOptions: [],
|
maintainerOptions: [],
|
||||||
|
loading: false,
|
||||||
rule: {
|
rule: {
|
||||||
name: [
|
name: [
|
||||||
{required: true, message: this.$t('test_track.case.input_name'), trigger: 'blur'},
|
{required: true, message: this.$t('test_track.case.input_name'), trigger: 'blur'},
|
||||||
|
@ -102,6 +103,12 @@
|
||||||
this.maintainerOptions = response.data;
|
this.maintainerOptions = response.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
reload() {
|
||||||
|
this.loading = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
validate() {
|
validate() {
|
||||||
this.$refs['basicForm'].validate((valid) => {
|
this.$refs['basicForm'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
|
|
@ -61,6 +61,7 @@
|
||||||
this.validateApi();
|
this.validateApi();
|
||||||
if (this.validated) {
|
if (this.validated) {
|
||||||
this.basisData.request = this.request;
|
this.basisData.request = this.request;
|
||||||
|
console.log(this.basisData)
|
||||||
this.$emit('saveApi', this.basisData);
|
this.$emit('saveApi', this.basisData);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -104,6 +104,7 @@
|
||||||
if (!this.httpForm.path.startsWith("/") || this.httpForm.path.match(/\s/) != null) {
|
if (!this.httpForm.path.startsWith("/") || this.httpForm.path.match(/\s/) != null) {
|
||||||
callback(this.$t('api_test.definition.request.path_valid_info'));
|
callback(this.$t('api_test.definition.request.path_valid_info'));
|
||||||
}
|
}
|
||||||
|
callback();
|
||||||
};
|
};
|
||||||
return {
|
return {
|
||||||
rule: {
|
rule: {
|
||||||
|
@ -172,7 +173,7 @@
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
this.getMaintainerOptions();
|
this.getMaintainerOptions();
|
||||||
this.httpForm = this.basisData;
|
this.httpForm = JSON.parse(JSON.stringify(this.basisData));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -66,6 +66,7 @@
|
||||||
let validateURL = (rule, value, callback) => {
|
let validateURL = (rule, value, callback) => {
|
||||||
try {
|
try {
|
||||||
new URL(this.debugForm.url);
|
new URL(this.debugForm.url);
|
||||||
|
callback();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
callback(this.$t('api_test.request.url_invalid'));
|
callback(this.$t('api_test.request.url_invalid'));
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<api-list-container
|
<api-list-container
|
||||||
:is-api-list-enable="isApiListEnable"
|
:is-api-list-enable="isApiListEnable"
|
||||||
@isApiListEnableChange="isApiListEnableChange">
|
@isApiListEnableChange="isApiListEnableChange">
|
||||||
<el-input placeholder="搜索" @blur="search" class="search-input" size="small" v-model="condition.name"/>
|
<el-input placeholder="搜索" @blur="search" class="search-input" size="small" @keyup.enter.native="search" v-model="condition.name"/>
|
||||||
|
|
||||||
<el-table v-loading="result.loading"
|
<el-table v-loading="result.loading"
|
||||||
border
|
border
|
||||||
|
|
|
@ -206,6 +206,8 @@
|
||||||
data.request = JSON.stringify(this.api.request);
|
data.request = JSON.stringify(this.api.request);
|
||||||
data.method = this.api.method;
|
data.method = this.api.method;
|
||||||
data.url = this.api.url;
|
data.url = this.api.url;
|
||||||
|
let id = getUUID();
|
||||||
|
data.id = id;
|
||||||
data.status = this.api.status;
|
data.status = this.api.status;
|
||||||
data.userId = this.api.userId;
|
data.userId = this.api.userId;
|
||||||
data.description = this.api.description;
|
data.description = this.api.description;
|
||||||
|
|
|
@ -3,7 +3,6 @@ import MsProject from "@/business/components/settings/project/MsProject";
|
||||||
export default {
|
export default {
|
||||||
path: "/api",
|
path: "/api",
|
||||||
name: "api",
|
name: "api",
|
||||||
redirect: "/api/home",
|
|
||||||
components: {
|
components: {
|
||||||
content: () => import('@/business/components/api/ApiTest')
|
content: () => import('@/business/components/api/ApiTest')
|
||||||
},
|
},
|
||||||
|
|
|
@ -9,17 +9,17 @@
|
||||||
router>
|
router>
|
||||||
|
|
||||||
<el-menu-item index="/track" v-permission="['test_manager','test_user','test_viewer']">
|
<el-menu-item index="/track" v-permission="['test_manager','test_user','test_viewer']">
|
||||||
{{$t('test_track.test_track')}}
|
{{ $t('test_track.test_track') }}
|
||||||
</el-menu-item>
|
</el-menu-item>
|
||||||
<el-menu-item index="/api" v-permission="['test_manager','test_user','test_viewer']">
|
<el-menu-item index="/api" @click="active()" v-permission="['test_manager','test_user','test_viewer']">
|
||||||
{{$t('commons.api')}}
|
{{ $t('commons.api') }}
|
||||||
</el-menu-item>
|
</el-menu-item>
|
||||||
<el-menu-item index="/performance" onselectstart="return false"
|
<el-menu-item index="/performance" onselectstart="return false"
|
||||||
v-permission="['test_manager','test_user','test_viewer']">
|
v-permission="['test_manager','test_user','test_viewer']">
|
||||||
{{$t('commons.performance')}}
|
{{ $t('commons.performance') }}
|
||||||
</el-menu-item>
|
</el-menu-item>
|
||||||
<el-menu-item index="/setting" onselectstart="return false">
|
<el-menu-item index="/setting" onselectstart="return false">
|
||||||
{{$t('commons.system_setting')}}
|
{{ $t('commons.system_setting') }}
|
||||||
</el-menu-item>
|
</el-menu-item>
|
||||||
</el-menu>
|
</el-menu>
|
||||||
</template>
|
</template>
|
||||||
|
@ -47,7 +47,18 @@
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleSelect(index) {
|
handleSelect(index) {
|
||||||
|
console.log(index)
|
||||||
this.activeIndex = index
|
this.activeIndex = index
|
||||||
|
|
||||||
|
},
|
||||||
|
active() {
|
||||||
|
if (this.activeIndex === '/api') {
|
||||||
|
if (this.$store.state.switch.value == 'new') {
|
||||||
|
window.location.href = "/#/api/home";
|
||||||
|
} else if (this.$store.state.switch.value == 'old') {
|
||||||
|
window.location.href = "/#/api/home_obsolete";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,6 +101,15 @@ export default {
|
||||||
this.$post("/user/update/current", {id: this.userId, lastProjectId: projectId}, () => {
|
this.$post("/user/update/current", {id: this.userId, lastProjectId: projectId}, () => {
|
||||||
localStorage.setItem(PROJECT_ID, projectId);
|
localStorage.setItem(PROJECT_ID, projectId);
|
||||||
let path = this.$route.matched[0].path ? this.$route.matched[0].path : '/';
|
let path = this.$route.matched[0].path ? this.$route.matched[0].path : '/';
|
||||||
|
if (path === '/api') {
|
||||||
|
if (this.$store.state.switch.value === 'new') {
|
||||||
|
path = "/api/home";
|
||||||
|
} else if (this.$store.state.switch.value === 'old') {
|
||||||
|
path = "/api/home_obsolete";
|
||||||
|
} else {
|
||||||
|
path = '/';
|
||||||
|
}
|
||||||
|
}
|
||||||
this.$router.push(path).then(() => {
|
this.$router.push(path).then(() => {
|
||||||
window.location.reload()
|
window.location.reload()
|
||||||
}).catch(err => err);
|
}).catch(err => err);
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
2. {{ $t('organization.integration.use_tip_two') }}
|
2. {{ $t('organization.integration.use_tip_two') }}
|
||||||
<router-link to="/track/project/all" style="margin-left: 5px">
|
<router-link to="/setting/project/all" style="margin-left: 5px">
|
||||||
{{ $t('organization.integration.link_the_project_now') }}
|
{{ $t('organization.integration.link_the_project_now') }}
|
||||||
</router-link>
|
</router-link>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
2. {{ $t('organization.integration.use_tip_two') }}
|
2. {{ $t('organization.integration.use_tip_two') }}
|
||||||
<router-link to="/track/project/all" style="margin-left: 5px">
|
<router-link to="/setting/project/all" style="margin-left: 5px">
|
||||||
{{ $t('organization.integration.link_the_project_now') }}
|
{{ $t('organization.integration.link_the_project_now') }}
|
||||||
</router-link>
|
</router-link>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
2. {{ $t('organization.integration.use_tip_two') }}
|
2. {{ $t('organization.integration.use_tip_two') }}
|
||||||
<router-link to="/track/project/all" style="margin-left: 5px">
|
<router-link to="/setting/project/all" style="margin-left: 5px">
|
||||||
{{ $t('organization.integration.link_the_project_now') }}
|
{{ $t('organization.integration.link_the_project_now') }}
|
||||||
</router-link>
|
</router-link>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -273,6 +273,7 @@ export default {
|
||||||
<style scoped>
|
<style scoped>
|
||||||
pre {
|
pre {
|
||||||
margin: 0 0;
|
margin: 0 0;
|
||||||
|
font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -1,26 +0,0 @@
|
||||||
<template>
|
|
||||||
<el-card>
|
|
||||||
<el-tabs class="system-setting" v-model="activeName">
|
|
||||||
<el-tab-pane label="项目管理" name="project">
|
|
||||||
<ms-project/>
|
|
||||||
</el-tab-pane>
|
|
||||||
</el-tabs>
|
|
||||||
</el-card>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import MsProject from "@/business/components/settings/project/MsProject";
|
|
||||||
export default {
|
|
||||||
name: "Project",
|
|
||||||
components: {MsProject},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
activeName: 'project'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
|
|
||||||
</style>
|
|
|
@ -13,11 +13,10 @@
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8" :offset="1">
|
<el-col :span="8" :offset="1">
|
||||||
<el-form-item
|
<el-form-item
|
||||||
:placeholder="$t('test_track.plan.input_name')"
|
|
||||||
:label="$t('test_track.plan.plan_name')"
|
:label="$t('test_track.plan.plan_name')"
|
||||||
:label-width="formLabelWidth"
|
:label-width="formLabelWidth"
|
||||||
prop="name">
|
prop="name">
|
||||||
<el-input v-model="form.name"></el-input>
|
<el-input v-model="form.name" :placeholder="$t('test_track.plan.input_plan_name')"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit d39dafaf84b9c7a56cb51f2caf67dd7dfde5938c
|
Subproject commit 010ad7a5f072a5e9d368c756a2473bbd20781433
|
|
@ -499,7 +499,7 @@ export default {
|
||||||
api_case_passing_rate: "Use case pass rate",
|
api_case_passing_rate: "Use case pass rate",
|
||||||
create_tip: "Note: Detailed interface information can be filled out on the edit page",
|
create_tip: "Note: Detailed interface information can be filled out on the edit page",
|
||||||
request: {
|
request: {
|
||||||
grade_info: "From high to low",
|
grade_info: "Filter by rank",
|
||||||
run_env: "Operating environment",
|
run_env: "Operating environment",
|
||||||
select_case: "Search use cases",
|
select_case: "Search use cases",
|
||||||
case: "Case",
|
case: "Case",
|
||||||
|
|
|
@ -497,7 +497,7 @@ export default {
|
||||||
api_case_passing_rate: "用例通过率",
|
api_case_passing_rate: "用例通过率",
|
||||||
create_tip: "注: 详细的接口信息可以在编辑页面填写",
|
create_tip: "注: 详细的接口信息可以在编辑页面填写",
|
||||||
request: {
|
request: {
|
||||||
grade_info: "按等级从高到低",
|
grade_info: "按等级筛选",
|
||||||
run_env: "运行环境",
|
run_env: "运行环境",
|
||||||
select_case: "搜索用例",
|
select_case: "搜索用例",
|
||||||
case: "用例",
|
case: "用例",
|
||||||
|
|
|
@ -497,7 +497,7 @@ export default {
|
||||||
api_case_passing_rate: "用例通過率",
|
api_case_passing_rate: "用例通過率",
|
||||||
create_tip: "註: 詳細的接口信息可以在編輯頁面填寫",
|
create_tip: "註: 詳細的接口信息可以在編輯頁面填寫",
|
||||||
request: {
|
request: {
|
||||||
grade_info: "按等級從高到低",
|
grade_info: "按等級筛选",
|
||||||
run_env: "運行環境",
|
run_env: "運行環境",
|
||||||
select_case: "搜索用例",
|
select_case: "搜索用例",
|
||||||
case: "用例",
|
case: "用例",
|
||||||
|
|
Loading…
Reference in New Issue