This commit is contained in:
chenjianxing 2020-09-17 11:02:27 +08:00
commit dc41ddc683
9 changed files with 47 additions and 13 deletions

View File

@ -224,6 +224,9 @@
#{id}
</foreach>
</if>
<if test="request.projectId!=null">
and test_case.project_id=#{request.projectId}
</if>
</where>
<if test="request.orders != null and request.orders.size() > 0">
order by

View File

@ -12,4 +12,5 @@ import java.util.List;
public class TestCaseBatchRequest extends TestCaseWithBLOBs {
private List<String> ids;
private List<OrderRequest> orders;
private String projectId;
}

View File

@ -76,6 +76,7 @@ public class XmindToTestCaseParser {
return jsonArray.toJSONString();
}
// 初始化一个用例
private void newTestCase(String title, String nodePath, List<Attached> attacheds) {
TestCaseWithBLOBs testCase = new TestCaseWithBLOBs();
testCase.setProjectId(projectId);
@ -88,6 +89,7 @@ public class XmindToTestCaseParser {
String tcArr[] = tc.split(":");
if (tcArr.length != 2) {
process.append(Translator.get("test_case_name") + "" + title + "" + Translator.get("incorrect_format"));
return;
}
// 用例名称
testCase.setName(tcArr[1].replace("tc:|tc", ""));

View File

@ -530,17 +530,15 @@ export class HeaderManager extends DefaultTestElement {
}
export class DNSCacheManager extends DefaultTestElement {
constructor(testName, domain, hosts) {
constructor(testName, hosts) {
super('DNSCacheManager', 'DNSCachePanel', 'DNSCacheManager', testName);
let collectionPropServers = this.collectionProp('DNSCacheManager.servers');
let collectionPropHosts = this.collectionProp('DNSCacheManager.hosts');
hosts.forEach(host => {
let elementProp = collectionPropHosts.elementProp(host.domain, 'StaticHost');
if (host && host.domain.trim().indexOf(domain.trim()) != -1) {
elementProp.stringProp('StaticHost.Name', host.domain);
elementProp.stringProp('StaticHost.Address', host.ip);
}
elementProp.stringProp('StaticHost.Name', host.domain);
elementProp.stringProp('StaticHost.Address', host.ip);
});
let boolProp = this.boolProp('DNSCacheManager.isCustomResolver', true);

View File

@ -214,7 +214,12 @@ export class Scenario extends BaseConfig {
this.databaseConfigs = [];
this.set(options);
this.sets({variables: KeyValue, headers: KeyValue, requests: RequestFactory, databaseConfigs: DatabaseConfig}, options);
this.sets({
variables: KeyValue,
headers: KeyValue,
requests: RequestFactory,
databaseConfigs: DatabaseConfig
}, options);
}
initOptions(options = {}) {
@ -1046,11 +1051,20 @@ class JMXGenerator {
if (request.environment) {
let commonConfig = request.environment.config.commonConfig;
let hosts = commonConfig.hosts;
if (commonConfig.enableHost) {
if (commonConfig.enableHost && hosts.length > 0) {
let name = request.name + " DNSCacheManager";
if (hosts.length > 0) {
//let domain = request.environment.protocol + "://" + request.environment.domain;
threadGroup.put(new DNSCacheManager(name, request.environment.config.httpConfig.domain, hosts));
// 强化判断如果未匹配到合适的host则不开启DNSCache
let domain = request.environment.config.httpConfig.domain;
let validHosts = [];
hosts.forEach(item => {
let d = item.domain.trim().replace("http://", "").replace("https://", "");
if (item && d === domain.trim()) {
item.domain = d; // 域名去掉协议
validHosts.push(item);
}
});
if (validHosts.length > 0) {
threadGroup.put(new DNSCacheManager(name, validHosts));
}
}
}

View File

@ -382,7 +382,7 @@ export default {
method: 'post',
responseType: 'blob',
// data: {ids: [...this.selectIds]}
data: {ids: ids}
data: {ids: ids, projectId: this.currentProject.id}
};
this.result = this.$request(config).then(response => {
const filename = this.$t('test_track.case.test_case') + ".xlsx";
@ -399,9 +399,22 @@ export default {
});
},
handleBatch(type) {
if (this.selectRows.size < 1) {
this.$warning(this.$t('test_track.plan_view.select_manipulate'));
return;
if (type === 'export') {
this.$alert(this.$t('test_track.case.export_all_cases'), '', {
confirmButtonText: this.$t('commons.confirm'),
callback: (action) => {
if (action === 'confirm') {
this.exportTestCase();
}
}
})
return;
} else {
this.$warning(this.$t('test_track.plan_view.select_manipulate'));
return;
}
}
if (type === 'move') {
let ids = Array.from(this.selectRows).map(row => row.id);

View File

@ -613,6 +613,7 @@ export default {
execution_result: ": Please select the execution result",
actual_result: ": The actual result is empty",
case: {
export_all_cases: 'Are you sure you want to export all use cases?',
input_test_case: 'Please enter the associated case name',
test_name: 'TestName',
other: '--Other--',

View File

@ -616,6 +616,7 @@ export default {
actual_result: ": 实际结果为空",
case: {
export_all_cases: '确定要导出全部用例吗?',
input_test_case: '请输入关联用例名称',
test_name: '测试名称',
other: "--其他--",

View File

@ -616,6 +616,7 @@ export default {
actual_result: ": 實際結果為空",
case: {
export_all_cases: '確定要匯出全部用例嗎?',
input_test_case: '請輸入關聯用例名稱',
test_name: '測試名稱',
other: "--其他--",