fix(接口自动化,测试跟踪): 修复匹配的环境请求头不起作用问题;修复思维导图导入问题。
This commit is contained in:
parent
9b110273bc
commit
25e03d010e
|
@ -505,11 +505,8 @@ public class MsHTTPSamplerProxy extends MsTestElement {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// HTTP 环境中请求头
|
// HTTP 环境中请求头
|
||||||
if (httpConfig != null) {
|
if (httpConfig != null && CollectionUtils.isNotEmpty(httpConfig.getHeaders())) {
|
||||||
Arguments arguments = arguments(httpConfig.getHeaders());
|
setHeader(tree, httpConfig.getHeaders());
|
||||||
if (arguments != null) {
|
|
||||||
tree.add(ParameterConfig.valueSupposeMock(arguments));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return httpConfig;
|
return httpConfig;
|
||||||
}
|
}
|
||||||
|
@ -538,25 +535,6 @@ public class MsHTTPSamplerProxy extends MsTestElement {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Arguments arguments(List<KeyValue> headers) {
|
|
||||||
Arguments arguments = new Arguments();
|
|
||||||
arguments.setEnabled(true);
|
|
||||||
arguments.setName(StringUtils.isNotEmpty(this.getName()) ? this.getName() : "Arguments");
|
|
||||||
arguments.setProperty(TestElement.TEST_CLASS, Arguments.class.getName());
|
|
||||||
arguments.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("ArgumentsPanel"));
|
|
||||||
|
|
||||||
// HTTP放到请求中,按照域名匹配
|
|
||||||
if (CollectionUtils.isNotEmpty(headers)) {
|
|
||||||
headers.stream().filter(KeyValue::isValid).filter(KeyValue::isEnable).forEach(keyValue ->
|
|
||||||
arguments.addArgument(keyValue.getName(), keyValue.getValue(), "=")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (arguments.getArguments() != null && arguments.getArguments().size() > 0) {
|
|
||||||
return arguments;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean isRest() {
|
private boolean isRest() {
|
||||||
return this.getRest().stream().filter(KeyValue::isEnable).filter(KeyValue::isValid).toArray().length > 0;
|
return this.getRest().stream().filter(KeyValue::isEnable).filter(KeyValue::isValid).toArray().length > 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -201,7 +201,7 @@ public class XmindCaseParser {
|
||||||
item.setParent(parent);
|
item.setParent(parent);
|
||||||
this.formatTestCase(item.getTitle(), parent.getPath(), item.getChildren() != null ? item.getChildren().getAttached() : null);
|
this.formatTestCase(item.getTitle(), parent.getPath(), item.getChildren() != null ? item.getChildren().getAttached() : null);
|
||||||
} else {
|
} else {
|
||||||
String nodePath = parent.getPath() + "/" + item.getTitle();
|
String nodePath = parent.getPath().trim() + "/" + item.getTitle().trim();
|
||||||
item.setPath(nodePath);
|
item.setPath(nodePath);
|
||||||
item.setParent(parent);
|
item.setParent(parent);
|
||||||
if (item.getChildren() != null && CollectionUtils.isNotEmpty(item.getChildren().getAttached())) {
|
if (item.getChildren() != null && CollectionUtils.isNotEmpty(item.getChildren().getAttached())) {
|
||||||
|
@ -286,7 +286,7 @@ public class XmindCaseParser {
|
||||||
// 用例名称
|
// 用例名称
|
||||||
String name = title.replace(tcArrs[0] + ":", "").replace(tcArrs[0] + ":", "");
|
String name = title.replace(tcArrs[0] + ":", "").replace(tcArrs[0] + ":", "");
|
||||||
testCase.setName(name);
|
testCase.setName(name);
|
||||||
testCase.setNodePath(nodePath);
|
testCase.setNodePath(nodePath.trim());
|
||||||
|
|
||||||
// 用例等级和用例性质处理
|
// 用例等级和用例性质处理
|
||||||
if (tcArrs[0].indexOf("-") != -1) {
|
if (tcArrs[0].indexOf("-") != -1) {
|
||||||
|
|
Loading…
Reference in New Issue