Merge branch 'master' of https://github.com/metersphere/metersphere
This commit is contained in:
commit
e23c4d84a8
|
@ -73,6 +73,10 @@ public class MsScenario extends MsTestElement {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void toHashTree(HashTree tree, List<MsTestElement> hashTree, ParameterConfig config) {
|
public void toHashTree(HashTree tree, List<MsTestElement> hashTree, ParameterConfig config) {
|
||||||
|
// 非导出操作,且不是启用状态则跳过执行
|
||||||
|
if (!config.isOperating() && !this.isEnable()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (this.getReferenced() != null && this.getReferenced().equals("Deleted")) {
|
if (this.getReferenced() != null && this.getReferenced().equals("Deleted")) {
|
||||||
return;
|
return;
|
||||||
} else if (this.getReferenced() != null && this.getReferenced().equals("REF")) {
|
} else if (this.getReferenced() != null && this.getReferenced().equals("REF")) {
|
||||||
|
@ -198,6 +202,8 @@ public class MsScenario extends MsTestElement {
|
||||||
config.getConfig().get(this.getProjectId()).getCommonConfig().getVariables().stream().filter(KeyValue::isValid).filter(KeyValue::isEnable).forEach(keyValue ->
|
config.getConfig().get(this.getProjectId()).getCommonConfig().getVariables().stream().filter(KeyValue::isValid).filter(KeyValue::isEnable).forEach(keyValue ->
|
||||||
arguments.addArgument(keyValue.getName(), keyValue.getValue(), "=")
|
arguments.addArgument(keyValue.getName(), keyValue.getValue(), "=")
|
||||||
);
|
);
|
||||||
|
// 清空变量,防止重复添加
|
||||||
|
config.getConfig().get(this.getProjectId()).getCommonConfig().getVariables().clear();
|
||||||
}
|
}
|
||||||
if (arguments.getArguments() != null && arguments.getArguments().size() > 0) {
|
if (arguments.getArguments() != null && arguments.getArguments().size() > 0) {
|
||||||
return arguments;
|
return arguments;
|
||||||
|
|
|
@ -27,6 +27,10 @@ public class MsAssertions extends MsTestElement {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void toHashTree(HashTree tree, List<MsTestElement> hashTree, ParameterConfig config) {
|
public void toHashTree(HashTree tree, List<MsTestElement> hashTree, ParameterConfig config) {
|
||||||
|
// 非导出操作,且不是启用状态则跳过执行
|
||||||
|
if (!config.isOperating() && !this.isEnable()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
addAssertions(tree);
|
addAssertions(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,10 @@ public class MsIfController extends MsTestElement {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void toHashTree(HashTree tree, List<MsTestElement> hashTree, ParameterConfig config) {
|
public void toHashTree(HashTree tree, List<MsTestElement> hashTree, ParameterConfig config) {
|
||||||
|
// 非导出操作,且不是启用状态则跳过执行
|
||||||
|
if (!config.isOperating() && !this.isEnable()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
final HashTree groupTree = tree.add(ifController());
|
final HashTree groupTree = tree.add(ifController());
|
||||||
if (CollectionUtils.isNotEmpty(hashTree)) {
|
if (CollectionUtils.isNotEmpty(hashTree)) {
|
||||||
hashTree.forEach(el -> {
|
hashTree.forEach(el -> {
|
||||||
|
|
|
@ -44,6 +44,10 @@ public class MsLoopController extends MsTestElement {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void toHashTree(HashTree tree, List<MsTestElement> hashTree, ParameterConfig config) {
|
public void toHashTree(HashTree tree, List<MsTestElement> hashTree, ParameterConfig config) {
|
||||||
|
// 非导出操作,且不是启用状态则跳过执行
|
||||||
|
if (!config.isOperating() && !this.isEnable()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
final HashTree groupTree = controller(tree);
|
final HashTree groupTree = controller(tree);
|
||||||
if (CollectionUtils.isNotEmpty(config.getVariables())) {
|
if (CollectionUtils.isNotEmpty(config.getVariables())) {
|
||||||
this.addCsvDataSet(groupTree, config.getVariables());
|
this.addCsvDataSet(groupTree, config.getVariables());
|
||||||
|
|
|
@ -26,7 +26,8 @@ public class MsDNSCacheManager extends MsTestElement {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void toHashTree(HashTree tree, List<MsTestElement> hashTree, ParameterConfig config) {
|
public void toHashTree(HashTree tree, List<MsTestElement> hashTree, ParameterConfig config) {
|
||||||
if (!this.isEnable()) {
|
// 非导出操作,且不是启用状态则跳过执行
|
||||||
|
if (!config.isOperating() && !this.isEnable()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (MsTestElement el : hashTree) {
|
for (MsTestElement el : hashTree) {
|
||||||
|
|
|
@ -30,6 +30,10 @@ public class MsExtract extends MsTestElement {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void toHashTree(HashTree tree, List<MsTestElement> hashTree, ParameterConfig config) {
|
public void toHashTree(HashTree tree, List<MsTestElement> hashTree, ParameterConfig config) {
|
||||||
|
// 非导出操作,且不是启用状态则跳过执行
|
||||||
|
if (!config.isOperating() && !this.isEnable()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
addRequestExtractors(tree);
|
addRequestExtractors(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,10 @@ public class MsJSR223Processor extends MsTestElement {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void toHashTree(HashTree tree, List<MsTestElement> hashTree, ParameterConfig config) {
|
public void toHashTree(HashTree tree, List<MsTestElement> hashTree, ParameterConfig config) {
|
||||||
|
// 非导出操作,且不是启用状态则跳过执行
|
||||||
|
if (!config.isOperating() && !this.isEnable()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
JSR223Sampler processor = new JSR223Sampler();
|
JSR223Sampler processor = new JSR223Sampler();
|
||||||
processor.setEnabled(this.isEnable());
|
processor.setEnabled(this.isEnable());
|
||||||
if (StringUtils.isNotEmpty(this.getName())) {
|
if (StringUtils.isNotEmpty(this.getName())) {
|
||||||
|
|
|
@ -29,6 +29,10 @@ public class MsJSR223PostProcessor extends MsTestElement {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void toHashTree(HashTree tree, List<MsTestElement> hashTree, ParameterConfig config) {
|
public void toHashTree(HashTree tree, List<MsTestElement> hashTree, ParameterConfig config) {
|
||||||
|
// 非导出操作,且不是启用状态则跳过执行
|
||||||
|
if (!config.isOperating() && !this.isEnable()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
JSR223PostProcessor processor = new JSR223PostProcessor();
|
JSR223PostProcessor processor = new JSR223PostProcessor();
|
||||||
processor.setEnabled(this.isEnable());
|
processor.setEnabled(this.isEnable());
|
||||||
if (StringUtils.isNotEmpty(this.getName())) {
|
if (StringUtils.isNotEmpty(this.getName())) {
|
||||||
|
|
|
@ -30,6 +30,10 @@ public class MsJSR223PreProcessor extends MsTestElement {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void toHashTree(HashTree tree, List<MsTestElement> hashTree, ParameterConfig config) {
|
public void toHashTree(HashTree tree, List<MsTestElement> hashTree, ParameterConfig config) {
|
||||||
|
// 非导出操作,且不是启用状态则跳过执行
|
||||||
|
if (!config.isOperating() && !this.isEnable()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
final HashTree jsr223PreTree = tree.add(getJSR223PreProcessor());
|
final HashTree jsr223PreTree = tree.add(getJSR223PreProcessor());
|
||||||
if (CollectionUtils.isNotEmpty(hashTree)) {
|
if (CollectionUtils.isNotEmpty(hashTree)) {
|
||||||
hashTree.forEach(el -> {
|
hashTree.forEach(el -> {
|
||||||
|
|
|
@ -60,6 +60,10 @@ public class MsDubboSampler extends MsTestElement {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void toHashTree(HashTree tree, List<MsTestElement> hashTree, ParameterConfig config) {
|
public void toHashTree(HashTree tree, List<MsTestElement> hashTree, ParameterConfig config) {
|
||||||
|
// 非导出操作,且不是启用状态则跳过执行
|
||||||
|
if (!config.isOperating() && !this.isEnable()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (this.getReferenced() != null && "Deleted".equals(this.getReferenced())) {
|
if (this.getReferenced() != null && "Deleted".equals(this.getReferenced())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,7 +93,10 @@ public class MsHTTPSamplerProxy extends MsTestElement {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void toHashTree(HashTree tree, List<MsTestElement> hashTree, ParameterConfig config) {
|
public void toHashTree(HashTree tree, List<MsTestElement> hashTree, ParameterConfig config) {
|
||||||
|
// 非导出操作,且不是启用状态则跳过执行
|
||||||
|
if (!config.isOperating() && !this.isEnable()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (this.getReferenced() != null && MsTestElementConstants.REF.name().equals(this.getReferenced())) {
|
if (this.getReferenced() != null && MsTestElementConstants.REF.name().equals(this.getReferenced())) {
|
||||||
this.getRefElement(this);
|
this.getRefElement(this);
|
||||||
}
|
}
|
||||||
|
@ -315,8 +318,10 @@ public class MsHTTPSamplerProxy extends MsTestElement {
|
||||||
headers.stream().filter(KeyValue::isValid).filter(KeyValue::isEnable).forEach(keyValue ->
|
headers.stream().filter(KeyValue::isValid).filter(KeyValue::isEnable).forEach(keyValue ->
|
||||||
headerManager.add(new Header(keyValue.getName(), keyValue.getValue()))
|
headerManager.add(new Header(keyValue.getName(), keyValue.getValue()))
|
||||||
);
|
);
|
||||||
|
if (headerManager.getHeaders().size() > 0) {
|
||||||
tree.add(headerManager);
|
tree.add(headerManager);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isURL(String str) {
|
public boolean isURL(String str) {
|
||||||
//转换为小写
|
//转换为小写
|
||||||
|
|
|
@ -58,6 +58,10 @@ public class MsJDBCSampler extends MsTestElement {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void toHashTree(HashTree tree, List<MsTestElement> hashTree, ParameterConfig config) {
|
public void toHashTree(HashTree tree, List<MsTestElement> hashTree, ParameterConfig config) {
|
||||||
|
// 非导出操作,且不是启用状态则跳过执行
|
||||||
|
if (!config.isOperating() && !this.isEnable()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (this.getReferenced() != null && MsTestElementConstants.REF.name().equals(this.getReferenced())) {
|
if (this.getReferenced() != null && MsTestElementConstants.REF.name().equals(this.getReferenced())) {
|
||||||
this.getRefElement(this);
|
this.getRefElement(this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,6 +72,10 @@ public class MsTCPSampler extends MsTestElement {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void toHashTree(HashTree tree, List<MsTestElement> hashTree, ParameterConfig config) {
|
public void toHashTree(HashTree tree, List<MsTestElement> hashTree, ParameterConfig config) {
|
||||||
|
// 非导出操作,且不是启用状态则跳过执行
|
||||||
|
if (!config.isOperating() && !this.isEnable()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (this.getReferenced() != null && MsTestElementConstants.REF.name().equals(this.getReferenced())) {
|
if (this.getReferenced() != null && MsTestElementConstants.REF.name().equals(this.getReferenced())) {
|
||||||
this.getRefElement(this);
|
this.getRefElement(this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,10 @@ public class MsConstantTimer extends MsTestElement {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void toHashTree(HashTree tree, List<MsTestElement> hashTree, ParameterConfig config) {
|
public void toHashTree(HashTree tree, List<MsTestElement> hashTree, ParameterConfig config) {
|
||||||
|
// 非导出操作,且不是启用状态则跳过执行
|
||||||
|
if (!config.isOperating() && !this.isEnable()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
final HashTree groupTree = tree.add(constantTimer());
|
final HashTree groupTree = tree.add(constantTimer());
|
||||||
if (CollectionUtils.isNotEmpty(hashTree)) {
|
if (CollectionUtils.isNotEmpty(hashTree)) {
|
||||||
hashTree.forEach(el -> {
|
hashTree.forEach(el -> {
|
||||||
|
|
|
@ -3,6 +3,7 @@ package io.metersphere.api.dto.definition.request.unknown;
|
||||||
import com.alibaba.fastjson.annotation.JSONType;
|
import com.alibaba.fastjson.annotation.JSONType;
|
||||||
import io.metersphere.api.dto.definition.request.MsTestElement;
|
import io.metersphere.api.dto.definition.request.MsTestElement;
|
||||||
import io.metersphere.api.dto.definition.request.ParameterConfig;
|
import io.metersphere.api.dto.definition.request.ParameterConfig;
|
||||||
|
import io.metersphere.commons.utils.LogUtil;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
|
@ -36,20 +37,25 @@ public class MsJmeterElement extends MsTestElement {
|
||||||
Object scriptWrapper = SaveService.loadElement(inputSource);
|
Object scriptWrapper = SaveService.loadElement(inputSource);
|
||||||
HashTree elementTree = tree;
|
HashTree elementTree = tree;
|
||||||
this.setElementType(scriptWrapper.getClass().getName());
|
this.setElementType(scriptWrapper.getClass().getName());
|
||||||
|
if (scriptWrapper instanceof TestElement) {
|
||||||
|
((TestElement) scriptWrapper).setName(this.getName());
|
||||||
|
((TestElement) scriptWrapper).setEnabled(this.isEnable());
|
||||||
|
}
|
||||||
if (config.isOperating()) {
|
if (config.isOperating()) {
|
||||||
elementTree = tree.add(scriptWrapper);
|
elementTree = tree.add(scriptWrapper);
|
||||||
} else if (!(scriptWrapper instanceof TestPlan) && !(scriptWrapper instanceof ThreadGroup)) {
|
} else if (!(scriptWrapper instanceof TestPlan) && !(scriptWrapper instanceof ThreadGroup)) {
|
||||||
elementTree = tree.add(scriptWrapper);
|
elementTree = tree.add(scriptWrapper);
|
||||||
}
|
}
|
||||||
if (scriptWrapper instanceof TestElement) {
|
if (!config.isOperating() && scriptWrapper instanceof ThreadGroup && !((ThreadGroup) scriptWrapper).isEnabled()) {
|
||||||
((TestElement) scriptWrapper).setName(this.getName());
|
LogUtil.info(((ThreadGroup) scriptWrapper).getName() + "是被禁用线程组不加入执行");
|
||||||
}
|
} else {
|
||||||
if (CollectionUtils.isNotEmpty(hashTree)) {
|
if (CollectionUtils.isNotEmpty(hashTree)) {
|
||||||
for (MsTestElement el : hashTree) {
|
for (MsTestElement el : hashTree) {
|
||||||
el.toHashTree(elementTree, el.getHashTree(), config);
|
el.toHashTree(elementTree, el.getHashTree(), config);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,7 +115,9 @@ public class ApiAutomationService {
|
||||||
if (map != null) {
|
if (map != null) {
|
||||||
if (map.isEmpty()) {
|
if (map.isEmpty()) {
|
||||||
List<String> ids = (List<String>) JSONPath.read(definition, "$..projectId");
|
List<String> ids = (List<String>) JSONPath.read(definition, "$..projectId");
|
||||||
|
if (CollectionUtils.isNotEmpty(ids)) {
|
||||||
idList.addAll(new HashSet<>(ids));
|
idList.addAll(new HashSet<>(ids));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Set<String> set = d.getEnvironmentMap().keySet();
|
Set<String> set = d.getEnvironmentMap().keySet();
|
||||||
idList = new ArrayList<>(set);
|
idList = new ArrayList<>(set);
|
||||||
|
@ -601,6 +603,7 @@ public class ApiAutomationService {
|
||||||
ParameterConfig config = new ParameterConfig();
|
ParameterConfig config = new ParameterConfig();
|
||||||
config.setConfig(envConfig);
|
config.setConfig(envConfig);
|
||||||
HashTree hashTree = request.getTestElement().generateHashTree(config);
|
HashTree hashTree = request.getTestElement().generateHashTree(config);
|
||||||
|
System.out.println(request.getTestElement().getJmx(hashTree));
|
||||||
// 调用执行方法
|
// 调用执行方法
|
||||||
APIScenarioReportResult reportResult = createScenarioReport(request.getId(), request.getScenarioId(), request.getScenarioName(), ReportTriggerMode.MANUAL.name(), request.getExecuteType(), request.getProjectId(),
|
APIScenarioReportResult reportResult = createScenarioReport(request.getId(), request.getScenarioId(), request.getScenarioName(), ReportTriggerMode.MANUAL.name(), request.getExecuteType(), request.getProjectId(),
|
||||||
SessionUtils.getUserId());
|
SessionUtils.getUserId());
|
||||||
|
|
|
@ -161,12 +161,12 @@
|
||||||
#{value}
|
#{value}
|
||||||
</foreach>
|
</foreach>
|
||||||
</when>
|
</when>
|
||||||
<otherwise>
|
<when test="key=='status'">
|
||||||
and test_case_review_test_case.status in
|
and test_case.review_status in
|
||||||
<foreach collection="values" item="value" separator="," open="(" close=")">
|
<foreach collection="values" item="value" separator="," open="(" close=")">
|
||||||
#{value}
|
#{value}
|
||||||
</foreach>
|
</foreach>
|
||||||
</otherwise>
|
</when>
|
||||||
</choose>
|
</choose>
|
||||||
</if>
|
</if>
|
||||||
</foreach>
|
</foreach>
|
||||||
|
|
|
@ -5,7 +5,7 @@ import io.metersphere.security.ApiKeyFilter;
|
||||||
import io.metersphere.security.CsrfFilter;
|
import io.metersphere.security.CsrfFilter;
|
||||||
import io.metersphere.security.UserModularRealmAuthenticator;
|
import io.metersphere.security.UserModularRealmAuthenticator;
|
||||||
import io.metersphere.security.realm.LdapRealm;
|
import io.metersphere.security.realm.LdapRealm;
|
||||||
import io.metersphere.security.realm.ShiroDBRealm;
|
import io.metersphere.security.realm.LocalRealm;
|
||||||
import org.apache.shiro.authc.pam.FirstSuccessfulStrategy;
|
import org.apache.shiro.authc.pam.FirstSuccessfulStrategy;
|
||||||
import org.apache.shiro.authc.pam.ModularRealmAuthenticator;
|
import org.apache.shiro.authc.pam.ModularRealmAuthenticator;
|
||||||
import org.apache.shiro.cache.MemoryConstrainedCacheManager;
|
import org.apache.shiro.cache.MemoryConstrainedCacheManager;
|
||||||
|
@ -70,7 +70,7 @@ public class ShiroConfig implements EnvironmentAware {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* securityManager 不用直接注入shiroDBRealm,可能会导致事务失效
|
* securityManager 不用直接注入 Realm,可能会导致事务失效
|
||||||
* 解决方法见 handleContextRefresh
|
* 解决方法见 handleContextRefresh
|
||||||
* http://www.debugrun.com/a/NKS9EJQ.html
|
* http://www.debugrun.com/a/NKS9EJQ.html
|
||||||
*/
|
*/
|
||||||
|
@ -85,8 +85,8 @@ public class ShiroConfig implements EnvironmentAware {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
@DependsOn("lifecycleBeanPostProcessor")
|
@DependsOn("lifecycleBeanPostProcessor")
|
||||||
public ShiroDBRealm shiroDBRealm() {
|
public LocalRealm localRealm() {
|
||||||
return new ShiroDBRealm();
|
return new LocalRealm();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
@ -135,10 +135,10 @@ public class ShiroConfig implements EnvironmentAware {
|
||||||
public void handleContextRefresh(ContextRefreshedEvent event) {
|
public void handleContextRefresh(ContextRefreshedEvent event) {
|
||||||
ApplicationContext context = event.getApplicationContext();
|
ApplicationContext context = event.getApplicationContext();
|
||||||
List<Realm> realmList = new ArrayList<>();
|
List<Realm> realmList = new ArrayList<>();
|
||||||
ShiroDBRealm shiroDBRealm = context.getBean(ShiroDBRealm.class);
|
LocalRealm localRealm = context.getBean(LocalRealm.class);
|
||||||
LdapRealm ldapRealm = context.getBean(LdapRealm.class);
|
LdapRealm ldapRealm = context.getBean(LdapRealm.class);
|
||||||
// 基本realm
|
// 基本realm
|
||||||
realmList.add(shiroDBRealm);
|
realmList.add(localRealm);
|
||||||
realmList.add(ldapRealm);
|
realmList.add(ldapRealm);
|
||||||
context.getBean(DefaultWebSecurityManager.class).setRealms(realmList);
|
context.getBean(DefaultWebSecurityManager.class).setRealms(realmList);
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,7 @@ public class LdapController {
|
||||||
userService.addLdapUser(user);
|
userService.addLdapUser(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 执行 ShiroDBRealm 中 LDAP 登录逻辑
|
// 执行 LocalRealm 中 LDAP 登录逻辑
|
||||||
LoginRequest loginRequest = new LoginRequest();
|
LoginRequest loginRequest = new LoginRequest();
|
||||||
loginRequest.setUsername(userId);
|
loginRequest.setUsername(userId);
|
||||||
return userService.login(loginRequest);
|
return userService.login(loginRequest);
|
||||||
|
|
|
@ -34,9 +34,9 @@ import java.util.stream.Collectors;
|
||||||
* set realm
|
* set realm
|
||||||
* </p>
|
* </p>
|
||||||
*/
|
*/
|
||||||
public class ShiroDBRealm extends AuthorizingRealm {
|
public class LocalRealm extends AuthorizingRealm {
|
||||||
|
|
||||||
private Logger logger = LoggerFactory.getLogger(ShiroDBRealm.class);
|
private Logger logger = LoggerFactory.getLogger(LocalRealm.class);
|
||||||
@Resource
|
@Resource
|
||||||
private UserService userService;
|
private UserService userService;
|
||||||
|
|
|
@ -551,8 +551,8 @@ public class TestPlanService {
|
||||||
queryTestPlanRequest.setId(planId);
|
queryTestPlanRequest.setId(planId);
|
||||||
|
|
||||||
TestPlanDTO testPlan = extTestPlanMapper.list(queryTestPlanRequest).get(0);
|
TestPlanDTO testPlan = extTestPlanMapper.list(queryTestPlanRequest).get(0);
|
||||||
String projectName = getProjectNameByPlanId(planId);
|
Project project = projectMapper.selectByPrimaryKey(testPlan.getProjectId());
|
||||||
testPlan.setProjectName(projectName);
|
testPlan.setProjectName(project.getName());
|
||||||
|
|
||||||
TestCaseReport testCaseReport = testCaseReportMapper.selectByPrimaryKey(testPlan.getReportId());
|
TestCaseReport testCaseReport = testCaseReportMapper.selectByPrimaryKey(testPlan.getReportId());
|
||||||
JSONObject content = JSONObject.parseObject(testCaseReport.getContent());
|
JSONObject content = JSONObject.parseObject(testCaseReport.getContent());
|
||||||
|
@ -708,8 +708,8 @@ public class TestPlanService {
|
||||||
queryTestPlanRequest.setId(planId);
|
queryTestPlanRequest.setId(planId);
|
||||||
|
|
||||||
TestPlanDTO testPlan = extTestPlanMapper.list(queryTestPlanRequest).get(0);
|
TestPlanDTO testPlan = extTestPlanMapper.list(queryTestPlanRequest).get(0);
|
||||||
String projectName = getProjectNameByPlanId(planId);
|
Project project = projectMapper.selectByPrimaryKey(testPlan.getProjectId());
|
||||||
testPlan.setProjectName(projectName);
|
testPlan.setProjectName(project.getName());
|
||||||
|
|
||||||
TestCaseReport testCaseReport = testCaseReportMapper.selectByPrimaryKey(testPlan.getReportId());
|
TestCaseReport testCaseReport = testCaseReportMapper.selectByPrimaryKey(testPlan.getReportId());
|
||||||
JSONObject content = JSONObject.parseObject(testCaseReport.getContent());
|
JSONObject content = JSONObject.parseObject(testCaseReport.getContent());
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit adefde265ff12d4ea909353c3f46008f8a8e17e7
|
Subproject commit c9fd084c8f4453d7697677a79d9a0a953c045e38
|
|
@ -8,8 +8,7 @@
|
||||||
<div class="ms-drawer-header">
|
<div class="ms-drawer-header">
|
||||||
<slot name="header"></slot>
|
<slot name="header"></slot>
|
||||||
<i v-if="isShowClose" class="el-icon-close" @click="close"/>
|
<i v-if="isShowClose" class="el-icon-close" @click="close"/>
|
||||||
<font-awesome-icon v-if="!isFullScreen && showFullScreen" class="alt-ico" :icon="['fa', 'expand-alt']" size="lg" @click="fullScreen"/>
|
<ms-full-screen-button v-if="showFullScreen" :is-full-screen.sync="isFullScreen"/>
|
||||||
<font-awesome-icon v-if="isFullScreen && showFullScreen" class="alt-ico" :icon="['fa', 'compress-alt']" size="lg" @click="unFullScreen"/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="ms-drawer-body">
|
<div class="ms-drawer-body">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
|
@ -23,9 +22,10 @@
|
||||||
import MsRight2LeftDragBar from "./dragbar/MsRight2LeftDragBar";
|
import MsRight2LeftDragBar from "./dragbar/MsRight2LeftDragBar";
|
||||||
import MsLeft2RightDragBar from "./dragbar/MsLeft2RightDragBar";
|
import MsLeft2RightDragBar from "./dragbar/MsLeft2RightDragBar";
|
||||||
import MsBottom2TopDragBar from "./dragbar/MsBottom2TopDragBar";
|
import MsBottom2TopDragBar from "./dragbar/MsBottom2TopDragBar";
|
||||||
|
import MsFullScreenButton from "@/business/components/common/components/MsFullScreenButton";
|
||||||
export default {
|
export default {
|
||||||
name: "MsDrawer",
|
name: "MsDrawer",
|
||||||
components: {MsBottom2TopDragBar, MsLeft2RightDragBar, MsRight2LeftDragBar},
|
components: {MsFullScreenButton, MsBottom2TopDragBar, MsLeft2RightDragBar, MsRight2LeftDragBar},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
x: 0,
|
x: 0,
|
||||||
|
@ -74,6 +74,15 @@
|
||||||
mounted() {
|
mounted() {
|
||||||
this.init();
|
this.init();
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
isFullScreen() {
|
||||||
|
if (this.isFullScreen) {
|
||||||
|
this.fullScreen()
|
||||||
|
} else {
|
||||||
|
this.unFullScreen();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
init() {
|
||||||
// todo 其他方向待优化
|
// todo 其他方向待优化
|
||||||
|
@ -123,12 +132,10 @@
|
||||||
this.originalH = this.h;
|
this.originalH = this.h;
|
||||||
this.w = document.body.clientWidth;
|
this.w = document.body.clientWidth;
|
||||||
this.h = document.body.clientHeight;
|
this.h = document.body.clientHeight;
|
||||||
this.isFullScreen = true;
|
|
||||||
},
|
},
|
||||||
unFullScreen() {
|
unFullScreen() {
|
||||||
this.w = this.originalW;
|
this.w = this.originalW;
|
||||||
this.h = this.originalH;
|
this.h = this.originalH;
|
||||||
this.isFullScreen = false;
|
|
||||||
},
|
},
|
||||||
close() {
|
close() {
|
||||||
this.$emit('close')
|
this.$emit('close')
|
||||||
|
@ -206,18 +213,10 @@
|
||||||
color: red;
|
color: red;
|
||||||
}
|
}
|
||||||
|
|
||||||
.alt-ico {
|
/deep/ .alt-ico {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
font-size: 15px;
|
|
||||||
right: 40px;
|
right: 40px;
|
||||||
top: 15px;
|
top: 15px;
|
||||||
color: #8c939d;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.alt-ico:hover {
|
|
||||||
color: black;
|
|
||||||
font-size: 18px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
<template>
|
||||||
|
<span class="fulls-screen-btn">
|
||||||
|
<font-awesome-icon v-if="!isFullScreen" class="alt-ico" :icon="['fa', 'expand-alt']" size="lg" @click="change(true)"/>
|
||||||
|
<font-awesome-icon v-if="isFullScreen" class="alt-ico" :icon="['fa', 'compress-alt']" size="lg" @click="change(false)"/>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "MsFullScreenButton",
|
||||||
|
props: {
|
||||||
|
isFullScreen: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
change(bool) {
|
||||||
|
this.$emit("update:isFullScreen", bool);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
.alt-ico:hover {
|
||||||
|
color: black;
|
||||||
|
font-size: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.alt-ico {
|
||||||
|
font-size: 15px;
|
||||||
|
color: #8c939d;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
|
@ -1,10 +1,10 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="minder">
|
<div class="minder" :class="{'full-screen': isFullScreen}">
|
||||||
|
<ms-full-screen-button :is-full-screen.sync="isFullScreen"/>
|
||||||
<minder-editor
|
<minder-editor
|
||||||
v-if="isActive"
|
v-if="isActive"
|
||||||
class="minder-container"
|
class="minder-container"
|
||||||
:import-json="importJson"
|
:import-json="importJson"
|
||||||
:height="700"
|
|
||||||
:progress-enable="false"
|
:progress-enable="false"
|
||||||
:tags="tags"
|
:tags="tags"
|
||||||
:distinct-tags="distinctTags"
|
:distinct-tags="distinctTags"
|
||||||
|
@ -15,9 +15,10 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
import MsFullScreenButton from "@/business/components/common/components/MsFullScreenButton";
|
||||||
export default {
|
export default {
|
||||||
name: "MsModuleMinder",
|
name: "MsModuleMinder",
|
||||||
components: {},
|
components: {MsFullScreenButton},
|
||||||
props: {
|
props: {
|
||||||
treeNodes: {
|
treeNodes: {
|
||||||
type: Array,
|
type: Array,
|
||||||
|
@ -58,10 +59,11 @@ export default {
|
||||||
},
|
},
|
||||||
"template":"default"
|
"template":"default"
|
||||||
},
|
},
|
||||||
isActive: true
|
isActive: true,
|
||||||
|
isFullScreen: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
created() {
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
dataMap() {
|
dataMap() {
|
||||||
|
@ -128,4 +130,33 @@ export default {
|
||||||
bottom: auto;
|
bottom: auto;
|
||||||
top: 30px;
|
top: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.minder {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fulls-screen-btn {
|
||||||
|
position: absolute;
|
||||||
|
top: 10px;
|
||||||
|
right: 10px;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.full-screen {
|
||||||
|
position: fixed;
|
||||||
|
top: 0px;
|
||||||
|
left: 0px;
|
||||||
|
width: 100%;
|
||||||
|
background: white;
|
||||||
|
height: 100vh;
|
||||||
|
z-index: 999999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.full-screen >>> .minder-container {
|
||||||
|
height: calc(100vh - 109px) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.full-screen .fulls-screen-btn {
|
||||||
|
right: 30px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -42,12 +42,11 @@
|
||||||
<br>
|
<br>
|
||||||
<div v-if="threadGroup.threadType === 'DURATION'">
|
<div v-if="threadGroup.threadType === 'DURATION'">
|
||||||
<el-form-item :label="$t('load_test.duration')">
|
<el-form-item :label="$t('load_test.duration')">
|
||||||
<!-- 最多两天的测试时长 -->
|
|
||||||
<el-input-number
|
<el-input-number
|
||||||
:disabled="isReadOnly"
|
:disabled="isReadOnly"
|
||||||
v-model="threadGroup.duration"
|
v-model="threadGroup.duration"
|
||||||
:min="1"
|
:min="1"
|
||||||
:max="99999"
|
:max="9999"
|
||||||
@change="calculateChart(threadGroup)"
|
@change="calculateChart(threadGroup)"
|
||||||
size="mini"/>
|
size="mini"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
|
@ -310,8 +310,6 @@ export default {
|
||||||
}
|
}
|
||||||
item.passRate=item.passRate+'%'
|
item.passRate=item.passRate+'%'
|
||||||
})
|
})
|
||||||
console.log(this.tableData)
|
|
||||||
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
copyData(status) {
|
copyData(status) {
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
import MsDialogFooter from '../../../../../common/components/MsDialogFooter'
|
import MsDialogFooter from '../../../../../common/components/MsDialogFooter'
|
||||||
import SelectMenu from "../../../../common/SelectMenu";
|
import SelectMenu from "../../../../common/SelectMenu";
|
||||||
import RelevanceDialog from "./RelevanceDialog";
|
import RelevanceDialog from "./RelevanceDialog";
|
||||||
|
import {getCurrentProjectID} from "@/common/js/utils";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "TestCaseRelevanceBase",
|
name: "TestCaseRelevanceBase",
|
||||||
|
@ -93,11 +94,18 @@
|
||||||
this.result = this.$get("/project/listAll", res => {
|
this.result = this.$get("/project/listAll", res => {
|
||||||
let data = res.data;
|
let data = res.data;
|
||||||
if (data) {
|
if (data) {
|
||||||
|
const index = data.findIndex(d => d.id === getCurrentProjectID());
|
||||||
this.projects = data;
|
this.projects = data;
|
||||||
|
if (index !== -1) {
|
||||||
|
this.projectId = data[index].id;
|
||||||
|
this.projectName = data[index].name;
|
||||||
|
this.changeProject(data[index]);
|
||||||
|
} else {
|
||||||
this.projectId = data[0].id;
|
this.projectId = data[0].id;
|
||||||
this.projectName = data[0].name;
|
this.projectName = data[0].name;
|
||||||
this.changeProject(data[0]);
|
this.changeProject(data[0]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -591,17 +591,23 @@ export default {
|
||||||
const project = res.data;
|
const project = res.data;
|
||||||
if (project.tapdId) {
|
if (project.tapdId) {
|
||||||
this.hasTapdId = true;
|
this.hasTapdId = true;
|
||||||
this.result = this.$get("/issues/tapd/user/" + this.testCase.caseId, response => {
|
this.result = this.$get("/issues/tapd/user/" + this.testCase.caseId).then(response => {
|
||||||
this.users = response.data;
|
this.users = response.data.data;
|
||||||
|
}).catch(() => {
|
||||||
|
console.log("get tapd user error.");
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (project.zentaoId) {
|
if (project.zentaoId) {
|
||||||
this.hasZentaoId = true;
|
this.hasZentaoId = true;
|
||||||
this.result = this.$get("/issues/zentao/builds/" + this.testCase.caseId, response => {
|
this.result = this.$get("/issues/zentao/builds/" + this.testCase.caseId).then(response => {
|
||||||
this.Builds = response.data;
|
this.Builds = response.data.data;
|
||||||
|
}).catch(() => {
|
||||||
|
console.log("get zentao builds error.");
|
||||||
})
|
})
|
||||||
this.result = this.$get("/issues/zentao/user/" + this.testCase.caseId, response => {
|
this.result = this.$get("/issues/zentao/user/" + this.testCase.caseId).then(response => {
|
||||||
this.zentaoUsers = response.data;
|
this.zentaoUsers = response.data.data;
|
||||||
|
}).catch(() => {
|
||||||
|
console.log("get zentao user error.");
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -649,8 +655,10 @@ export default {
|
||||||
this.testCase.zentaoAssigned = "";
|
this.testCase.zentaoAssigned = "";
|
||||||
},
|
},
|
||||||
getIssues(caseId) {
|
getIssues(caseId) {
|
||||||
this.result = this.$get("/issues/get/" + caseId, response => {
|
this.result = this.$get("/issues/get/" + caseId).then(response => {
|
||||||
this.issues = response.data;
|
this.issues = response.data.data;
|
||||||
|
}).catch(() => {
|
||||||
|
console.log("get issues error")
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
closeIssue(row) {
|
closeIssue(row) {
|
||||||
|
|
Loading…
Reference in New Issue